# Configuration

[中文](configuration.md) · [Back to README](../README.en.md)

## Sources and timing

Host configuration combines Bundle defaults, environment variables, and the `auto-review` Settings namespace. Web changes affect later Reviews only; an in-flight Review keeps the immutable snapshot captured at start.

The card appears under **Settings → Plugins → Auto Review** and is collapsed by default. Its body groups review model settings, review scope, evidence budgets, manual approval, and audit fields. Save sends changed fields only, updates `provider/model` as one atomic `route`, orders related limits safely, verifies the resulting snapshot, and rolls back failures.

After upgrading to a version with new Settings fields, an older Host snapshot may temporarily omit them. The Client applies current defaults to visible missing fields instead of reporting an empty string as invalid. Restart the DSH Host after plugin upgrades so the Host Settings schema matches the latest Client; if saving reports a Host rejection or connection change, restart before retrying.

## Fields

| Field | Default | Range or meaning |
|---|---:|---|
| `provider` / `model` | Current session route | Set both or neither |
| `timeoutMs` | `30000` | `1`–`120000` |
| `maxOutputTokens` | `600` | `64`–`4096` |
| `maxEvidenceBytes` | `131072` | `4096`–`1048576` |
| `maxActionBytes` | `32768` | `1024`–`262144`, not above evidence budget |
| `maxTranscriptEntries` | `80` | `1`–`500` |
| `maxEntryBytes` | `8192` | `256`–`65536` |
| `reviewShell` | `true` | Review Shell not proven read-only |
| `reviewNetwork` | `true` | Review known Web/network tools |
| `reviewMcp` | `true` | Review `mcp__*` |
| `reviewGenericApproval` | `true` | Review approval requests from extensions |
| `trajectoryEnabled` | `false` | Compatibility-only: Host/environment input is accepted, but Web Settings hides it and production Client emits no Trajectory UI |
| `manualOverride` | `denied-and-unavailable` | See below |
| `auditEnabled` | `true` | Enable final JSONL audit |
| `auditPath` | `${DSH_HOME}/audit/auto-review.jsonl` | Private non-empty path |
| `auditDetail` | `summary` | `summary` or `full` |
| `auditMaxBytes` | `16777216` | `65536`–`1073741824` |
| `maxAuditRecordBytes` | `262144` | `8192`–`4194304`, not above audit max |

## Manual approval policy

| `manualOverride` | Behavior |
|---|---|
| `denied-and-unavailable` | Use DSH's native one-time approval after denial, timeout, or technical failure |
| `denied-only` | Use native one-time approval only after explicit Guardian denial |
| `never` | Do not call the human answerer; preserve the automated result |

The native panel has Reject / Allow once semantics. An Allow once still passes audit-before-allow.

## Environment variables

Common variables:

```bash
DSH_AUTO_REVIEW_PROVIDER
DSH_AUTO_REVIEW_MODEL
DSH_AUTO_REVIEW_MANUAL_OVERRIDE
DSH_AUTO_REVIEW_AUDIT_PATH
DSH_AUTO_REVIEW_AUDIT_DETAIL
```

Reviewer provider and model must be present together. If both are absent, the route that produced the tool call is reused. Setting only one is invalid and fails closed.

## Preset patch warning

`cordis.patch.yml` replaces the complete `permission.config.presets` table. The Bundle restates DSH's three built-ins and adds `auto-review`, but cannot preserve unrelated custom entries automatically. Restate them in a later patch and inspect:

```bash
dsh --profile <profile> --dump-config
```

The current DSH Web UI hardcodes glyphs for built-in preset names and exposes no external icon registry. This release remains plugin-only, so it neither adds a fake glyph nor modifies DSH internals.
