Investigate user session logging failures
📥 Pull Request
📘 Description This PR addresses a critical issue where AgentOps sessions would appear to initialize (displaying a session URL) but no data would reach the backend due to silent authentication or export failures. The changes introduce robust diagnostic tools and significantly enhance error visibility to empower users in debugging connectivity problems.
Key improvements include:
- Enhanced Session URL Feedback: Session URLs are now color-coded (blue, yellow, red) to reflect real-time authentication status, providing immediate visual feedback on connectivity.
- Improved Error Reporting: More explicit and actionable warning messages are provided for authentication and span export failures, clearly indicating when session data is not being sent to the backend.
- New Diagnostic Tools: Introduced
agentops.diagnose_session()andagentops.print_session_status()to provide detailed, user-friendly reports on SDK health, authentication status, and export statistics. - Connectivity Test Helper: Added a new module (
agentops.helpers.debug_session) and an example script (examples/debug_session_connectivity.py) for comprehensive end-to-end connectivity testing.
🧪 Testing
The changes were validated by creating and running the new examples/debug_session_connectivity.py script. This script utilizes the agentops.helpers.debug_session.test_session_connectivity function to simulate various scenarios (e.g., no API key, invalid API key, successful authentication) and verify that the improved error reporting, color-coded URLs, and diagnostic outputs behave as expected.
Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents
This pull request has been automatically marked as stale because it has not had any activity in the last 14 days.
If no updates are made within 7 days, this PR will be automatically closed.