fix(orchestrator): preserve queued_turn intent when promoting queued runs - #5033
Conversation
…runs Promoting a queued run rewrote its user_message turn item with inputIntent: "turn_start", clobbering the queued_turn intent the item was created with. Every provider's queued_turn replay fixture failed with [turn_start, turn_start] instead of [turn_start, queued_turn]. Keep the existing item's intent and only default the synthesized fallback, which is queued by definition. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved df97b7b This is a straightforward bug fix that corrects the inputIntent value from "turn_start" to "queued_turn" when promoting queued runs, ensuring the semantic intent is preserved correctly. The change is minimal, logically correct, and self-contained. You can customize Macroscope's approvability policy. Learn more. |
|
Superseded by cee7589 on the base branch, which lands the same fix (promotion path now emits inputIntent "queued_turn") along with a unit-test update. Closing. |
Summary
The five
queued_turn/*replay-fixture failures on this branch (and everything stacked on it, e.g. the subagent-obs stack #4779–#4664) trace to a one-line regression in a73a9ff ("track provider retries and thread visits").When a queued run is promoted after the active run finishes, the orchestrator rebuilds the run's
user_messageturn item and unconditionally stampsinputIntent: "turn_start"over the"queued_turn"intent the item was created with:The same failure reproduces for all five providers (codex, claudeAgent, cursor, grok, acpRegistry) because the clobber happens in provider-agnostic promotion code.
Fix
Move
inputIntentinto the synthesized-fallback object only, so an existing turn item keeps its intent. The fallback stays semantically correct as"queued_turn"— a promoted run was queued by definition.Verification
Bisected to a73a9ff (parent 1490bf9 passes, a73a9ff fails). With this fix at the branch tip:
queued_turnreplay tests pass (integration + contract)OrchestratorReplayFixtures.integration.test.ts,ThreadLaunchService.test.ts, andOrchestrator.migration.test.ts: 168/168 pass🤖 Generated with Claude Code
Note
Low Risk
Single-field intent preservation in orchestrator promotion with no auth, security, or data-model changes; behavior matches pre-regression semantics.
Overview
Fixes a regression where promoting a queued run after the active run finishes rebuilt the
user_messageturn item and always setinputIntent: "turn_start"on the merged object, overwritingqueued_turnon items that already existed.inputIntent: "queued_turn"is now only on the synthesized fallback when there is no legacy turn item; an existing item keeps its stored intent. Replay expectations (turn_startthenqueued_turn) and the fivequeued_turnprovider fixtures are restored.Reviewed by Cursor Bugbot for commit df97b7b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
inputIntentto usequeued_turnwhen promoting queued runs inOrchestratorIn Orchestrator.ts, the
makeOrchestratorlayer factory was incorrectly settinginputIntentto"turn_start"instead of"queued_turn"when constructing payloads for promoted queued runs. This corrects the intent value so queued run promotions are handled with the right intent.Macroscope summarized df97b7b.