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): an approved command never runs — a second approval gate holds it, and the turn tells the user it succeeded #21959
Observed on the local install, 2026-11-21 11:15 Riga (install at 7657af8cb986)
Turn: "Run the shell command touch /tmp/autobot_livecheck_21751 in the terminal." The model called execute_command, which was classified MEDIUM risk. The graph raised an approval card, and the client resumed with {"approved": true}.
Backend log after the resume (POST /api/chats/{id}/resume, 11:15:44.837):
Time
Line
11:15:55.150
Executing tool: execute_command
11:15:55.342
[QUEUE] Added command … state=pending_approval
11:15:55.383
Approval required for: unknown
11:15:55.582
[APPROVAL POLLING] Waiting for approval of command: touch …
11:15:56.109
Built continuation prompt: 1614 chars, 1 executed steps
11:16:19.213
Iteration 2: The touch command has been executed successfully. It created an empty file at …
There is no Tool execute_command: SUCCESS line, and the file was not created. The stored transcript ends with two replies saying the command "has been executed successfully".
The turn reports a success that never happened. The continuation prompt counts the pending step as "executed". The model then tells the user the command ran and the file exists. The user gets a false confirmation of an action on their system.
Acceptance criteria
A command approved through the graph's approval resume runs exactly once, with no second approval gate. A test drives approve, then resume, and asserts the command executed.
A step that did not execute (pending, refused or timed out) is never counted or described as executed in the continuation prompt. A test pins that a pending step is reported as not run.
Host evidence: the same touch request, approved once on the local install, creates the file, and the reply matches what happened.
#21964 merged at 81c1b18e4. The two code criteria are ticked, with evidence from main:
Approved command runs once:
In chat_workflow/tool_dispatch_guards.py, COMMAND_APPROVED_KEY is set only when the call's exact fingerprint was approved (:330), and is consumed once (approved_fingerprints - {shown}).
Any value the model sets is dropped (:356).
Tests in tests/unit/chat_workflow/test_approved_command_runs_once_21959.py: test_approve_then_resume_runs_the_command_once_with_no_second_gate (:81), test_a_yes_for_one_command_never_authorises_another (:96), test_the_same_approved_call_dispatched_twice_is_held_the_second_time (:120) and test_the_terminals_permission_check_still_blocks_an_approved_command (:147).
A step that did not run is never counted as executed:
chat_workflow/step_outcome.py counts only RAN_STATUSES, plus an error that carries a real exit code. exit_code_field never invents an exit code for a refusal.
Tests: :170, :178, :182, :201.
Host criterion: stays open until the local install includes 81c1b18e4.
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". Partial host evidence. AC3 is not ticked yet.
Ran once with one approval:[PTY_EXEC] Command complete. Return code: 0 at 02:20:54. Tool execute_command: SUCCESS (0.59s). The file exists: -rw-r--r-- 1 autobot autobot 0 Nov 22 02:20 /tmp/autobot_livecheck_21959. There was no second approval gate.
Reply not observed: after the tool, the next model call ran from 02:21 until the client gave up at 02:28:31 (turn cancelled … reason=client_disconnect). Machine load was 41 at the time, and Ollama aborted the request when the client closed. The "reply matches what happened" part needs a run on a quieter machine.
New defect: the cancelled turn stored nothing about the step that ran. It is filed separately (see below).
Activity
fix(chat): keep agent_terminal service.py at its base size (#21959)
fix(chat): a refused command gets no invented exit code, so it stays …
Merge pull request #21964 from mrveiss/issue-21959
github-actions commentedon Nov 21, 2026
Landed in #21964, merge
f349aa78camrveiss commentedon Nov 21, 2026
#21964 merged at
81c1b18e4. The two code criteria are ticked, with evidence from main:chat_workflow/tool_dispatch_guards.py,COMMAND_APPROVED_KEYis set only when the call's exact fingerprint was approved (:330), and is consumed once (approved_fingerprints - {shown}).tests/unit/chat_workflow/test_approved_command_runs_once_21959.py:test_approve_then_resume_runs_the_command_once_with_no_second_gate(:81),test_a_yes_for_one_command_never_authorises_another(:96),test_the_same_approved_call_dispatched_twice_is_held_the_second_time(:120) andtest_the_terminals_permission_check_still_blocks_an_approved_command(:147).chat_workflow/step_outcome.pycounts onlyRAN_STATUSES, plus anerrorthat carries a real exit code.exit_code_fieldnever invents an exit code for a refusal.:170,:178,:182,:201.81c1b18e4.fix(chat): an approved command runs once, and a step that did not run…
fix(chat): consume the approval once, and count only steps known to h…
mrveiss 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". Partial host evidence. AC3 is not ticked yet.[PTY_EXEC] Command complete. Return code: 0at 02:20:54.Tool execute_command: SUCCESS (0.59s). The file exists:-rw-r--r-- 1 autobot autobot 0 Nov 22 02:20 /tmp/autobot_livecheck_21959. There was no second approval gate.turn cancelled … reason=client_disconnect). Machine load was 41 at the time, and Ollama aborted the request when the client closed. The "reply matches what happened" part needs a run on a quieter machine.