-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Objective
Review all exception usage and documentation across the Python agent framework to ensure consistency and completeness.
Background
As part of the Python API review (issue #2902, item 9), we identified a need to standardize exception documentation practices.
Tasks
-
Audit Current State
- Review all
raisestatements across the codebase (546+ identified across 140 files) - Review all
Raises:sections in docstrings (55 files currently have them) - Document current patterns and inconsistencies
- Review all
-
Define Documentation Guidelines
- Standard Python exceptions (TypeError, ValueError, KeyError, etc.): Only document when the condition is non-obvious or when it provides value to API users
- Framework exceptions (AgentInitializationError, AgentExecutionException, etc.): Always document with clear descriptions
- Format: Use standard
Raises: ExceptionType: Descriptionformat
-
Update Documentation
- Apply guidelines to all public API methods
- Ensure consistency across the codebase
- Focus on user-facing APIs first
-
Review Exception Types
- Review custom exceptions in
/packages/core/agent_framework/exceptions.py - Ensure appropriate exception types are used throughout
- Consider if any new exception types are needed
- Review custom exceptions in
Success Criteria
- Clear guidelines documented for when to document exceptions
- Consistent exception documentation across all public APIs
- All framework-defined exceptions are properly documented
Closes #2902 (item 9)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status