Repository navigation
fix(server): a secret card closes when the user replies in chat instead - #42355
OmarAlex24 wants to merge 1 commit into
Conversation
When a provider steers a message into the active run (Codex, Antigravity), request_secret kept waiting on its card and blocked the turn, so the user's reply sat unread until they declined or the card timed out. The wait now closes the card as cancelled once a user-authored steer lands in the same run after the card was asked. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The PR for this issue is already open check - #40204 |
|
Thanks for this. #40218 makes the same change and is the one being kept. #40218 fixes the same deadlock by cancelling pending secret cards when the user steer is dispatched. It also demonstrates the fix with a real Claude session, which this submission leaves unverified. Your same-run reproduction confirms the same underlying problem. We can keep the fix and its verification together in the existing pull request. Closing as a duplicate. |
|
fair enough! my PR is cleaner tho 👀 jk, glad it's getting fixed!
|
Problem
When an agent calls
request_secretand the user replies in the composer instead of using the card, the card stays open and the agent never sees the reply. With providers that steer into the running turn (Codex, Antigravityagy acp>= 1.5.0 viasteersWithPrompt), the steer joins the same run under the same root node. Therequest_secretwait only exits on an answer, a terminal run, a superseded root (#34634) or the timeout, so the tool call keeps blocking the turn. The provider only delivers the steer after the call returns, so the user waits until they press Decline or the timeout (10 min by default) runs out.Reproduced on T3 Code 0.1.12-nightly.20261123 with Antigravity
agy1.5.15. The agent asked for aDATABASE_URL, the user typed a reply under the card, and the card stayed pending while the message showed as "Steer".Change
In the
requestSecretwait loop, the card is closed ascancelled(same as the restart case from #34634) once a user-authored steer lands in the same run after the card. That means auser_messagewithcreatedBy: "user", noscheduledTaskId,inputIntentsteer/promoted_queued_to_steerand a higherordinalthan the card. The agent gets{ status: "cancelled", note }right away and then reads the user's message.Agent and system wakes (monitor notifications, delegated completions, continuations, MCP sends) use
createdBy: "agent"/"system"and don't close the card. Scheduled-task messages can carrycreatedBy: "user", so they are excluded throughscheduledTaskId.The poll now passes
turnItemRunId: runIdand readssecret_requestanduser_messageitems for this run only. Before, it read everysecret_requestcard in the thread every 500ms, so each poll now loads less.Scope and approval
No prior issue. This is a small, focused fix for an obvious bug: a card that can't be answered from chat still blocks the user's chat reply. It extends the exit conditions #34634 added to the same loop, to cover the active-steering path that #34634 doesn't reach (the root node doesn't change there). Two files: the wait loop and one test.
Verification
apps/server/src/mcp/OrchestratorMcpService.activity.test.ts("requestSecret cancels its card when the user steers a reply into the run instead"), onTestClock:mainit fails withtimed_outinstead ofcancelled; with the fix it passes withcancelledand records["pending", "cancelled"].timed_out.vp test run apps/server/src/mcp/OrchestratorMcpService.activity.test.ts: 13 passed. The secret tests inOrchestratorMcpService.test.tspass.vp run check:changed: format, lint, knip, typecheck (3 packages) and tests (4 files, 115 tests) pass.Not checked: an end-to-end run against a live Codex or Antigravity session, a test row for the scheduled-task exclusion, or the
turnItemRunIdfilter against real SQLite (the test uses a mock projection; the filter already exists inProjectionStoreand is covered by type-checking).Written by Claude Opus 5.5 via Devin (ACP) in T3 Code.