Repository navigation
Document selectable Auto approval classifier model for Deep Agents Code #5271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d20cbfc
Document selectable Auto approval classifier model
bracesproul 1aba30c
Merge branch 'main' into docs/auto-classifier-model
mdrxy 78eacee
Fix Vale LangChain.DashesSpaces errors in approval-modes
bracesproul 43c44ff
Update src/oss/deepagents/code/cli-reference.mdx
mdrxy 64837d8
Update src/oss/deepagents/code/approval-modes.mdx
mdrxy 6e91d1a
Update src/oss/deepagents/code/config-file.mdx
mdrxy c234a9f
minor update
npentrel 96d2961
fixup
npentrel d11978e
Update src/oss/deepagents/code/approval-modes.mdx
npentrel 2d28e97
Apply review feedback on Auto classifier model docs
bracesproul d31e87e
Apply suggestion from @mdrxy
mdrxy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,6 +137,61 @@ 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. | ||
|
|
||
| Set the classifier model through any of these sources, listed from highest to lowest precedence: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we put this in an accordion |
||
|
|
||
| 1. **`/auto model` TUI command** — takes effect immediately for the current session. | ||
| 2. **`--auto-classifier-model` flag** — sets the classifier for the 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`. | ||
|
|
||
| <Tabs> | ||
| <Tab title="TUI command"> | ||
| ```txt | ||
| /auto model anthropic:claude-haiku-4-5 | ||
| /auto model clear | ||
| ``` | ||
|
|
||
| `/auto model` validates the spec before accepting it. Use `/auto model clear` to go back to inheriting the main model. | ||
| </Tab> | ||
| <Tab title="CLI flag"> | ||
| ```bash | ||
| dcode -y --auto-classifier-model anthropic:claude-haiku-4-5 | ||
| ``` | ||
|
|
||
| `--auto-classifier-model` is only accepted in interactive TUI sessions. It errors in non-interactive (`-n`) and ACP server modes. | ||
| </Tab> | ||
| <Tab title="Environment variable"> | ||
| ```bash | ||
| export DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL="anthropic:claude-haiku-4-5" | ||
| ``` | ||
|
|
||
| <Warning> | ||
| A **project `.env`** cannot set `DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL`. Only shell exports, `~/.deepagents/.env`, the CLI flag, and `/auto model` work. This prevents a cloned repository from silently redirecting your approval review to a weaker model. | ||
| </Warning> | ||
| </Tab> | ||
| <Tab title="config.toml"> | ||
| ```toml title="~/.deepagents/config.toml" | ||
| [models] | ||
| auto_classifier = "anthropic:claude-haiku-4-5" | ||
| ``` | ||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| The TUI displays which model is reviewing when Auto turns on and inside `/auto model` output—including models set by env var or `config.toml`. | ||
|
|
||
| <Warning> | ||
| A weaker classifier means weaker review. A less capable model may be more susceptible to prompt injection in the content it reads. This tradeoff is documented in the Deep Agents Code threat model (T14). | ||
| </Warning> | ||
|
|
||
|
mdrxy marked this conversation as resolved.
Resolved
|
||
| **Fail-closed on errors.** If the configured classifier model cannot be built—because of a bad spec, missing credentials, or a missing provider package—the calls it would have reviewed are **denied** and do not fall back to the main model. After repeated failures, Auto stops and shows you the normal approval UI. The error message names the model so you can identify and fix the problem. | ||
|
npentrel marked this conversation as resolved.
Resolved
|
||
|
|
||
| ### 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. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.