Skip to content

Conversation

@dot-agi
Copy link
Member

@dot-agi dot-agi commented Jun 9, 2025

📥 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:

  • Documentation Overhaul: Replaced sessions documentation with comprehensive traces concepts, updated API references, and corrected parameter usage throughout
  • Codebase Modernization: Converted to absolute imports, removed unused utilities (debug.py, validation.py, formatters.py, converters.py, LiveSpanProcessor), and consolidated test files
  • Deprecation System: Implemented structured deprecation framework with user-friendly warnings for legacy APIs (@deprecated decorators, parameter warnings)
  • API Standardization: Updated terminology from "Failure" to "Indeterminate" for OpenTelemetry compliance, corrected tagsdefault_tags parameter usage

Documentation Updates:

  • New traces.mdx with comprehensive trace management, states, and attributes documentation
  • Updated tags.mdx, sdk-reference.mdx, and manual-trace-control.mdx with current API patterns
  • Enhanced navigation structure reflecting traces-based architecture

Backward Compatibility:
All legacy APIs remain functional with deprecation warnings. CrewAI integration patterns verified and maintained.

🧪 Testing

  • All existing tests pass with updated expectations
  • Legacy API compatibility verified with proper deprecation warnings
  • Session test consolidation completed without functionality loss

@dot-agi dot-agi self-assigned this Jun 9, 2025
@dot-agi dot-agi added enhancement New feature or request do not merge labels Jun 9, 2025
@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 84.00000% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agentops/helpers/deprecation.py 69.56% 7 Missing ⚠️
agentops/instrumentation/ag2/instrumentor.py 0.00% 2 Missing ⚠️
agentops/__init__.py 75.00% 1 Missing ⚠️
agentops/instrumentation/crewai/instrumentation.py 0.00% 1 Missing ⚠️
agentops/sdk/decorators/factory.py 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dot-agi dot-agi requested review from Copilot and tcdent June 9, 2025 19:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

@dot-agi dot-agi linked an issue Jun 9, 2025 that may be closed by this pull request
@dot-agi dot-agi merged commit f9a01c7 into main Jun 11, 2025
10 checks passed
@dot-agi dot-agi deleted the feat/old-codebase-cleanup branch June 11, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

investigate ways to clean sdk

4 participants