Skip to content

bug(chat): an approved command never runs — a second approval gate holds it, and the turn tells the user it succeeded #21959

Open

Description

@mrveiss

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".

Two defects in one chain:

  1. An approved command does not run. After the graph's approval resume, the tool path gates the same command a second time, through the terminal queue, pending_approval and polling. That second gate is never answered, and the turn stops waiting. This is the double gate described in security(chat): tool approval is gated twice by different mechanisms — a policy change reaches only one path #13250, now seen as a user-visible failure.
  2. 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.

Related: #13250 (the double gate), #21751 (duplicate approval cards), #18065 (fabricated tool outputs).

Activity

  1. added
    bugSomething isn't working
    phase:M2.4Tasks and company workflows
    on Nov 21, 2026
  2. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    Landed in #21964, merge f349aa78ca

  3. mrveiss commented on Nov 21, 2026

    @mrveiss
    OwnerAuthor

    #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.
  4. mrveiss commented on Nov 22, 2026

    @mrveiss
    OwnerAuthor

    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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingphase:M2.4Tasks and company workflows

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions