Skip to content
53 changes: 53 additions & 0 deletions src/oss/deepagents/code/approval-modes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,59 @@ flowchart TD
```
</Accordion>

### Select a classifier model

By default, the Auto classifier uses the same model as the main agent. You can point it at a different (typically cheaper and faster) model to reduce cost and latency during Auto review without affecting the model used for your actual tasks.
Comment thread
mdrxy marked this conversation as resolved.
Outdated

Set the classifier model through any of these source:

<Tabs>
<Tab title="TUI command">
Run `/auto model` to open the interactive model picker and select a classifier model for the current session. To specify a model directly, pass it as an argument:

```txt
/auto model openai:gpt-5.6-luna
/auto model clear
```

Use `/auto model clear` to go back to inheriting the main model.
</Tab>
<Tab title="CLI flag">
```bash
dcode -y --auto-classifier-model openai:gpt-5.6-luna
```

`--auto-classifier-model` is only accepted in interactive TUI sessions.
</Tab>
<Tab title="Environment variable">
```bash
export DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL="openai:gpt-5.6-luna"
```

<Warning>
A **project `.env`** cannot set `DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL`. Only shell exports, `~/.deepagents/.env`, the CLI flag, and `/auto model` work.
</Warning>
</Tab>
<Tab title="config.toml">
```toml title="~/.deepagents/config.toml"
[models]
auto_classifier = "openai:gpt-5.6-luna"
```
</Tab>
</Tabs>
<br />
<Accordion title="Precedence order">
1. **`/auto model` TUI command**: takes effect immediately for the current session.
2. **`--auto-classifier-model` flag**: sets the classifier on launch (interactive TUI sessions only).
3. **`DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL` environment variable**: applies at startup.
4. **`[models].auto_classifier` in `config.toml`**: your persistent default.
5. **Inherit**: uses the main agent model (the default when nothing is configured).

A blank value at any level means "inherit from the next source". For example, an unset env var falls through to `config.toml`.
</Accordion>

The TUI displays which model is reviewing when Auto turns on and inside `/auto model` output.

### Revalidate before side effects

The decision plan is bound to the thread, mode, batch, and exact gated calls. Missing or invalid state, a mode race, or a replay falls back to human review. For example, if you switch to Manual while classifier review is in progress, an earlier Auto decision cannot execute silently; the normal approval UI opens instead.
Expand Down
1 change: 1 addition & 0 deletions src/oss/deepagents/code/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ Run OAuth login for MCP servers marked `auth: "oauth"` with `dcode mcp login <se
| `--no-stream` | Buffer the full response and write to stdout at once instead of streaming. Requires `-n` or piped stdin |
| `--stdin` | Read input from stdin explicitly instead of auto-detection. Errors clearly when stdin is unavailable or is a TTY |
| `-y`, `--auto-approve` | Enable classifier-backed [Auto](/oss/deepagents/code/approval-modes) mode. Requires an interactive local session; toggle with `Shift+Tab` during an interactive session |
| `--auto-classifier-model MODEL` | Model used by the [Auto classifier](/oss/deepagents/code/approval-modes#select-a-classifier-model) to review gated tool calls (`provider:model` format). Overrides `DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL` and `[models].auto_classifier` in `config.toml`. Interactive TUI sessions only |
| `--yolo` | Run gated actions without review after the one-time local risk acknowledgement. Interactive mode only |
| `-S`, `--shell-allow-list LIST` | Comma-separated shell commands to auto-approve, `'recommended'` for safe defaults, or `'all'` to allow any command. Applies to both `-n` and interactive modes |
| `--allow-fs-tools LIST` | Filesystem tools to expose. Defaults to `all`. See [Restrict filesystem tools](#restrict-filesystem-tools) |
Expand Down
3 changes: 3 additions & 0 deletions src/oss/deepagents/code/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ description: Configure model providers, defaults, retries, and gateways in confi
[models]
default = "ollama:qwen3:4b" # your intentional long-term preference
recent = "google_genai:gemini-3.6-flash" # last /model switch (written automatically)
auto_classifier = "openai:gpt-5.6-luna" # optional: cheaper model for Auto approval review
```

`[models].default` always takes priority over `[models].recent`. The `/model` command only writes to `[models].recent`, so your configured default is never overwritten by mid-session switches. To remove the default, use `/model --default --clear` or delete the `default` key from the config file.

`[models].auto_classifier` sets the model used by the [Auto approval classifier](/oss/deepagents/code/approval-modes#select-a-classifier-model) to review gated tool calls. When unset, the classifier inherits the main agent model. You can override this at runtime with `--auto-classifier-model` or `/auto model`. See [Select a classifier model](/oss/deepagents/code/approval-modes#select-a-classifier-model) for full precedence and security notes.

## Default and recent agent

```toml
Expand Down
Loading