test(server): make the provider-switch resume-failure test reach the fallback - #13494
Conversation
…fallback "uses portable fallback when native resume fails after a provider switch" never called resumeThread: the shared Codex session kept its native thread loaded across the Claude turn, so returning to Codex reused it warm and failResume had no effect. Stop the Codex session before returning, as the client's stop-session action does, so the return must resume, fail, and take the portable fallback. Assert the fallback's effects: a fresh native thread on the same provider-thread row, a resolved portable transfer, and a full_thread_summary handoff that re-sends the earlier Codex turn. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR is limited to an ignored integration-test file and refines the test setup and assertions for an existing provider-switch fallback scenario. It introduces no production runtime, product-default, schema, infrastructure, security, billing, or static-analysis changes. Notes:
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. |
9fc8676
into
t3code/codex-turn-mapping
…fallback (#13494) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…fallback (#13494) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…fallback (#13494) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
"uses portable fallback when native resume fails after a provider switch" never reached the fallback. The shared Codex session kept its native thread loaded while the Claude turn ran, so returning to Codex reused it warm and never called
resumeThread. FlippingfailResume: truetofalsestill passed.What changed
provider-session.detach, the same command the client's stop-session action sends, and drains the effect worker. The return now has to resume the native thread, the fake fails that resume, andProviderTurnStartServicetakes the portable fallback.codex:<thread>:1) bound to the same provider-thread row, with the fake's native-thread generation counter at 2;full_thread_summary, runs 1-2) delivered inline to that fresh native thread, next to the Claude delta;provider_handofftransfer with statusresolved_portableand strategyportable_context;With the path actually exercised, the fallback behaves correctly. No production code changed.
Verification
vp test run src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts: 65/65 pass.failResume: false: fails withexpected 1 to equal 2(native thread generation). With that assertion removed it still fails onexpected 'codex:thread:provider-switch:0' to equal 'codex:thread:provider-switch:1'.ProviderTurnStartService(propagate the resume failure instead of replacing the native thread): fails. The run retries the resume and the test times out waiting for idle.effectiveHandoffs = [handoff, ...]skipped): fails on the handoff list assertion.expected 1 to equal 2.vp lintandvp fmton the changed file: clean.vp exec tsc --noEmit -p .inapps/server: noerror TS.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code