-
Notifications
You must be signed in to change notification settings - Fork 0
usage log database update #297
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
Conversation
Summary of ChangesHello @henrypark133, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the usage logging capabilities by introducing detailed tracking of why inference requests conclude. By adding Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces new fields for detailed usage tracking, specifically stop_reason, response_id, and provider_request_id, across the API, database, and service layers. Database migrations add provider_request_id and stop_reason columns to organization_usage_log, and request_type is made nullable. The StopReason enum is defined to categorize why an inference stream ended, including client disconnects and provider errors. The InterceptStream in the completions service is enhanced to capture finish_reason and errors to determine the stop_reason for usage logging. API routes and usage history endpoints are updated to expose these new fields, and e2e tests are modified to verify their correct population. Review comments highlight the need to re-include request_type in SELECT queries for backward compatibility, suggest increasing the stop_reason column size to VARCHAR(255) to prevent truncation, and request clarification on the consistent use of StopReason::Completed versus StopReason::Stop.
Code Review - Usage Log Database UpdateThank you for this comprehensive enhancement to usage tracking. The PR adds valuable telemetry with
|
|
6c2a798 to
2fc0092
Compare
|
@claude review |
Code Review - Usage Log Database Update (Follow-up)Thank you for addressing the previous feedback! I've reviewed the updated code and the fixes look good. The type mismatch issue has been properly resolved with the addition of ✅ VERIFIED FIXES
🔍 OBSERVATIONS (No Action Required)
📋 MINOR RECOMMENDATIONS (Optional)
✅ STATUS: APPROVED - All critical issues have been resolved. The PR is ready to merge. Excellent work on the comprehensive usage tracking enhancements! |
Adds
provider_request_id,stop_reason, and makesrequest_typenullable in the usage log table. ImplementsStopReasonenum tracking in the completions service to capture why streams ended (completed, length, content_filter, client_disconnect, provider_error, timeout, tool_calls, rate_limited) based on provider finish_reason or errors. Exposes these new fields in the usage history API response.