-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Labels
good first issueGood for newcomersGood for newcomersrefactorCode quality and refactoring improvementsCode quality and refactoring improvementssdk:pythonPython SDK relatedPython SDK related
Description
Summary
The Python SDK currently uses generic exceptions like RuntimeError and Exception. Creating domain-specific exception classes will improve error handling and debugging.
Current State
- Location:
sdk/python/agentfield/ - Issue: Generic exceptions throughout the codebase
- Current: Only
RateLimitErrorexists as a custom exception
Proposed Exception Classes
Create the following exception hierarchy:
class AgentFieldError(Exception):
"""Base exception for all AgentField SDK errors."""
pass
class AgentFieldClientError(AgentFieldError):
"""Error communicating with the AgentField control plane."""
pass
class ExecutionTimeoutError(AgentFieldError):
"""Execution timed out waiting for completion."""
pass
class MemoryAccessError(AgentFieldError):
"""Error accessing agent memory storage."""
pass
class RegistrationError(AgentFieldError):
"""Error registering agent with control plane."""
pass
class ValidationError(AgentFieldError):
"""Input validation error."""
passTasks
- Create
sdk/python/agentfield/exceptions.pywith exception classes - Export exceptions from
sdk/python/agentfield/__init__.py - Update docstrings with raised exceptions information
Acceptance Criteria
- Exception classes created in
exceptions.py - Exceptions exported in package
__init__.py - Each exception class has a clear docstring
- Tests pass (
pytest) - Linting passes (
ruff check)
Files
sdk/python/agentfield/exceptions.py(new)sdk/python/agentfield/__init__.py(update exports)
Using AI to solve this issue? Read our AI-Assisted Contributions guide for testing requirements, prompt strategies, and common pitfalls to avoid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersrefactorCode quality and refactoring improvementsCode quality and refactoring improvementssdk:pythonPython SDK relatedPython SDK related