feat: Codebase sanitization to improve maintainability & readability#1055
feat: Codebase sanitization to improve maintainability & readability#1055
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a comprehensive cleanup and modernization of the codebase with a focus on enhancing maintainability and readability while transitioning to a traces-based architecture. Key changes include updating documentation and API references, removing unused legacy utilities, and standardizing error state terminology from "Failure" to "Indeterminate" to ensure consistency with OpenTelemetry guidelines.
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| agentops/sdk/decorators/factory.py | Updated import paths and standardized trace end states |
| agentops/sdk/decorators/init.py | Removed legacy logging calls and applied deprecation decorators |
| agentops/sdk/core.py | Adjusted docstring and end state parameter to match new terminology |
| agentops/sdk/converters.py | Removed legacy conversion helpers |
| agentops/logging/config.py & init.py | Updated import paths for logging utilities |
| agentops/legacy/init.py | Added deprecation decorators to legacy functions |
| agentops/instrumentation/* | Updated import paths and adjusted status values within instrumentation |
| agentops/helpers/* | Removed unused utilities and updated internal helpers |
| agentops/client/init.py & agentops/init.py | Updated import paths and introduced deprecation warnings for legacy params |
Comments suppressed due to low confidence (3)
agentops/sdk/decorators/factory.py:121
- [nitpick] Ensure that the change from 'Failure' to 'Indeterminate' is propagated throughout the codebase and that downstream systems correctly handle this updated state.
tracer.end_trace(trace_context, "Indeterminate")
agentops/instrumentation/ag2/instrumentor.py:438
- [nitpick] Verify that the update to use 'indeterminate' for unsuccessful code execution is consistent with logging and metric collection expectations in all related components.
span.set_attribute(ToolAttributes.TOOL_STATUS, "success" if exit_code == 0 else "indeterminate")
agentops/init.py:113
- [nitpick] Confirm that the deprecation warning for the 'tags' parameter (with guidance to use 'default_tags') is clearly documented to aid developers during migration.
if tags is not None:
📥 Pull Request
📘 Description
Relates to #1036.
This PR implements comprehensive codebase cleanup and modernization, transitioning from sessions-based to traces-based architecture while maintaining backward compatibility.
Key Changes:
debug.py,validation.py,formatters.py,converters.py,LiveSpanProcessor), and consolidated test files@deprecateddecorators, parameter warnings)tags→default_tagsparameter usageDocumentation Updates:
traces.mdxwith comprehensive trace management, states, and attributes documentationtags.mdx,sdk-reference.mdx, andmanual-trace-control.mdxwith current API patternsBackward Compatibility:
All legacy APIs remain functional with deprecation warnings. CrewAI integration patterns verified and maintained.
🧪 Testing