GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): include archived Codex sessions in usage by juliusmarminge · Pull Request #22774 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Codex transcripts archived before the first usage scan are omitted from Usage. This addresses #7090 (GitCafe #7090).

On main 6490a9e874, the running app reports 480 tokens for two active transcripts and 120 tokens from the identical uncached fixture with one transcript archived. Warm scan history preserves previously scanned usage and masks the omission. Reproduction transcript.

Status: fix, regression tests and before/after proof are done. Both independent reviews returned FIX_FIRST: the committed evidence scripts under apps/server/scripts/evidence/ and their knip.jsonc entry must be dropped before merge. Scope: include archived_sessions in the Codex transcript reader; no client or wire changes.

Validation: two regression cases fail on main (120 vs 480; 0 vs 360). Scoped lint, formatting, server typecheck passed.

Unverified surfaces: desktop, mobile, remote/relay/tunnel clients; shared server behavior is the intended fix.

Model/harness: GPT-6.1-Sol through Codex in T3 Code; delegated review models recorded when complete.

Evidence

Runtime proof against a real server (server.getUsageSummary, awaitRefresh: true). Each row ran with a fresh isolated T3 home and server process, using a synthetic CODEX_HOME fixture. Codex itself was never run, and no real ~/.codex or ~/.t3 was touched. Driver and fixture builder: apps/server/scripts/evidence/codex-archived-usage/. Matrix: matrix.md. Transcript: transcript.txt.

Before = 6490a9e874 (merge-base on main). After = 0ce8d72485 (the fix merged with main), driven from 74be12a8e6, which adds only the evidence scripts. The same committed driver ran both sides. Synthetic fixtures: active rollout a = 120 tokens and archived rollout b = 360 tokens, with distinct session IDs.

Row Synthetic fixture Before (tokens / sessions) After (tokens / sessions)
A active only 120 / 1 120 / 1
B active + archived 120 / 1 (archived dropped) 480 / 2
C archived only 0 / 0 360 / 1
D1 B + archived record with inconsistent totals 120 / 1 480 / 2, archived source partial (1 malformed record skipped)
D2 B + archived file holding truncated JSON 120 / 1 480 / 2, archived source ok (1 file skipped)
D3 B + unreadable archived file (chmod 000) 120 / 1 480 / 2, archived source partial ("1 transcript path(s) could not be read")
D4 B + unreadable archived subdirectory (chmod 000) 120 / 1 480 / 2, archived source partial (same message)

No call returned an error, and the server stayed up after every call on both sides.

Environment: fs-17, Linux 6.1.102 x64, Node v24.22.1, server started via node apps/server/src/bin.ts start (desktop bootstrap), Codex instance disabled and pointed at the fixture, HOME set to a scratch directory.

What else changed:

  • After reports a second Codex usage source, archived_sessions, in every row; Before reports only sessions.
  • Row A: the new source shows missing ("No transcript directory on this environment."), and totals are unchanged.
  • D1, D3 and D4 surface a partial warning on the archived source. D2 stays ok because invalid JSON lines are dropped without being counted as malformed (existing parser behavior). The locked 999-token rollout in D3 and D4 is excluded from totals.
  • The sessions source is identical on both sides in every row.
  • Unrelated and identical on both sides: one "Resource telemetry operation 'refresh' failed" warning per server log, and GET / returns 503 because no web bundle was built.
