Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- In an agent thread (any provider; seen with Claude Code), have the agent call
request_secretwithclientRequestId: "router-key"and a shorttimeoutMs(e.g. 3000). Let the card close unanswered (timeout, or send a message so the steer interrupts the call). The tool returnstimed_out(or is interrupted) and the card shows "Request ended". - Let that run finish.
- Send another message so a new run starts, and have the agent call
request_secretagain with the sameclientRequestId: "router-key".
In practice this happens after a context compaction, when the agent no longer remembers which ids it used.
Expected behavior
The second call opens a new secret card and waits for the user, as any new request does.
Actual behavior
{"status":"cancelled","note":"The card closed with the run. Ask again with a new clientRequestId only if the secret is still needed."}The run is still working, so the note is also wrong. Agents retry, and usually reuse the id again, so the user never gets a card.
Cause: the card's turn item id, and the command ids that record it as pending or cancelled, are built only from the MCP request namespace and clientRequestId (apps/server/src/mcp/OrchestratorMcpService.ts, in requestSecret). For a Claude thread the namespace is the provider session id, and it stays the same across the thread's runs. So in a later run, record("pending") replays the first run's command receipt (Orchestrator.ts, dispatch → replayCommandReceipt) and creates nothing. The wait loop then finds the first run's card, already cancelled, and returns that status as if it were this call's answer.
Impact
Minor bug or occasional failure
Version or commit
0.1.10-nightly.20261116.4800 (7d32075)
Environment
Linux server (Docker), desktop and web clients, Claude Code 2.1.x provider.
Logs or stack traces
# Server traces for the two reused-id calls: no secretRequestRecord dispatch span, 34 ms each
2026-11-17T11:20:50.079Z OrchestratorMcpService.requestSecret 34ms {"secret_request.status":"cancelled"}
2026-11-17T11:21:07.670Z OrchestratorMcpService.requestSecret 34ms {"secret_request.status":"cancelled"}
# orchestration_command_receipts: only the first run's rows exist for these keys
command:mcp:<session>:secret-pending:<clientRequestId> accepted 11:04:58
command:mcp:<session>:secret-cancelled:<clientRequestId> accepted 11:06:41Screenshots, recordings, or supporting files
web-base-002-failure.png
android-base-002-second-ask.png
web-base.webm
Workaround
Reminding the agent to use a new id works.
Activity