Repository navigation
fix(server): a message from another thread no longer wipes a half-answered question - #35688
snnbotchway wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Automatic delivery now queues messages while a question or approval is pending, rather than interrupting the active interaction. Human confirmation is needed for this change to the automatic delivery policy. You can add or adjust custom eligibility rules. Learn more. |
0840e84 to
47ab408
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Claude Opus 5.5 responding on behalf of @snnbotchway. Closing as a duplicate of #26842, which fixes the same bug (#26841) on more paths: composer steers and promoted queued messages too. I added my reproduction and failing test there. |
Problem
When a Claude turn is waiting on
AskUserQuestionand another thread sends it a message with the defaultautomode (t3_thread_send, or the attachment send tool), the user loses their place in the question. Answers already picked and text being typed disappear, and Claude asks the question again from question 1.Change
autodelivery steers into the active turn when the provider supports steering. Claude declaresactiveSteeringInterruptsTools: true. Its steer cancels the pendingcanUseToolcallback, soClaudeAdapterV2withdraws theuser_inputrequest (cancelWithdrawnRequest). The client then prunes that request's drafts inonThreadRequestsResolved, and Claude re-asks under a new request id.resolveDeliveryIntentnow queues automatic delivery while the thread has a pending runtime request, so the message runs after the user answers. Approvals are covered too, because a steer withdraws them the same way. An explicitsteerorrestartstill goes through as asked, and so does a message the user sends themselves.Scope
This is a small fix for an obvious bug: typed input is lost with no action from the user. It needs no issue. It is one condition in the delivery policy, and it is provider-agnostic. Providers whose steer leaves pending requests alone (Codex) now queue in this state too. That is harmless, because the turn cannot move until the user answers anyway.
Verification
AskUserQuestionwhile another thread usedt3_thread_sendon mine, and the panel reset to 1/3 with my answers gone.ThreadManagementService.sendToThread(auto→steer_active),resolveDeliveryIntent,ClaudeAdapterV2.steerTurn(apriority: "now"message), theAskUserQuestionbranch ofcanUseTool(the abort signal leads tocancelWithdrawnRequest), and the webonThreadRequestsResolvedpruning.CommandPolicy.test.tscases for a pendinguser_inputrequest and a pendingcommandrequest. Both failed onmainwithsteer_activeand pass with the fix. They also assert that an explicitsteerstill steers.CommandPolicy,SteeringCompletion.integration,ThreadManagementService,runtimeLayer,ThreadLaunchService,ThreadStop,ProviderSwitch.integrationandOrchestratorMcpServicesuites pass, andvp run check:changedpasses.Opus 5.5 (Claude Code, driven from T3 Code)