fix(server): Implement starts a run from a proposed plan again - #13775
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server bug fix that restores proposed-plan implementation by reading the plan through the existing projection-store API, with validation behavior preserved and a regression test added. It does not alter schemas, defaults, infrastructure, security-sensitive code, or static-analysis configuration. 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. |
55cb2fc
into
t3code/codex-turn-mapping
Clicking Implement on a proposed plan fails on V2 with a toast:
Proposed plan <planId> does not exist on thread <threadId>.Nothing runs. "Implement in a new thread" sends the samesourcePlanRef, so it goes through the same failing lookup. I hit this on a Claude plan-mode thread: the plan row was inorchestration_v2_projection_planswithstatus = 'active', and the dispatch still failed.The cause is in
message.dispatch. It looked upsourcePlanRefingetProjectionWithPendingEvents, which is built onreadCommandProjection. Since 28051c4 ("replace unnecessary full projection reads"), that projection hard-codesplans: [], so the lookup could never find a plan. This affects every provider.Fix
Read the source plan with
projectionStore.getPlan(threadId, planId)instead. That is one indexed row read, and the command projection stays as lean as before. The existing checks (same project, still active) andcompleteSourcePlanwork as they did.Verification
Orchestrator.control-reads.test.ts. It creates a thread, applies an activeproposed_plan, dispatches a message withsourcePlanRef, and asserts that the plan becomescompleted.Proposed plan plan:implement-plan does not exist on thread thread:implement-plan., the same error the web toast shows.vp test run src/orchestration-v2/Orchestrator.control-reads.test.tspasses (2/2).vp exec tsc --noEmit -p .in apps/server: noerror TSorwarning TS.vp linton both touched files: no new findings. One existingno-unused-varswarning atOrchestrator.tslayerUnavailablewas already there.knip --workspace apps/server --exports: clean.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code