-
Notifications
You must be signed in to change notification settings - Fork 181
Show braintrust traces on exceptions #1048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdds error-path traceability in interactive mode: upon exceptions, after logging/printing the error, the code fetches a trace URL from the tracer and, if present, prints a "View trace" link, aligning error handling with the existing success-path trace output. No public API or signature changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as Interactive CLI
participant Engine
participant Tracer
User->>CLI: Enter command
CLI->>Engine: Execute
alt Success
Engine-->>CLI: Result
CLI->>Tracer: get_trace_url()
Tracer-->>CLI: trace URL (optional)
CLI-->>User: Output result
opt Trace available
CLI-->>User: "View trace: <url>"
end
else Error
Engine-->>CLI: Exception
CLI-->>User: Error message
CLI->>Tracer: get_trace_url()
Tracer-->>CLI: trace URL (optional)
opt Trace available
CLI-->>User: "View trace: <url>"
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)holmes/interactive.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
break | ||
except EOFError: # Handle Ctrl+D | ||
break | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about printing trace_ur in the finally logic and removing L1256?
When testing deepseek with SambaNova, I ran into an issue where SambaNova was returning errors. I wanted to troubleshoot it with
--trace=braintrust
, but couldn't do so because traces are not shown on exceptions from the LLM. This PR fixes that.