fix(server): recover Pi resumes without reusing native history - #12933
Conversation
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. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This production change alters Pi resume and fallback semantics by retiring processes, creating replacement native sessions, clearing history state, and changing context-handoff budgeting. Although the behavior has substantial regression coverage, its runtime scope and lifecycle side effects warrant human review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
…2.sqlite (the live V2 DB since upstream 15769fa); README: Pi resume-fallback patch dropped (superseded by pingdotgg#12933), repair pattern names the live DB (QM-116)
…2.sqlite (the live V2 DB since upstream 15769fa); README: Pi resume-fallback patch dropped (superseded by pingdotgg#12933), repair pattern names the live DB (QM-116)
…2.sqlite (the live V2 DB since upstream 15769fa); README: Pi resume-fallback patch dropped (superseded by pingdotgg#12933), repair pattern names the live DB (QM-116)
Long Pi resumes could time out after 15 seconds, enter the portable-handoff fallback, and accidentally adopt the original native session. Legacy history then exhausted the 128k fallback budget even when Pi reported a 1M model window, producing the misleading error in #12931.
Give Pi session lifecycle operations 60 seconds. Explicitly create and verify a fresh native session for replacement, clear the old binding/defaults, and retire the process on lifecycle timeout or interruption so a late switch cannot race fallback. Expose selected-model capacity from Pi's state/catalog to handoff budgeting, preserving small-model limits and the existing bounded history allowance. Add bounded diagnostics for failed resumes.
Validation:
layerwarning.new_sessioncreated a different identity, and state reported a 1,000,000-token window. No model requests or UI changes.CI limitation:
SteeringCompletion.integration.test.tshas five failing steering/mailbox completion assertions. The same five failures reproduce in a separate checkout of the unchanged V2 base0e682145efcand on this PR head; both CI revisions failed Test Server 3 on those assertions. All other executed CI jobs pass on60469f781ce; correctness and Effect reviews are clear. Automated approvability is neutral because the lifecycle changes require human review. They are outside this Pi fix.Fixes #12931. Based directly on V2 #2829, without native stack grouping.
Model: GPT-6. Harness: Codex in T3 Code.