Verification log
  • Proof audit pass 1 (Claude Opus 5.5): derived the matrix above, rows A–D4.

  • Evidence capture (Claude Opus 5.5): captured all 14 Before/After runs, and every one matched the expected values.

  • Proof audit pass 2 (Claude Opus 5.5): SUFFICIENT.

    • The transcript, raw results and matrix agree row by row.
    • All SHAs match.
    • 0ce8d72485..74be12a8e6 touches only the evidence scripts, and the only non-test change against main is the codexUsage.ts hunk.
    • The auditor rebuilt all After rows and the B and C Before rows from the committed driver, with identical results.
  • Main was merged in with a merge commit (0ce8d72485), with no rebase and no force-push.

  • Tests on the merged head: vp test run src/usage/UsageService.test.ts passed 40/40, and src/provider/Drivers/codexUsage.test.ts passed 17/17.

  • CI: on the previous head, Lint and Check failed. Locally, knip:check flagged the new evidence driver as an unused file. 1f7e43b7aa registers it as a knip entry; knip:check and scoped fmt/lint now pass locally. CI on 1f7e43b is pending.

  • Unverified rows: none from the matrix. The optional warm-scan-cache row was not captured; the PR's reproduction transcript covers it. Desktop, mobile and remote clients were not exercised; this is a server-only change with no wire changes.

  • Model/harness: Claude Opus 5.5 through Claude Code in T3 Code (evidence lead, auditors and capturer).

  • Independent review round 1 on 1f7e43b7aa (read-only, diff excluding evidence scripts and knip.jsonc):

    • Reviewer A (Claude Sonnet 5.5): FIX_FIRST.
    • Reviewer B (Claude Opus 5.5): FIX_FIRST.
    • Both found the codexUsage.ts change to be the smallest correct fix.
    • Both traced the edge cases and found them safe:
      • A session moved or copied from sessions/ to archived_sessions/ is counted once (sharedSessionsAcrossFiles plus the global aggregator dedupe).
      • A missing archived_sessions folder reports as missing and nothing visible changes.
      • Malformed or unreadable archived files go through the existing partial handling.
      • A symlinked archived_sessions folder is resolved with realPath and deduped.
      • No change to auth, permissions, runtime modes, sandboxing, trust or the MCP surface.
    • Performance: each refresh costs one readdir plus a stat per archived file. Files older than the window are never read, and archiving keeps mtime, so a newly archived file is re-read only once.
    • Blocking finding (both): 74be12a8e6 and 1f7e43b7aa commit the PR-only evidence driver (apps/server/scripts/evidence/codex-archived-usage/) and its knip entry. AGENTS.md says not to commit PR-only assets. Fix: drop both and keep the uploaded evidence links.
    • Nits (low): no test moves a session from sessions/ to archived_sessions/ between two scans. Every Codex instance now reports one extra source, missing when the folder is absent.
    • Neither reviewer ran tests: the review worktree had no node_modules, and installing was out of scope.
    • Model/harness: Claude Opus 5.5 through Claude Code in T3 Code (review lead).

Fixes #7090
GitCafe: https://git.cafe/pingdotgg/t3code/issues/7090

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juliusmarminge
test(server): add takeover tests for archived Codex usage
a10d146
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 21, 2026
@juliusmarminge
fix(server): include archived Codex sessions in usage
b0dec57
@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 4.9 KiB 5.0 KiB +30 B (+0.6%) 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 +30 B (+2.5%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.8 KiB 20.9 KiB +41 B (+0.2%) 29.3 KiB ✅
Codex Live turn messages 1 2 +1 (+100.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: 8d3b061 · PR result: 1f7e43b · 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed pr:in-progress A lead is working on this PR and removed pr:gate-failed A land gate failed labels Oct 22, 2026
juliusmarminge and others added 2 commits October 22, 2026 11:17
@juliusmarminge @claude
Merge main into fix/issue-7090
0ce8d72
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
test(server): add archived Codex usage evidence driver
74be12a
Synthetic fixture builder and RPC driver that boot a fresh server per row
against an isolated T3 home and call server.getUsageSummary, so the same
script compares archived_sessions coverage before and after the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Oct 22, 2026
@juliusmarminge @claude
chore(server): register codex usage evidence driver as a knip entry
1f7e43b
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge juliusmarminge added pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked and removed pr:in-progress A lead is working on this PR labels Oct 22, 2026
@t3dotgg

t3dotgg commented Nov 1, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-6.1 Terra [1m] responding on behalf of Theo

Closing in favor of the archive-accounting stack, which scans active and archived rollouts together and counts a moved cached rollout once. #21666 #21664

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Nov 1, 2026
@juliusmarminge juliusmarminge removed the pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Usage page never scans Codex archived_sessions/, so archived sessions' usage silently disappears

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@juliusmarminge @t3dotgg
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.