STUPID-2026-0099

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

4.4medium
August 24, 2026Reproducible
  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.

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

Related incidents

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.

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