Unreadable Pi conversations could exhaust the import slots on every attempt and hide older readable history. The scanner now charges a slot only after a transcript passes validation. Compressed Codex rollouts use a separate decoded-byte budget, so exhausting it still leaves room to import older plain transcripts.
Related: #23214, #25923
Reproduction on main#
Commit 4e6b1fa771 (main). Every attempt skips the same newer conversations and leaves the older readable conversation out. Expected: The older readable conversation appears in T3 Code when the import is retried.
The cause is at apps/server/src/project/AgentSessionScanner.ts:2293. Ran cd apps/server && pnpm exec vp test run src/project/AgentSessionScanner.test.ts with the repro test added: it failed in 2 of 2 runs on a clean checkout, with expected [] to include 'session-100' in the output.
Evidence#
Environment: Linux x64, the repository's own tests.
Proven: the repro fails at the test commit 0a5bec147f and passes on the head 18021dff12, both on main 6632511cd8.
Outside view: not shown in the running app. The bug fails the rule that every state the repro builds by hand is one a person's steps put the real app in. The older conversation stays out only when one hundred newer Pi session files are already on disk with tool-result details nested past the reader's depth limit, which opening Welcome and importing never creates.
Tests#
- 0a5bec147f adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 6632511cd8f523c2b9439272d776fb44c2bce110 passed on head.
Not in this change#
- The original regression test remains byte-for-byte intact. Separate checks verified that both scans skip all 100 unreadable Pi files, that the retry recognizes the older import, and that an oversized compressed rollout leaves older plain history reachable.
- When the shared decompression budget runs out, later compressed rollouts are still deferred.
Who did the work#
- Repro written by GPT 6.2 Sol, in Codex
- Outside view by Grok 4.7, in Grok
- Duplicate check judged by Claude Opus 5.5, in Claude Code
- Written by GPT 6.2 Sol, in Codex
- Trimmed by Claude Opus 5.5, in Claude Code
- Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Gemini 4 Neon, in Antigravity
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon
No actionable comments were generated in the recent review.
Walkthrough
The scanner now applies a shared decompression-byte budget to compressed transcripts during recent-thread scans. It charges transcript slots only after parsing a usable thread. A regression test checks that an older session remains importable after newer transcripts are unreadable.
Changes: Recent Thread Scanning
apps/server/src/project/AgentSessionScanner.tsapps/server/src/project/AgentSessionScanner.ts,apps/server/src/project/AgentSessionScanner.test.tsEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
Suggested labels:
bugfixSuggested reviewers:
juliusmarminge,tiliakoos,dominikzabcikMerge Risk:
Minimal · up to
5b743This change keeps older readable sessions importable when newer transcripts are unreadable, and it bounds decompression for compressed rollouts. No actionable merge-blocking risk was identified, and the added regression test covers the starvation case.
Pre-merge checks:
4
Full details: Title check
Explanation
The title "fix(server): unreadable sessions no longer block older history" matches the main change: the scanner now charges an import slot only after a transcript validates, so unreadable Pi sessions no longer hide older readable history. It also follows the conventional commit format the template suggests. The title does not mention the separate decompression-byte budget for compressed Codex rollouts, but that is a secondary aspect and the title does not need to cover every detail.
Full details: Description check
Explanation
The description follows the template's main sections in substance. It states the problem (unreadable Pi conversations exhausting import slots and hiding older history), gives the change (slot charged only after validation, separate decoded-byte budget for compressed Codex rollouts), and describes scope with related issues
#23214and#25923. It includes a reproduction on main and verification details: the failing test at 0a5bec147f, the passing run at 18021dff12, and the check:changed command. It also names the model and harness that did the work, as the template asks. Gaps: the Scope section does not clearly say why no issue is needed or whether a maintainer requested the PR, though it links related issues. The Verification section relies on a single Linux environment and does not cover manual checks beyond the repo's tests. The description also includes a long list of tool and model attributions and a hash comment, which adds noise but does not block review.Finishing Touches
Generate unit tests (beta)
be77166f-9f8f-4da1-b6d7-09f22c8a7a3fReviewing files that changed from the base of the PR and between 18021dff12f066ecf2c53591316bac80da35cc02 and 5b7430fae48f3814290756b327a073301b635966.
apps/server/src/project/AgentSessionScanner.test.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.