fix(usage): report incomplete transcript scans - #11321
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused usage-scanning bug fix that reports incomplete filesystem reads without discarding readable or cached transcript data. Normal successful scans remain unchanged, and targeted tests cover retry, partial walks, root failures, and duplicate-source selection. 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. |
Usage summaries could omit unreadable transcripts while claiming complete coverage. Scans now keep readable records and report
partialfor entry or file failures,failedfor an unreadable root, andmissingfor an absent root. Diagnostics contain bounded counts rather than raw filesystem errors.Failed reads retain their previous parse cache for recovery, and incomplete directory walks cannot evict unseen cache entries. The shared client merge prefers a complete copy of the same source over a partial one and excludes failed sources from ownership.
Fixes #5798. Stacked on #11298. Codex cumulative-counter validation in #5800 remains separate; this change reports filesystem coverage failures.
Validation: 39 focused reader, service and merge tests pass, plus server/shared typechecks and scoped lint. Six service/merge regression scenarios fail on the original code. A separate Node replay with real Linux permission failures retained a readable file beside an inaccessible directory, reported an inaccessible root as failed, and recovered the original usage after permissions were restored. Directory rotation, file stat errors, retrying unchanged bytes and cache preservation are covered. Windows and macOS filesystem behavior remains unverified.
Internal refinement remains pending after the final authorized Fable retry failed. No merge requested.
Implemented and tested with GPT-6 through Codex in T3 Code.