Repository navigation
fix(usage): include archived Codex rollouts under one source - #21666
juliusmarminge wants to merge 3675 commits into
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The visible changes expand build, publishing, and preview infrastructure and add a lint suppression in .pnpmfile.cjs:31 that requires human review. Supplied findings also identify preview-cleanup and fork-workflow token-exposure risks. Needs human approval because:
No code changes detected at Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
12aa22b to
3482136
Compare
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
…bar changes (#33611) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rashpad pipe (#26374) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
…ab (#23589) Co-authored-by: PR Batch Tester <agent@local.test> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
Add a Details action for pending background commands and subagents. Preserve Claude command metadata across roster updates and bind output visibility to the explicit command item. Keep internal task IDs, duplicate command labels, and empty output headings out of the dialog. Validation: check:changed passed with 371 tests; CI and agentic reviews completed on a0326ab. Verified command details in real Codex and Claude runs. Implemented and verified with GPT 6.1 Sol in the Codex harness.
…anup (#33664) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…33678) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…24599) Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ar file (#26594) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…ds the inspection limit (#26593) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…eckpoints (#27425) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…4170) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Sinan Turna <189102964+Sinan53x@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
…10495) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
…at t3_thread_list takes allProjects (#26525) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ll other git work (#26601) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…inks off (#21641) Co-authored-by: Julius Marminge <julius0216@outlook.com>
…6311) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Vladislav Nikonorov <vladislav@nikonorov.dev>
…8379) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted; verified with the tests and tools listed above.
AI-assisted; verified with the tests and tools listed above.
EvidenceSeed two synthetic Codex rollouts dated yesterday: active 3K tokens and archive-only 7K tokens before the first scan. Select Usage → Tokens → 7 days → Codex and refresh. Copy the active rollout into archived_sessions, refresh, remove its active copy, and refresh again. Remove the empty sessions directory and refresh. Finally make archived_sessions unreadable and refresh before restoring permissions. Real web app, Chromium 157, light theme, fresh databases and isolated homes. Both sides use 1280×800 CSS pixels, DPR 2; missing/unreadable-directory stills use 1280×900 on both sides. Retained stills matched screenshots taken at least 500 ms apart. Base reports 3K tokens and one session throughout. Fix reports 10K tokens and two sessions throughout. Copying and moving do not change the fixed total. Missing or unreadable directories produce incomplete-scan warnings while preserving usage.
Seed and launcher · Filesystem steps · Reproduction instructions Archive state was seeded directly; Codex's archive command was not exercised. AI-assisted; verified with the tests and tools listed above. Not shown:
|
|
The automated pipeline stopped on this pull request and will not merge it: not finished after 6 rounds It stays open for a person to finish or close. |










Problem
Codex usage omitted archived rollouts. Adding archived_sessions as a separate source also inflates combined totals when cached history overlaps after a rollout moves.
Change
Read sessions and archived_sessions under one canonical Codex-home source. The provider extension supplies multiple transcript roots; the service retains cached roots, deduplicates aliases and copied rollouts, and marks directory-read failures partial. Recover canonical home identity from old root-cache metadata when a configured symlink disappears.
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: #21664. 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: server/Codex usage tests 139 → 142 across nine existing files, including three service regressions; shared merge/format 37 → 39 across two existing files. The archive regression was 50 → 70 tokens. The narrow two-source implementation merged overlapping histories as 110 tokens; the rebuilt service returns 70. The migration regression was 100 → 50 tokens after a removed home alias. Scoped source lint/format and server/provider-core typechecks 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.
Live isolated UsageService proof: active 10 + archived 20 + copied 40 = 70 once; moving a rollout and combining newer partial history with an older complete scan stays 70. Missing archived directories retain cached history, and unreadable roots report partial results.
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 the actual base (1451e7cb23) and implementation (captured at 12aa22b0dd; runtime behavior is unchanged by the subsequent export-only cleanup), same isolated transcript fixtures, 1280×800 viewport and provider filter. Active rollout 10 + archived rollout 20: 10 → 30 tokens.
Before — archived rollout omitted:
After — active and archived sessions, 30 tokens:
Implementation: Codex gpt-6.1-sol; tests: Codex gpt-6-astra; reviews: Claude Opus 5.5 and Codex gpt-6-sol, through T3 Code.
Closes https://git.cafe/pingdotgg/t3code/issues/7090
Fixes #7090