Add mode, auto model and market cost to microdollar usage#681
Open
chrarnoldus wants to merge 7 commits intomainfrom
Open
Add mode, auto model and market cost to microdollar usage#681chrarnoldus wants to merge 7 commits intomainfrom
chrarnoldus wants to merge 7 commits intomainfrom
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds three new fields to the usage tracking pipeline:
The implementation is clean and consistent:
Previous review comments about missing length limits and missing migration are now addressed by this revision. Files Reviewed (11 files)
|
- add mode and kilo_auto_model in MicrodollarUsageContext - plumb fields through insertUsageRecord and metadata - extend microdollar_usage_metadata and microdollar_usage_view schemas - propagate through admin/dev routes and API routes (consume-credits, fim completions, openrouter) - update tests, helpers, and benchmarks to include new fields with null defaults - ensure backward compatibility by allowing null for new columns
update database schema and views to use auto_model instead of kilo_auto_model align metadata fields accordingly propagate changes through API routes, processing logic, tests, and scripts to reference auto_model
introduce new mode and auto_model tables with primary keys and unique constraints on their value fields update microdollar_usage_metadata to reference mode_id and auto_model_id instead of text fields update microdollar_usage_view to join new tables and expose mode and auto_model values via aliases md and am update processUsage to upsert mode and auto_model and store IDs in mode_id and auto_model_id via CTEs
…ader Use shared helper to extract and bound the header value, replacing direct header access and trim
Stores the real cost before free/BYOK/promo zeroing, so we can track the actual market value of requests even when the user isn't charged.
9a1a666 to
c6a34ce
Compare
markijbema
approved these changes
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.