You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(chat): one held tool call streams its approval card twice, and the resume stream sends it a third time #21751
When the chat graph holds a tool call, the SSE stream carries the same approval card twice, with two different message ids. The resume stream then carries it a third time.
Live install, 2026-11-18 (46a8943282), one held click call:
The same pair appeared on another chat's held call, and its POST /chats/{id}/resume stream opened with a third copy of the card.
Where
autobot-backend/chat_workflow/graph.pyrequest_approval: stream_cb(approval_request) ("emitted before the interrupt"), then interrupt(approval_request).
autobot-backend/chat_workflow/turn_control.pystream_graph_turn: after ainvoke returns, for intr in result.get("__interrupt__") puts intr.value on the queue again.
On resume, LangGraph re-runs request_approval from the top, so the stream_cb line fires again before interrupt() returns the decision.
_to_message gives each emission a fresh id, and ChatController.ts (~L469) handles each command_approval_request as its own message.
Not established: whether the chat UI renders two (or three) approve/reject cards for one hold. Rendering was not observed; the stream was read through the API.
Acceptance criteria
A held turn streams exactly one approval card for one interrupt, and the resume stream re-emits none (test counting command_approval_request events on both streams).
Host evidence: one held call on a live install shows one card in chat.
The fix is in #21749: request_approval no longer streams the card itself, the card carries a stable per-plan id, and the resume stream carries no card. It is pinned by a test through stream_graph_turn that counts exactly one command_approval_request across the initial run and the resume. The host-evidence AC is still open until it is deployed.
Witness from before the fixes, cause not established: in a live chat on the local install on 2026-11-09, two user turns sent 23 s apart both ran in full. Their replies arrived 7 and 13 minutes later, and navigate was held for approval both times. The logs for that day have rotated, so they cannot show whether the two holds were one interrupt emitted more than once (this issue) or two turns each holding its own call. Recorded as a sighting only; the acceptance criteria are unchanged.
AC check against main at 80870f228d (merge of #21749). This stays open: the host-evidence AC needs a deploy.
AC (verbatim)
Evidence on origin/main
Ticked
"A held turn streams exactly one approval card for one interrupt, and the resume stream re-emits none (test counting command_approval_request events on both streams)."
tests/unit/chat_workflow/test_held_call_stops_turn_19951.py:208-230test_through_the_turn_stream_exactly_one_card_reaches_the_client runs stream_graph_turn for the initial and the resumed stream. It asserts one command_approval_request across both and none on resumed. Frontend dedupe: ChatController.approvalCard.test.ts:49-59
✅
"Host evidence: one held call on a live install shows one card in chat."
Needs host evidence after deploy. #21749 is not deployed yet; the install runs 96241c46d5
❌
Remaining: host check after deploy. Ticked 1 of 2.
Deploy status, 2026-11-20: the local install now runs 13685f3999, which is current main. It includes the merges of #21749 (80870f228d) and #21888 (f559d8c0a7), verified with git merge-base --is-ancestor.
Host evidence: none gathered yet. The live chat check is paused until the owner decides how the test logs in, because credentials come only from the secrets manager. No AC is ticked from this deploy. Remaining: host AC: one held call on the live install shows one approval card.
Live check on the local install at 13685f3999, 2026-11-20 21:26–21:35 Riga. The login question is resolved, but this run's two turns (navigate, then web_search) did not exercise this issue: neither tool was held for approval, so no approval card was produced. No AC is ticked. Next: a live turn that holds a tool call, such as a shell command needing approval.
Live check on the local install at d08333f564, 2026-11-21 03:42–03:45 Riga. A new chat asked to run uname -r (execute_command), then a follow-up was asked in the earlier two-turn chat.
Still not exercised.uname -r was pre_approved (Auto-approved (safe risk)), so no approval card was produced. The next run needs a command that is not rated safe.
Live check on the local install at a2384694b9f0 (includes #21964), 2026-11-22 02:18–02:28 Riga, chat 1c825dfd, request "Run the shell command touch /tmp/autobot_livecheck_21959 in the terminal". Host AC ticked.
The held turn's stream carried exactly onecommand_approval_request.
The resume stream ({"approved": true}) carried none, and no approval_waiting or approval_still_pending.
Activity
mrveiss commentedon Nov 18, 2026
The fix is in #21749:
request_approvalno longer streams the card itself, the card carries a stable per-plan id, and the resume stream carries no card. It is pinned by a test throughstream_graph_turnthat counts exactly onecommand_approval_requestacross the initial run and the resume. The host-evidence AC is still open until it is deployed.mrveiss commentedon Nov 18, 2026
Witness from before the fixes, cause not established: in a live chat on the local install on 2026-11-09, two user turns sent 23 s apart both ran in full. Their replies arrived 7 and 13 minutes later, and
navigatewas held for approval both times. The logs for that day have rotated, so they cannot show whether the two holds were one interrupt emitted more than once (this issue) or two turns each holding its own call. Recorded as a sighting only; the acceptance criteria are unchanged.github-actions commentedon Nov 19, 2026
Landed in #21749, merge
80870f228dmrveiss commentedon Nov 19, 2026
AC check against
mainat80870f228d(merge of #21749). This stays open: the host-evidence AC needs a deploy.origin/maincommand_approval_requestevents on both streams)."tests/unit/chat_workflow/test_held_call_stops_turn_19951.py:208-230test_through_the_turn_stream_exactly_one_card_reaches_the_clientrunsstream_graph_turnfor the initial and the resumed stream. It asserts onecommand_approval_requestacross both and none onresumed. Frontend dedupe:ChatController.approvalCard.test.ts:49-5996241c46d5Remaining: host check after deploy. Ticked 1 of 2.
mrveiss commentedon Nov 20, 2026
Deploy status, 2026-11-20: the local install now runs
13685f3999, which is currentmain. It includes the merges of #21749 (80870f228d) and #21888 (f559d8c0a7), verified withgit merge-base --is-ancestor.Host evidence: none gathered yet. The live chat check is paused until the owner decides how the test logs in, because credentials come only from the secrets manager. No AC is ticked from this deploy.
Remaining: host AC: one held call on the live install shows one approval card.
mrveiss commentedon Nov 20, 2026
Live check on the local install at
13685f3999, 2026-11-20 21:26–21:35 Riga. The login question is resolved, but this run's two turns (navigate, thenweb_search) did not exercise this issue: neither tool was held for approval, so no approval card was produced. No AC is ticked. Next: a live turn that holds a tool call, such as a shell command needing approval.mrveiss commentedon Nov 21, 2026
Live check on the local install at
d08333f564, 2026-11-21 03:42–03:45 Riga. A new chat asked to rununame -r(execute_command), then a follow-up was asked in the earlier two-turn chat.Still not exercised.
uname -rwaspre_approved(Auto-approved (safe risk)), so no approval card was produced. The next run needs a command that is not rated safe.mrveiss commentedon Nov 21, 2026
Live check on the local install at
7657af8cb986(includes #21911, not #21954), 2026-11-21 11:13–11:16 Riga, chat46a8048a. Still reproduces.touchcommand (MEDIUM risk) stores twocommand_approval_requestentries, at 11:15:55.384 and 11:15:55.457.command_approval_requestagain, followed byapproval_waitingandapproval_still_pending.github-actions commentedon Nov 21, 2026
Landed in #21964, merge
f349aa78camrveiss commentedon Nov 22, 2026
Live check on the local install at
a2384694b9f0(includes #21964), 2026-11-22 02:18–02:28 Riga, chat1c825dfd, request "Run the shell command touch /tmp/autobot_livecheck_21959 in the terminal". Host AC ticked.command_approval_request.{"approved": true}) carried none, and noapproval_waitingorapproval_still_pending.status=pre_approvedwith no second queue entry. Before fix(chat): an approved command runs once, and a step that did not run is never reported as executed (#21959) #21964 there were 2 cards stored and 1 re-sent on resume.All criteria are ticked, so I'm closing this.