GeezerVison is showing github.com — fix(usage): exclude legacy Codex sources from combined totals by juliusmarminge · Pull Request #21664 · pingdotgg/t3code
Conversation
Problem
Codex transcript sources need a new accounting version before active and archived rollouts can share a stable identity. Combining old and new identities can count the same history twice.
Change
Bump usage accounting to v7 and exclude only Codex from otherwise compatible v4–v6 summaries. Share mismatch detection and the warning text between web and mobile. The dependent scanning layer changes source identity and enables archived rollouts.
Scope and approval
Addresses the archived-rollout omission in #7090. Maintainer accounting approval is pending; no approval comment is claimed.
Built from @maria-rcks’s archived-session fix in #15451. Adversarial review found that adding a second source could count moved rollouts twice across environments, so this replacement separates compatibility from scanning. Companion layer: #21666. Both layers must ship together. Human approval of the accounting change is still required; neither PR has been merged.
Compatibility: new clients omit Codex data from v4–v6 servers while retaining their other providers. Older v6 clients reject all usage from a v7 server until upgraded. Independently configured Codex homes that share only a symlinked sessions directory can still count twice across environments; standard aliases of the same home deduplicate.
Verification limitations: Linux server and web only. No macOS, Windows, iOS, Android, or Electron desktop run; no real upstream account or billing validation. Shared compatibility logic and web/mobile typechecks cover the native-client code change, but do not replace native verification.
Verification
Validation: shared usage merge/format tests 37 → 39 across two existing files; both new regressions failed before the change. Shared, contracts, web and mobile typechecks and scoped lint/format passed. Reviews: the initial narrow review found cross-environment double-counting; stack round 1 found a removed-alias cache migration bug. Both were reproduced and fixed. Opus and Sol independently reviewed the full updated stack in rounds 2 and 3 with no code blockers. Round 3 includes the CI cleanup that makes the former exported version helper private. Opus also ran 251 server usage/driver tests and 39 shared tests successfully.
CI found an unused exported helper, now fixed and verified with the scoped Knip exports check. Three unchanged browser suites passed 14/14 tests on both the actual base and this implementation in fresh focused runs; their CI failures were not reproduced locally. The latest full CI workflows pass on both layers: #21664 CI, attempt 2 at 077708030d, and #21666 CI at 3482136b91. The bottom layer passed after one rerun of the failed browser jobs. Human accounting approval remains pending on both layers. Earlier superseded workflows were cancelled during the stack push; their results are not the current workflow result.
Browser proof from actual base (1451e7cb23) and implementation (captured at 12aa22b0dd; runtime behavior is unchanged by the subsequent export-only cleanup), same viewport and injected v6 summary containing 30 synthetic Codex tokens. The fixture replaces the client usage atom's read value temporarily; it does not simulate a live legacy-server handshake. The loaded client renders its own merge and notice logic.
Before — incompatible Codex accounting was accepted:

After — Codex excluded with a specific update notice:

Implementation: Codex gpt-6.1-sol; tests: Codex gpt-6-astra; reviews: Claude Opus 5.5 and Codex gpt-6-sol, through T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
juliusmarminge
changed the title
codex 02/archive compat
fix(usage): exclude legacy Codex sources from combined totals
Oct 19, 2026
This was referenced Oct 19, 2026
Approvability
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR changes usage contract semantics and production aggregation by excluding legacy Codex data from cost, token, session, and provider totals while retaining other providers. The behavior is narrowly tested, but its impact on metering/accounting totals and automatic data inclusion warrants human review.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
20.9 KiB |
20.9 KiB |
0 B (0.0%) |
29.3 KiB |
✅ |
| Codex |
Live turn messages |
2 |
2 |
0 (0.0%) |
8 |
✅ |
| Claude |
Total thread wire |
5.0 KiB |
5.0 KiB |
+7 B (+0.1%) |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
+7 B (+0.6%) |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
21.2 KiB |
21.2 KiB |
0 B (0.0%) |
29.3 KiB |
✅ |
| Claude |
Live turn messages |
2 |
2 |
0 (0.0%) |
8 |
✅ |
Baseline: 1451e7c · PR result: 0777080 · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
0b386f60-5439-4084-85fa-fc00d362bb3f
📥 Commits
-
Reviewing files that changed from the base of the PR and between ece1c20 and 0777080.
📒 Files selected for processing: 1
-
packages/shared/src/usageMerge.ts
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
-
The usage contract advances to version 7. Shared mismatch detection identifies legacy Codex data and filters its sources and buckets from merged usage. Mobile and web status checks use the shared mismatch helper, and mismatch messages identify Codex exclusions.
Changes: Usage contract and Codex accounting
| Layer / File(s) |
Summary |
Version mismatch detection and usage merging packages/contracts/src/usage.ts, packages/shared/src/usageMerge.ts, packages/shared/src/usageMerge.test.ts |
The contract version changes from 6 to 7. The shared helper identifies version mismatches and legacy Codex data. Merging removes Codex sources and buckets for those mismatches while retaining other summary data. Tests cover legacy and current contract versions. |
Mismatch messages and environment status packages/shared/src/usageFormat.ts, packages/shared/src/usageFormat.test.ts, apps/mobile/src/features/usage/UsageRouteScreen.tsx, apps/web/src/components/usage/UsagePage.tsx |
Mismatch messages identify when Codex usage is excluded. Mobile and web environment status checks use the shared mismatch helper. |
Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers: maria-rcks, tris203
Merge Risk: ⚪ Minimal · up to 07770
-
The change excludes legacy Codex usage from combined totals to avoid double counting. No concrete merge-blocking risk was identified, though maintainer accounting approval is reported as pending.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely identifies the main change: excluding legacy Codex sources from combined usage totals. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Description check |
 |
The pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the affected behavior, implementation scope, related issues and companio… |
Full details: Description check
-
Explanation
The pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the affected behavior, implementation scope, related issues and companion pull request, approval status, test results, verification limitations, and UI evidence. It also identifies the agents and harness used.
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The current head fixes the unused export; lint, typecheck, shared tests and all eight server shards now pass. The web job still failed in the unchanged WorkflowOpeningBlock and AttachmentFilePreview tests at their asynchronous highlighting/source-view assertions.
A fresh test agent ran all 14 tests in those three implicated browser files on both the actual base and the compatibility head: 14/14 passed on each. The test files, relevant implementations, browser configuration and lockfile are byte-identical across base and both stack heads. The full web job also passed on the current upper layer, #21666.
I requested one rerun of the failed jobs to check the apparent browser-test instability, without changing unrelated tests or production code. Human accounting approval remains pending, and nothing has been merged.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
macroscope-review
Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews
size:M
30-99 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|