STUPID-2026-0099

Aider's headless `--message` mode silently swallows slash commands (`/model`, `/ask`, `/architect`) and exits 0 having done nothing

4.0medium
August 24, 2026Repro reported

Why 4/10

Headless runs skip slash commands and exit 0, which can mislead pipelines. Reproduced; no downstream incident reported.

Scope
2/4
One project, repository, server or service, or a cost above roughly $10,000
Recoverability
1/3
Fully recovered, with effort
Did it happen
1/2
Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
Beyond the user
0/1
Only the user's own non-production work

The score is the sum of these four factors. How each factor is scored · scored 2026-10-29

  1. Instruction given

    None specific to a coding task — the failure triggers whenever Aider is invoked headlessly with `--message` and the message text begins with a `/` command that the interactive REPL would treat as a mode switch, e.g. `aider --message "/model gpt-4o" --no-git --yes-always`.

  2. Expected behavior

    A `--message` invocation containing `/model`, `/editor-model`, `/weak-model`, `/chat-mode`, `/ask`, `/code`, or `/architect` should either apply the requested switch (as the interactive loop does) or fail loudly — printing an error and exiting non-zero — so a caller relying on the exit code learns the command was not honored.

  3. Actual behavior

    In `aider/main.py`, the code path handling `--message` catches the internal `SwitchCoder` exception these commands raise with a bare `except SwitchCoder: pass`, unlike the interactive REPL loop, which handles the same exception by rebuilding the coder with the new setting. The bare `except...pass` discards the switch entirely, prints Aider's normal startup banner, and returns exit code 0 — identical to a successful run. The model, chat mode, or editor setting never changes.

  4. Damage

    Filed by the affected user (aniruddhaadak80) with an exact reproduction command and the specific source location (`aider/main.py`) and exception path identified, along with two concrete fix proposals. Open with no maintainer response as of publication, no labels applied. No specific downstream production incident was reported alongside the filing, but the failure mode is directly damaging to any headless automation pipeline that scripts Aider with slash commands and gates subsequent steps on its exit code: a `/model` switch that silently never happens, or an `/ask` that silently never runs, is indistinguishable from success. It is the same silent-success shape as three other Aider issues filed in the preceding weeks — #5486 (STUPID-2026-0082), #5573 (STUPID-2026-0080), and #5552 (STUPID-2026-0081) — a fourth distinct code path in headless mode where the tool reports success while having done nothing.

Full write-up

An Aider user (aniruddhaadak80) reported that headless invocations using --message silently discard slash commands that the interactive REPL treats as mode switches — /model, /editor-model, /weak-model, /chat-mode, /ask, /code, and /architect. Each of these commands raises an internal SwitchCoder exception when Aider is run interactively, and the REPL loop catches it by rebuilding the coder with the new setting. The --message code path in aider/main.py, however, catches the same exception with a bare except SwitchCoder: pass — the switch is dropped entirely, Aider prints its normal startup banner, and the process exits with code 0, exactly as it does on a genuine successful run. Running aider --message "/model gpt-4o" --no-git --yes-always reproduces it directly: the original model stays active, nothing indicates the switch was ignored, and the same silent-discard happens for /ask and /architect. The reporter pinpointed the exact file and exception path and proposed two fixes: apply the switch as the interactive loop does, or print an error and exit non-zero. No maintainer response had landed as of this write-up. It is the fourth distinct silent-success code path reported in Aider's headless mode within a few weeks — following separate issues in edit-format auto-selection (#5486), unified-diff partial-application warnings (#5573), and exit-code handling after a fatal connection failure (#5552) — each a different function, same shape: a headless run reports success while the requested work never happened.

Classification

Agent
Aider
Failure mode
Logic Error
Root cause
Logic Error
Domain
Infra
MIT AI Risk Repository (our mapping)
7.3 Lack of capability or robustness taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0099: Aider's headless `--message` mode silently swallows slash commands (`/model`, `/ask`, `/architect`) and exits 0 having done nothing." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0099/ (accessed 2026-12-06). CC BY 4.0.

← STUPID-2026-0098By IDSTUPID-2026-0100 →

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.