[Python SDK] Create custom exception classes
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."""
pass
Tasks
- 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.
Hey! I've finished with my first issue. May I continue with this one?
Thanks for picking this up, @1khazipov! :tada:
Here's what to expect:
- We'll check in after 7 days if we haven't heard an update
- After 14 days, we'll send a second reminder
- After 21 days without activity, we'll unassign to let others contribute
Tips for success:
- Drop a comment when you start working on it
- Share any blockers - we're here to help!
- Link your PR with
Fixes #111in the description
Happy coding! :rocket:
Hey @1khazipov! :wave:
Just a friendly reminder that you're assigned to this issue. It's been about a week since assignment.
How's it going? We'd love to hear:
- Any progress updates?
- Running into any blockers we can help with?
- Need more time? (Totally fine!)
A quick comment helps us know you're still interested. If your plans have changed, no worries at all - just let us know and we can find another contributor.
Thanks for contributing to AgentField! :rocket:
Hi @1khazipov,
Just checking in again! It's been 14 days since we last heard from you on this issue.
Quick options:
- :speech_balloon: Drop a comment with a progress update
- :link: Link a draft PR if you've started working on it
- :wave: Let us know if you'd like to be unassigned (no judgment!)
If we don't hear back in 7 days, we'll unassign this issue to give other contributors a chance to help.
Thanks for understanding!
Hi @1khazipov,
It's been 21 days since the last update on this issue. To keep the project moving, we've unassigned this issue so other contributors can pick it up.
No worries at all! Life happens, and we totally understand. If you'd like to continue working on this, just comment here and we'll reassign it to you.
This issue is now available for anyone who'd like to contribute. Check out our contribution guidelines if you're interested!
Thanks for your interest in AgentField! :heart:
Hey, I'm new to open contribution can I give it a try on this issue ?
Thanks for picking this up, @Baradwaz-122! :tada:
Here's what to expect:
- We'll check in after 7 days if we haven't heard an update
- After 14 days, we'll send a second reminder
- After 21 days without activity, we'll unassign to let others contribute
Tips for success:
- Drop a comment when you start working on it
- Share any blockers - we're here to help!
- Link your PR with
Fixes #111in the description
Happy coding! :rocket: