Repository navigation
feat(usage): include OpenCodex activity - #7939
Hylouis233 wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f2c7b8259
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ApprovabilityVerdict: Skipped Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically. |
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo Closing this PR after an automated pass over open pull requests. Expands usage contracts and client interfaces for a provider that the product does not support. |
What Changed
OPENCODEX_HOME/usage.jsonlledger in a bounded worker, with 90-day window coverage metadata, durable cache reuse, request-id deduplication, and incomplete-source reporting.Why
OpenCodex already records authoritative per-request token usage for its command-line and desktop/tray surfaces, but T3 Code does not currently include that activity. Reading the provider-owned ledger keeps usage complete even when requests were not initiated by T3 Code and avoids summing retry attempts twice.
UI Changes
The Usage page gains an OpenCodex provider mark, chart series, table column, model breakdown, and explicit partial/failed-store notice on web and mobile. Screenshots are omitted because the populated view depends on private local usage history; there is no motion or interaction change.
Validation
t3,@t3tools/web,@t3tools/mobile,@t3tools/contracts, and@t3tools/sharedgit diff --checkpassed for all 25 changed filesMerge ordering
This branch is independently compatible with current
mainand uses usage contract v5. PRs #7877, #7904, #7936, and this PR each add a v5 provider independently; whichever merges later must rebase and advance the combined contract/cache migration as needed.Checklist
Note
Add OpenCodex activity to usage tracking and bump contract to v5
Macroscope summarized 9057972.
Note
Medium Risk
Touches the usage contract, on-disk scan cache (v2→v3), and merge ownership of duplicate stores, which can change reported totals. Also introduces an eval’d worker to parse large ledgers off the event loop.
Overview
Adds OpenCodex to usage reporting: clients advertise contract v5, the server reads
OPENCODEX_HOME/usage.jsonl(default~/.opencodex), and web/mobile charts, tables, and legends include the new provider.The server parses the append-only ledger in a bounded worker, splits inclusive cache tokens, normalizes account-scoped provider ids, and prices via the existing LiteLLM table. Scan cache v3 stores a coverage bound so a narrower OpenCodex window can reuse a broader scan. Legacy clients still get v4 responses with OpenCodex omitted.
Source health is now
ok/partial/failedinstead of treating I/O errors as missing. Merge prefers a complete duplicate over a partial one, drops fully failed stores from totals, and surfacesincompleteSourcesin the coverage notice.Reviewed by Cursor Bugbot for commit 9057972. Bugbot is set up for automated code reviews on this repo. Configure here.