Skip to content

Fusion: no fan-out question in auto mode inside the chat's folder (ATO-1689) - #1756

Closed
sosidudku1 wants to merge 3 commits into
mainfrom
fix/ato-1689-fusion-auto-mode
Closed

sosidudku1 wants to merge 3 commits into
mainfrom
fix/ato-1689-fusion-auto-mode

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes ATO-1689, reported in Discord on 21.11: in auto mode Fusion asked for permission to work in the folder the chat was already working in. A normal chat in auto mode does not ask.

Cause

Auto mode sets the approval level to 2, where writes inside the working directory stop asking. The one question fusion.delegate asks before its workers start uses the fusion_fanout category, which only goes quiet at level 4. So at levels 2 and 3 every fan-out asked, and since that answer is never granted for the session, every new turn asked again.

Fix

  • At levels 2 and 3, a fan-out whose directories all sit inside the chat's working directory no longer shows the fan-out question. It still goes through the gate as the workspace write it is (fs_write_workspace), so saved deny and ask rules on fusion.delegate keep working.
  • Its workers get no fan-out scope. The fan-out's yes normally covers ordinary commands and deletions in the directory, which a level-2 chat asks about. Without the scope every worker step is decided by the gate under the standing level, like the chat's own: writes in the folder go through. This holds for workers in their own worktree copies too, since their writes are judged against their own working directory.
  • A worker refused a command, a skill script or a move to the Trash under such a fan-out gets its own refusal text (FUSION_WORKER_COMMAND_NOT_ASKED_REFUSED, still needs_orchestrator), and the next fan-out of the turn asks the question once, as before. That yes covers commands, so tasks that need the build or the tests still work in auto mode after one question. The worker brief says this instead of promising commands it cannot run.
  • The question is still asked, as before, when:
    • any directory is outside the folder;
    • the user declined a file in the folder this turn;
    • the contract has checks or provide examples (they run commands with no gate of their own); split children's checks under a quiet fan-out are reported as not run;
    • the chat read outside content with agent.taintReview on (its fresh worker sessions would not be held the way the chat is);
    • the level is 1.
  • Level 4 and up behave as before. The level's yes is not remembered for the turn.

Tests

src/tools/fusion/fusion-delegate.test.ts, "fusion.delegate in auto mode (ATO-1689)", with a real ApprovalGate:

  • level 2 in-folder fan-out: no prompt (fails on the old code).
  • level 2: a worker's workspace write is approved, its shell command is refused, it holds no fan-out scope, and its brief says commands may be refused (fails on the old code).
  • a refused command, and a refused move to the Trash, make the next fan-out ask; a new turn is quiet again.
  • still asks: outside the folder, level 1, after a decline, contract checks, tainted session at level 3.
  • level 4 unchanged; fanoutQuietUnderLevel unit cases including /repo-backup and /repo/../etc.

Verification

Reviewer, skeptic (attacking for anything a normal auto-mode chat would ask about) and a refuter per major finding, two rounds. Confirmed and fixed: contract checks running commands unasked, a tainted orchestrator launching untainted workers at level 3, workers' refused commands looping because the orchestrator cannot run them. Fixed after round two: a refused move to the Trash looped the same way. Not fixed (low, adds a refusal, never an unasked action): subagent.run clears the turn grant and with it the "a command was refused" note, so one extra quiet fan-out can be refused once more. Nothing was run locally; CI runs the tests.

Out of scope: subagent.run asks the same fusion_fanout question and shows the same behavior in auto mode.

…O-1689)

In auto mode (approval level 2) a normal chat writes inside its folder
without asking, but fusion.delegate still asked before every fan-out
into that same folder: fusion_fanout only goes quiet at level 4.

At levels 2 and 3, a fan-out whose directories all sit inside the
chat's working directory now goes through the gate as a workspace
write (so saved rules still apply) instead of the fan-out question.
Its workers get no fan-out scope, so they run under the standing level
like the chat itself: writes in the folder go through, shell commands
are refused back to the orchestrator. Outside the folder, after a
decline in it, and at level 1 the question is asked as before.
…content (ATO-1689)

Review follow-ups. A quiet fan-out still asks when the contract has
checks or provide examples (they run commands with no gate of their
own), after a worker was refused a command under a quiet fan-out this
turn, and when the chat read outside content. A worker's refused
command under a quiet fan-out gets its own refusal text and makes the
next fan-out of the turn ask once; the worker brief no longer promises
commands it cannot run. Split children's checks are reported as not
run under a quiet fan-out.
@sosidudku1

Copy link
Copy Markdown
Collaborator Author

Merged into main via #1764 (all commits are in main). GitHub did not mark it merged because of the outage during the merge.

@sosidudku1 sosidudku1 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant