返回 CodeWhale
config.example.toml
根目录 / config.example.toml
1 # ╔══════════════════════════════════════════════════════════════════════════════╗
2 # ║ Codewhale Configuration ║
3 # ║ ║
4 # ║ Terminal coding agent for any model — open models first. ║
5 # ╚══════════════════════════════════════════════════════════════════════════════╝
6
7 # See `docs/CONFIGURATION.md` for how config is loaded (profiles, env overrides, etc.).
8
9 # ─────────────────────────────────────────────────────────────────────────────────
10 # Active provider + DeepSeek defaults
11 # ─────────────────────────────────────────────────────────────────────────────────
12 # Choose which provider to use by default. Per-provider credentials live in the
13 # `[providers.*]` sections near the bottom of
14 # this file — keeping both stored at once means `/provider deepseek` and
15 # `/provider nvidia-nim` (or `--provider openai`, `--provider wanjie-ark`,
16 # `--provider volcengine`, `--provider openrouter`, `--provider xiaomi-mimo`,
17 # `--provider fireworks`, `--provider siliconflow`, `--provider siliconflow-CN`,
18 # `/provider arcee`, `/provider moonshot`, `/provider qianfan`, `/provider sglang`, `/provider vllm`,
19 # `/provider ollama`, `/provider huggingface`, `/provider stepfun`, `/provider openmodel`,
20 # `/provider opencode-go`, `/provider opencode-zen`, `/provider meta`, `/provider xai`) toggle without having to re-enter keys. Keys and
21 # endpoints live in each provider's `[providers.<name>]` table. An older
22 # top-level `api_key` / `base_url` is still read: it belongs to
23 # `[providers.deepseek]` (or to the vendor whose official host it names), and
24 # `codewhale config migrate` moves it there in the file.
25 provider = "deepseek" # deepseek | deepseek-cn | deepseek-anthropic | nvidia-nim | openai | atlascloud | wanjie-ark | volcengine | openrouter | orcarouter | xiaomi-mimo | novita | fireworks | siliconflow | siliconflow-CN | arcee | moonshot | zai | stepfun | minimax | sglang | vllm | ollama | ollama-cloud | huggingface | modelscope | together | qianfan | openai-codex | anthropic | openmodel | deepinfra | sakana | longcat | opencode-go | opencode-zen | meta | xai | mistral | telecomjs | google | edenai | zenmux | csdn | concentrate | modelstudio-token-plan | modelstudio-coding-plan | codewhale
26 # provider = "deepseek-cn" # legacy alias (official host is still https://api.deepseek.com)
27 # Optional custom model request headers for OpenAI-compatible gateways.
28 # Authorization and Content-Type are managed by the client and cannot be overridden here.
29 # http_headers = { "X-Model-Provider-Id" = "your-model-provider" }
30
31 # ─────────────────────────────────────────────────────────────────────────────────
32 # Default Models
33 # ─────────────────────────────────────────────────────────────────────────────────
34 # DeepSeek V4 family:
35 # deepseek-v4-pro — flagship reasoning model on DeepSeek Platform
36 # deepseek-v4-flash — fast, cost-efficient (legacy aliases: deepseek-chat, deepseek-reasoner)
37 # deepseek-ai/deepseek-v4-pro — NVIDIA NIM-hosted Pro model ID
38 # deepseek-ai/deepseek-v4-flash — NVIDIA NIM-hosted Flash model ID
39 # deepseek/deepseek-v4-pro — default OpenRouter DeepSeek model ID
40 # arcee-ai/trinity-large-thinking — OpenRouter Arcee Trinity Large Thinking
41 # xiaomi/mimo-v2.5-pro — OpenRouter Xiaomi MiMo 2.5 Pro
42 # xiaomi/mimo-v2.5 — OpenRouter Xiaomi MiMo 2.5
43 # z-ai/glm-5.1 — OpenRouter Z.AI GLM 5.1
44 # z-ai/glm-5.2 — OpenRouter Z.AI GLM 5.2
45 # z-ai/glm-5.3 — OpenRouter Z.AI GLM 5.3 (live on Z.ai since 2026-08-13;
46 # metadata inherited from 5.2, unpriced)
47 # z-ai/glm-5.3-flash — OpenRouter Z.AI GLM 5.3 Flash (1M multimodal; $0.15/$0.50 list)
48 # z-ai/glm-5-turbo — OpenRouter Z.AI GLM 5 Turbo (scout fast sibling of 5.2)
49 # GLM-5.3 — default direct Z.AI Coding Plan model (live since 2026-08-13;
50 # metadata inherited from 5.2, unpriced)
51 # GLM-5.3-Flash — direct Z.AI GLM 5.3 Flash (faster/explore sibling of 5.3)
52 # GLM-5.2 — direct Z.AI GLM 5.2 (previous default; explicit selections keep it)
53 # GLM-5.1 — direct Z.AI smaller model
54 # GLM-5-Turbo — direct Z.AI fast model (scout fast sibling of 5.2)
55 # step-5 — default direct StepFun / StepFlash model ID
56 # kimi-k3 — direct Moonshot K3 model ID (1M context)
57 # kimi-k2.7-code — default direct Moonshot/Kimi K2.7 model ID
58 # k3 — Kimi Code membership K3 API model ID
59 # kimi-for-coding — Kimi Code membership K2.7 compatibility ID
60 # kimi-for-coding-highspeed — Kimi Code membership high-speed roster ID
61 # gpt-4.1 — default generic OpenAI-compatible model ID
62 # deepseek-ai/deepseek-v4-flash — default AtlasCloud model ID
63 # deepseek-reasoner — default Wanjie Ark model ID
64 # mimo-v2.6-pro — default Xiaomi MiMo model ID
65 # mimo-v2.5-pro-ultraspeed — Xiaomi MiMo V2.5 Pro UltraSpeed chat model ID
66 # mimo-v2.6-flash — Xiaomi MiMo V2.6 Flash model ID
67 # mimo-v2.5-tts — Xiaomi MiMo speech/TTS model ID
68 # mimo-v2.5-tts-voicedesign — Xiaomi MiMo voice-design TTS model ID
69 # mimo-v2.5-tts-voiceclone — Xiaomi MiMo voice-clone TTS model ID
70 # accounts/fireworks/models/deepseek-v4-pro — Fireworks AI Pro model ID
71 # deepseek-ai/DeepSeek-V4-Pro — SiliconFlow hosted Pro model ID
72 # deepseek-ai/DeepSeek-V4-Flash — SiliconFlow hosted Flash model ID
73 # trinity-large-thinking — default direct Arcee AI API model ID
74 # trinity-large-preview — direct Arcee AI API model ID
75 # deepseek-ai/DeepSeek-V4-Pro — SGLang self-hosted Pro model ID
76 # deepseek-ai/DeepSeek-V4-Flash — SGLang self-hosted Flash model ID
77 # auto — auto-select between flash and pro based on task complexity.
78 # Complex tasks (debugging, refactoring, architecture) → pro;
79 # simple tasks (lookups, formatting, Q&A) → flash.
80 default_text_model = "deepseek-flash"
81
82 # ─────────────────────────────────────────────────────────────────────────────────
83 # Thinking Mode (DeepSeek V4 reasoning effort)
84 # ─────────────────────────────────────────────────────────────────────────────────
85 # "auto" — the route chooses per request (default)
86 # "off" — disables chain-of-thought (thinking.type = disabled)
87 # "low" — compat-maps to "high" server-side
88 # "medium" — compat-maps to "high" server-side
89 # "high" — reasoning_effort = high (DeepSeek default)
90 # "max" — reasoning_effort = max (deepest reasoning)
91 #
92 # Ctrl+T in the TUI cycles the reasoning tier. The header shows the current
93 # tier as a ⚡ chip. (Shift+Tab cycles the permission posture — Ask /
94 # Auto-Review / Full Access — not the reasoning tier.)
95 reasoning_effort = "auto"
96
97 # NOTE: `show_thinking`, `thinking_default_expanded`, `thinking_preview_lines`,
98 # `help_expand_groups`, `pin_last_prompt`, and `cost_currency` live in
99 # `~/.codewhale/settings.toml`, not here — `Config` has no such fields and
100 # unknown keys are ignored. See crates/tui/src/settings.rs.
101 #
102 # Density (Grok-like compact defaults; turn these up if you want more shown):
103 # thinking_preview_lines = 2 # 0 header-only, 10 older dump
104 # thinking_default_expanded = false
105 # help_expand_groups = false # true = F1 starts fully expanded
106 # pin_last_prompt = true
107 # show_tool_details = false
108
109 # Root-level keys must appear before the first `[table]` header: TOML assigns
110 # every key after a header to that table. Keep new top-level keys in this
111 # block (scripts/check-config-example.py enforces it in CI).
112
113 # ─────────────────────────────────────────────────────────────────────────────────
114 # Paths
115 # ─────────────────────────────────────────────────────────────────────────────────
116 # New installs write product state under ~/.codewhale/. Existing ~/.deepseek/
117 # files are still read as compatibility fallbacks when the .codewhale file is
118 # absent.
119 skills_dir = "~/.codewhale/skills"
120 mcp_config_path = "~/.codewhale/mcp.json"
121
122 # Anchors the native memory store. The filename itself is not written: under
123 # the Native backend (the only backend) the store is re-rooted to
124 # `<parent-of-this-path>/memory/global/MEMORY.md`. With the default below that
125 # resolves to `~/.codewhale/memory/global/MEMORY.md` (plus workspace-scoped
126 # files and a rebuildable SQLite FTS5 index). See docs/MEMORY.md.
127 memory_path = "~/.codewhale/memory.md"
128
129 # instructions = ["./AGENTS.md", "~/.codewhale/global.md"]
130 #
131 # Optional list of additional instruction files concatenated into the
132 # system prompt in declared order (#454). Useful for layering
133 # repo-specific rules on top of a global preferences file. Each entry
134 # is expanded so `~` and env vars work; missing files are skipped with
135 # a tracing warning. Files are capped at 100 KiB per entry.
136 #
137 # Project-level config (.codewhale/config.toml in the workspace) replaces
138 # the user-level array wholesale rather than merging — list `~/global.md`
139 # inside the project array if you want both. An explicit empty array
140 # (`instructions = []`) clears the user list for the current repo.
141
142 # ─────────────────────────────────────────────────────────────────────────────────
143 # Security
144 # ─────────────────────────────────────────────────────────────────────────────────
145 allow_shell = true
146 approval_policy = "on-request" # on-request | untrusted | never
147 sandbox_mode = "workspace-write" # read-only | workspace-write | danger-full-access | external-sandbox
148
149 # Whether a workspace-write sandbox also lets shell commands reach the
150 # network. Default false: being allowed to edit this repository is not a
151 # reason to be allowed to open outbound connections, so `curl`, package
152 # installs, and `git fetch` are denied by the OS sandbox unless you opt in.
153 # When a command is denied, Codewhale offers an elevation prompt that grants
154 # network for that call only; set this to `true` to grant it for the whole
155 # session instead. `danger-full-access` and `yolo` are unsandboxed and
156 # unaffected by this key. Note that on platforms with no OS sandbox backend
157 # (default Linux without bubblewrap, and Windows) nothing is enforced either
158 # way -- `/status` and `doctor` both say so.
159 # sandbox_network_access = false
160
161 # Which other agents' instruction files to import as project instructions.
162 # Empty by default. Codewhale reads AGENTS.md (the cross-agent standard) and
163 # its own .codewhale/instructions.md without being asked; a CLAUDE.md,
164 # .cursorrules, or .github/copilot-instructions.md written as law for a
165 # different tool is not treated as law here until you say so. Codewhale's own
166 # files always outrank anything imported.
167 # Accepts: "claude", "cursor", "cline", "windsurf", "gemini", "copilot",
168 # "muse", or "all". Env: CODEWHALE_PROJECT_INSTRUCTION_IMPORTS (comma-separated).
169 # project_instruction_imports = ["claude"]
170 #
171 # Standing instructions are budgeted per scope, in estimated tokens, and every
172 # trim or skip is reported to the model and in /context.
173 # `global` covers ~/.codewhale/AGENTS.md (or ~/.agents/AGENTS.md), the global
174 # instructions.md fallbacks, ~/.claude/CLAUDE.md (last resort, claude_fallback
175 # only) and the `instructions = [...]` array. `project` covers the
176 # repository-root -> workspace AGENTS.md chain, co-read foreign files, and
177 # .codewhale/rules/*.md. A scope is capped at the smaller of its absolute token
178 # budget and its share of the usable window (context window minus the output
179 # reservation and a 10% safety reserve). Each file keeps at most its first
180 # 100 KiB. User config only: a cloned repository cannot change it.
181 # [instruction_budget]
182 # global_budget_tokens = 100000 # positive; absolute cap for the global scope
183 # project_budget_tokens = 100000 # positive; absolute cap for the project scope
184 # global_budget_percent = 25 # 1..=100, share of the usable window
185 # project_budget_percent = 25 # 1..=100, share of the usable window
186 # static_prefix_guard_percent = 80 # 1..=100; guard must leave >=10 points
187 # file_max_bytes = 8388608 # 1..=8388608; larger files are skipped
188 # policy = "trim" # trim | refuse
189 # claude_fallback = false # opt in: AGENTS.md wins; else CLAUDE.md
190 # prompt_suggestion = true # opt-in: show ghost-text follow-up question in composer after each turn
191
192 # Optional tab/window title shown as `[title] …` in front of the terminal
193 # window title (the `Codewhale` / `reasoning…` / `using tool…` / `done`
194 # states). Multi-window setups can give each workspace its own `--config`
195 # file (or profile) so alt-tabbed sessions are identifiable at a glance.
196 # The `/title` command overrides this per session; `/config title … --save`
197 # persists a new default here. Run `/title off` to drop a session override.
198 # title = "workspace-x"
199
200 # Typed permission rules live in a sibling `permissions.toml` file, not in
201 # config.toml. Each `[[rules]]` entry accepts `tool`, optional `command`
202 # or `path`, optional absolute `workspace`, optional `command_exact = true`,
203 # and an `action` field: `"deny"`, `"ask"` (default), or `"allow"`.
204 # Deny always wins over ask, which wins over allow. The active user's sibling
205 # file is the only rule source today; project config overlays do not load a
206 # project-local permissions.toml. `workspace` is a repo scope, not a source.
207 # Globs and broad directory rules remain future work.
208 #
209 # In supported approval cards, press `S` to allow once and save an exact ask
210 # rule. Eligible safe calls also offer `P` / "Always allow this exact rule in
211 # this repo", which saves an exact `allow` rule scoped to the current absolute
212 # workspace. Dangerous/critical calls and repo-law prompts cannot save allow
213 # grants. The approval UI still does not save deny rules:
214 # exec_shell -> exact approved command string
215 # write_file -> exact workspace-relative target path
216 # edit_file -> exact workspace-relative target path
217 # apply_patch -> one exact workspace-relative path per validated touched file
218 # `read_file` rules can be written manually, but the approval UI does not save
219 # them.
220 #
221 # `/permissions list` shows the active source, effective matcher, repo/global
222 # scope, and whether each rule applies in the current workspace.
223 # `/permissions remove <number>` previews a deletion and prints a confirmation
224 # command bound to the current file snapshot. If the file changes first, the
225 # confirmation fails safely. Removal preserves unrelated comments/formatting,
226 # uses the same lock as approval-card appends, and atomically replaces the file.
227 # `/config ask-rules` remains a compatibility entry to the same list.
228 #
229 # Example ~/.codewhale/permissions.toml:
230 #
231 # [[rules]]
232 # tool = "exec_shell"
233 # command = "cargo test"
234 # action = "ask"
235 #
236 # # Block dangerous commands
237 # [[rules]]
238 # tool = "exec_shell"
239 # command = "sed"
240 # action = "deny"
241 #
242 # [[rules]]
243 # tool = "exec_shell"
244 # command = "awk"
245 # action = "deny"
246 #
247 # # Allow trusted commands without asking
248 # [[rules]]
249 # tool = "exec_shell"
250 # command = "git status"
251 # command_exact = true
252 # workspace = "/absolute/path/to/project"
253 # action = "allow"
254 #
255 # # Path-based deny
256 # [[rules]]
257 # tool = "write_file"
258 # path = "src/main.rs"
259 # action = "deny"
260 #
261 # [[rules]]
262 # tool = "edit_file"
263 # path = "src/lib.rs"
264 # action = "ask"
265 #
266 # [[rules]]
267 # tool = "apply_patch"
268 # path = "src/patch-target.rs"
269 #
270 # [[rules]]
271 # tool = "read_file"
272 # path = "secrets/api_key.txt"
273 # action = "deny"
274 # ─────────────────────────────────────────────────────────────────────────────────
275 # External Sandbox Backend (pluggable remote execution)
276 # ─────────────────────────────────────────────────────────────────────────────────
277 # When sandbox_backend is set to "opensandbox", all exec_shell calls are
278 # routed through an external OpenSandbox-compatible HTTP API instead of
279 # spawning a local process. The backend sends `POST {sandbox_url}/v1/sandbox/run`
280 # with `{"cmd": "...", "env": {...}}` and expects
281 # `{"stdout": "...", "stderr": "...", "exit_code": 0}`.
282 #
283 # sandbox_backend = "none" # "none" (default) or "opensandbox"
284 # sandbox_url = "http://localhost:8080" # OpenSandbox-compatible API base URL
285 # sandbox_api_key = "YOUR_API_KEY" # Optional Bearer token sent with requests
286 #
287 # Env-var overrides:
288 # DEEPSEEK_SANDBOX_BACKEND → sandbox_backend
289 # DEEPSEEK_SANDBOX_URL → sandbox_url
290 # DEEPSEEK_SANDBOX_API_KEY → sandbox_api_key
291 #
292 # Example OpenSandbox setup:
293 #
294 # sandbox_backend = "opensandbox"
295 # sandbox_url = "http://localhost:8080"
296 # sandbox_api_key = "sk-opensandbox-secret"
297 #
298 # The backend uses a 30-second HTTP timeout. Background, interactive, and
299 # TTY modes are not supported with external backends — all commands run
300 # synchronously via HTTP.
301 # ─────────────────────────────────────────────────────────────────────────────────
302 # Bubblewrap (Linux only, OS-level filesystem isolation)
303 # ─────────────────────────────────────────────────────────────────────────────────
304 # On by default: when `/usr/bin/bwrap` is installed and a probe shows it can
305 # create its namespaces on this host, sandboxed exec_shell commands are routed
306 # through it. Bubblewrap creates a read-only view of the root filesystem with
307 # write access limited to the sandbox mode's writable roots. Install separately:
308 #
309 # Ubuntu/Debian: apt install bubblewrap
310 # Fedora: dnf install bubblewrap
311 # Arch: pacman -S bubblewrap
312 #
313 # prefer_bwrap = false # opt out — Linux commands run unwrapped
314 #
315 # Env override: CODEWHALE_PREFER_BWRAP=true|false
316 # Legacy alias (deprecated until 0.10.0): DEEPSEEK_PREFER_BWRAP=true|false
317 #
318 # With prefer_bwrap = true, the sandbox gets a private /dev and /proc plus a
319 # writable isolated /tmp by default, so toolchains work without widening the
320 # filesystem policy (#5410). Two optional escape hatches:
321 #
322 # bwrap_ro_roots = [] # extra host paths bind-mounted read-only, e.g.
323 # # ["/usr/lib", "/usr/lib64"] for system-library
324 # # linking when the root bind is narrowed
325 # bwrap_dev_roots = [] # host device nodes bind-mounted read-write, e.g.
326 # # ["/dev/null"] for redirection against the host
327 # # node — character/block devices only, never
328 # # directories, so this cannot widen file writes
329
330 # There is no config.toml `auto_allow` key. To pre-approve a command, add an
331 # `action = "allow"` rule to permissions.toml `[[rules]]` (see the
332 # permissions.toml example above).
333 max_subagents = 64 # optional (default 64, clamped to 1-128)
334
335 # Optional managed policy paths (defaults to /etc/deepseek/*.toml on unix):
336 # managed_config_path = "/etc/deepseek/managed_config.toml"
337 # requirements_path = "/etc/deepseek/requirements.toml"
338
339 # ─────────────────────────────────────────────────────────────────────────────────
340 # Product telemetry — optional, enabled by default with a startup disclosure
341 # ─────────────────────────────────────────────────────────────────────────────────
342 # Anonymous usage analytics are enabled when this key is omitted, unless an
343 # existing opt-out or a run-scoped kill switch disables them. No first-run
344 # affirmative opt-in is required. See docs/TELEMETRY.md for the complete schema.
345 # Local session history and usage diagnostics work with telemetry disabled;
346 # they require no account or hosted analytics service.
347 #
348 # Setting it to `false` here is an answer, not just a flag: it deletes the
349 # random install id, truncates every buffered event, and leaves a tombstone
350 # that a session already running re-checks before it sends anything. Every
351 # later run re-reads this key and re-asserts that tombstone, so it stands for
352 # as long as the `false` does — and nothing outranks it, not `--telemetry true`
353 # and not `CODEWHALE_TELEMETRY=1`. Turning telemetry back on means writing
354 # `telemetry = true` here.
355 #
356 # The environment variable and the flag are different: they stop the run and
357 # erase nothing, so a harness that disables telemetry for one command does not
358 # discard the machine owner's install id and dry-run records.
359 #
360 # codewhale config set telemetry false # opt out: stops it and erases state
361 # CODEWHALE_TELEMETRY=0 codewhale # kill switch: stops it, erases nothing
362 #
363 # What is never collected: prompts, completions, tool arguments, diffs, file
364 # contents, filenames, paths, git remotes, repo or branch names, memory
365 # entries, chat history, API keys or tokens (not even a boolean saying one
366 # exists), custom or private model ids (only bundled public-catalog model ids
367 # are counted; all others map to "other"), custom provider table names, MCP
368 # server names, error or panic message bodies, per-event timestamps,
369 # keystrokes, clipboard, screenshots, or location. The complete schema is
370 # `docs/TELEMETRY.md`, and a test asserts this file and the serializer agree.
371 #
372 # A repo-local `.codewhale/config.toml` can set neither key: someone else's
373 # repository cannot turn your telemetry on or aim it at a host of their choosing.
374 # telemetry = false
375
376 # Where batches are POSTed. Leaving this unset selects the shipped default,
377 # the first-party ingest service:
378 #
379 # https://telemetry.codewhale.net/v1/telemetry
380 #
381 # That default is only ever consulted for a session that is already enabled —
382 # it decides where a batch goes, never whether one exists. Nothing is sent
383 # when telemetry is disabled via config, CLI flag, or an environment kill
384 # switch (`CODEWHALE_TELEMETRY=0`, `DO_NOT_TRACK`).
385 #
386 # Two overrides, both of which beat the default:
387 #
388 # telemetry_endpoint = "https://collector.internal/v1/batch" # your own sink
389 # telemetry_endpoint = "" # contact nobody
390 #
391 # The empty string is the local dry-run sink: batches are serialized exactly as
392 # a real endpoint would see them, appended to
393 # `$CODEWHALE_HOME/telemetry/dryrun.jsonl`, and no HTTP client is ever
394 # constructed. Read that file to see precisely what would have been sent.
395 # `CODEWHALE_TELEMETRY_ENDPOINT` overrides this file, and setting it to the
396 # empty string means the same "contact nobody".
397 #
398 # Background public catalog refresh (https://models.dev/catalog.json, every 24h,
399 # no credentials; suppressed automatically in CI and under DO_NOT_TRACK):
400 # [catalog]
401 # auto_refresh = true # set false (or CODEWHALE_DISABLE_MODELS_DEV_FETCH=1) to disable
402 #
403 # `https://` is required; plain `http://` is accepted only for loopback, and no
404 # environment variable overrides that refusal.
405 # telemetry_endpoint = "https://telemetry.codewhale.net/v1/telemetry"
406
407 # Signed catalog overlays are optional and inactive without approved trust keys.
408 # Explicit route/model selections and provider-owned rosters keep priority.
409 # CODEWHALE_DISABLE_CLOUD_FACTS=1 disables cache, local files and network too.
410 [cloud_facts]
411 enabled = false
412 channel = "stable"
413 ttl_hours = 6
414 # url = "https://codewhale.net/api/facts/v1/{channel}"
415
416 # ─────────────────────────────────────────────────────────────────────────────────
417 # Startup update check
418 # ─────────────────────────────────────────────────────────────────────────────────
419 # The TUI checks for newer Codewhale releases in the background at startup.
420 # Set check_for_updates = false in managed or air-gapped environments.
421 # The result is cached in ~/.codewhale/update-check.json, so the network is
422 # touched at most once per check_interval_hours while the notice still shows
423 # on every launch. Set 0 to check on every launch.
424 # Checks are skipped entirely in CI, and when CODEWHALE_NO_UPDATE_CHECK or
425 # NO_UPDATE_NOTIFIER is set.
426 # update_uri may point at a GitHub-compatible latest-release JSON endpoint.
427 # show_whats_new = false turns off the one-time "Updated to <version>" notice
428 # and release-notes link shown on the first start after an update.
429 [update]
430 check_for_updates = true
431 check_interval_hours = 24
432 show_whats_new = true
433 # update_uri = "https://internal.mirror.example/codewhale/releases/latest"
434
435 # ─────────────────────────────────────────────────────────────────────────────────
436 # Hotbar slots (#2061 / #2064)
437 # ─────────────────────────────────────────────────────────────────────────────────
438 # Optional hotbar bindings for slots 1-8. Since #3807 the Hotbar is hidden by
439 # default: an omitted `hotbar` key and an explicit `hotbar = []` both mean no
440 # hotbar. It shows only when [[hotbar]] tables are configured here, and
441 # `/hotbar on` writes the eight default slots as explicit [[hotbar]] tables:
442 # 1 slash.workflow 2 slash.goal 3 slash.auto 4 mode.plan
443 # 5 mode.agent 6 mode.operate 7 palette.open 8 sidebar.toggle
444 #
445 # Invalid slots are skipped with a warning, duplicate slots use the last entry,
446 # and unknown actions are preserved so the UI can show a disabled entry.
447 # Slash commands can be bound as slash.<name>, for example slash.workflow.
448 # Commands that require arguments pre-fill the composer instead of running
449 # incomplete.
450 #
451 # [[hotbar]]
452 # slot = 1
453 # label = "voice"
454 # action = "voice.toggle"
455 #
456 # [[hotbar]]
457 # slot = 2
458 # action = "session.compact"
459 #
460 # [[hotbar]]
461 # slot = 3
462 # label = "mode"
463 # action = "slash.mode"
464
465 # ─────────────────────────────────────────────────────────────────────────────────
466 # User memory (#489) — opt-in. When enabled, the TUI loads the native store
467 # derived from memory_path (see above), injects a bounded recall block into
468 # the system prompt, intercepts `# foo` in the composer, and registers the
469 # `remember` / `memory_search` tools.
470 # ─────────────────────────────────────────────────────────────────────────────────
471 [memory]
472 # enabled = true # turn the feature on (default: false)
473 # Override the env-var equivalent: `DEEPSEEK_MEMORY=on`
474
475 # Xiaomi MiMo speech/TTS defaults. Also configurable with
476 # XIAOMI_MIMO_SPEECH_OUTPUT_DIR / MIMO_SPEECH_OUTPUT_DIR.
477 [speech]
478 # output_dir = "./speech"
479
480 # ─────────────────────────────────────────────────────────────────────────────────
481 # Reasoning-only recovery
482 # ─────────────────────────────────────────────────────────────────────────────────
483 # When a reasoning model returns only hidden thinking without any answer text
484 # or tool call, the engine can re-request the answer automatically.
485 # Set max_reprompts = 0 to disable automatic recovery entirely.
486 # [reasoning_only]
487 # max_reprompts = 2
488 # reprompt_message = "So, what's up ? Keep running !"
489
490 # ───────────────────────────────────────────────────────────────────────────
491 # Model-bound key redaction ([redaction])
492 # ───────────────────────────────────────────────────────────────────────────
493 # Codewhale masks credential-looking values in tool output before it reaches
494 # the model (the "model boundary"), so a file that contains a configured API
495 # key, a bare provider token, or a credential-shaped opaque string never leaks
496 # those bytes to the model. Leave this enabled unless the model must read and
497 # edit files that contain real credentials.
498 #
499 # Disabling is a security decision, so it is never a plain flag:
500 # * Set model_bound = "disabled" here, restart Codewhale, and the startup
501 # gate asks twice - a first confirmation, then a red "are you really
502 # sure?" stage. Only the second confirmation takes effect, and it applies
503 # on later launches while model_bound stays "disabled".
504 # * Going back to "enabled" - or rewriting config.toml after the
505 # confirmation - invalidates it: requesting "disabled" again always
506 # asks for a fresh confirmation.
507 # * Until a confirmation exists - including in non-interactive/headless
508 # runs, which never confirm anything - masking stays on regardless of
509 # this key. Choosing "keep masking on" on the gate leaves the key
510 # untouched, so the next launch asks again.
511 # * The value is forgiving: false/"off" mean "disabled"; true/"on" mean
512 # "enabled".
513 # [redaction]
514 # model_bound = "enabled" # mask keys before they reach the model (default)
515 # model_bound = "disabled" # request the opt-out (restart + confirm required)
516
517 # Native tool catalog controls (#2076). By default only the core tool surface
518 # is loaded into the model context; less common native tools are discoverable
519 # through ToolSearch and loaded on first use.
520 # [tools]
521 # always_load = ["Git", "notify"]
522 #
523 # `request_user_input` payload ceilings (#5949). The model may ask up to
524 # `user_input_max_questions` questions per call, each offering up to
525 # `user_input_max_options` options. Out-of-range values are clamped to the
526 # supported ranges (1..=10 and 2..=10) with a warning.
527 # user_input_max_questions = 6
528 # user_input_max_options = 4
529 #
530 # Seconds a question or an approval decision waits before it cancels (#6003).
531 # 0 disables the timeout entirely; values above 86400 (24h) are clamped.
532 # user_input_timeout_seconds = 300
533 #
534 # Fail-safe ceiling, in seconds, for how long a durable task (runtime API
535 # server) may sit on an unanswered approval or question before it fails with
536 # human_wait_timeout. 0 or omitted uses 1800; values are clamped to 1..=86400.
537 # task_human_wait_cap_seconds = 1800
538 #
539 # Shell commands a single parallel tool wave may run at once. 0 or omitted
540 # uses 4; values above 32 are clamped.
541 # max_parallel_shell_exec = 4
542 #
543 # Bound an interactive approval card's wait (#6101). When the window elapses
544 # the card resolves to deny (fail-closed) and the transcript says the bound
545 # denied the call; omitted or 0 waits indefinitely.
546 # [approval]
547 # timeout_seconds = 300
548
549 # Optional sub-agent tuning. max_concurrent overrides top-level max_subagents.
550 # [subagents]
551 # max_concurrent = 10
552 # api_timeout_secs = 600 # per-step API timeout, clamped to 1..=3600
553 #
554 # How many levels of nested sub-agents the `agent` tool may spawn:
555 # max_depth = 0 # opt out completely — the agent never spawns sub-agents
556 # max_depth = 1 # the agent may spawn sub-agents, but those may not spawn more
557 # max_depth = 2 # one more level of nesting, etc.
558 # Omit to leave delegation depth uncapped. Explicit owner limits are enforced
559 # by the runtime and cannot be widened by descendants.
560 # max_depth = 3
561
562 # ─────────────────────────────────────────────────────────────────────────────────
563 # Per-provider credentials (peer providers — NIM is first-class, not a flag)
564 # ─────────────────────────────────────────────────────────────────────────────────
565 # Providers can be stored at once; `provider = "..."` (top of file) or
566 # `/provider deepseek` / `/provider nvidia-nim` / `--provider openai` /
567 # `--provider wanjie-ark` / `/provider volcengine` / `/provider fireworks` /
568 # `--provider siliconflow` / `/provider arcee` / `/provider moonshot`
569 # switches between them without having to re-enter keys. Env vars override anything set here:
570 # DeepSeek: DEEPSEEK_API_KEY, DEEPSEEK_BASE_URL, DEEPSEEK_MODEL
571 # DeepSeek Anthropic-compatible: DEEPSEEK_API_KEY, DEEPSEEK_ANTHROPIC_BASE_URL
572 # NIM: NVIDIA_API_KEY (or NVIDIA_NIM_API_KEY), NIM_BASE_URL
573 # (or NVIDIA_NIM_BASE_URL / NVIDIA_BASE_URL), NVIDIA_NIM_MODEL
574 # OpenAI-compatible: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
575 # Wanjie Ark: WANJIE_ARK_API_KEY (or WANJIE_API_KEY), WANJIE_ARK_BASE_URL, WANJIE_ARK_MODEL
576 # Volcengine Ark: VOLCENGINE_API_KEY (or VOLCENGINE_ARK_API_KEY / ARK_API_KEY), VOLCENGINE_BASE_URL, VOLCENGINE_MODEL
577 # OpenRouter: OPENROUTER_API_KEY, OPENROUTER_BASE_URL, OPENROUTER_MODEL
578 # Xiaomi MiMo: XIAOMI_MIMO_API_KEY (or XIAOMI_API_KEY / MIMO_API_KEY), XIAOMI_MIMO_BASE_URL, XIAOMI_MIMO_MODEL
579 # Token Plan: XIAOMI_MIMO_TOKEN_PLAN_API_KEY (or MIMO_TOKEN_PLAN_API_KEY), XIAOMI_MIMO_MODE/MIMO_MODE
580 # Novita: NOVITA_API_KEY, NOVITA_BASE_URL, NOVITA_MODEL
581 # Fireworks: FIREWORKS_API_KEY, FIREWORKS_BASE_URL
582 # SiliconFlow: SILICONFLOW_API_KEY, SILICONFLOW_BASE_URL, SILICONFLOW_MODEL
583 # Arcee: ARCEE_API_KEY, ARCEE_BASE_URL, ARCEE_MODEL
584 # Moonshot/Kimi: MOONSHOT_API_KEY (or KIMI_API_KEY), MOONSHOT_BASE_URL, MOONSHOT_MODEL
585 # SGLang: SGLANG_BASE_URL, SGLANG_MODEL, optional SGLANG_API_KEY
586 # vLLM: VLLM_BASE_URL, VLLM_MODEL, optional VLLM_API_KEY
587 # Ollama: OLLAMA_BASE_URL, OLLAMA_MODEL, optional OLLAMA_API_KEY
588 # Hugging Face: HUGGINGFACE_API_KEY (or HF_TOKEN), HUGGINGFACE_BASE_URL (or HF_BASE_URL),
589 # HUGGINGFACE_MODEL (or HF_MODEL)
590 # Meta Model API: META_MODEL_API_KEY (or MODEL_API_KEY), META_MODEL_API_BASE_URL
591 # (or MODEL_API_BASE_URL), META_MODEL_API_MODEL (or MODEL_API_MODEL)
592 #
593 # Custom DeepSeek-compatible APIs usually do not need a new provider table:
594 # set `provider = "deepseek"` and override [providers.deepseek].base_url/model.
595 # For generic OpenAI-compatible gateways, use `provider = "openai"` and the
596 # [providers.openai] table below. Keep provider/api_key/base_url in user config
597 # or environment variables; project overlays are not allowed to set them.
598 #
599 # Provider is the route/account/endpoint; model is the ID on that route.
600 # Common DeepSeek routes:
601 # provider = "deepseek" model = "deepseek-v4-pro"
602 # provider = "nvidia-nim" model = "deepseek-ai/deepseek-v4-pro"
603 # provider = "openrouter" model = "deepseek/deepseek-v4-pro"
604 # provider = "fireworks" model = "accounts/fireworks/models/deepseek-v4-pro"
605 # provider = "siliconflow" model = "deepseek-ai/DeepSeek-V4-Pro"
606
607 # DeepSeek Platform (https://platform.deepseek.com)
608 [providers.deepseek]
609 api_key = "YOUR_DEEPSEEK_API_KEY" # must be non-empty; deepseek-cn reads it too
610 base_url = "https://api.deepseek.com/beta"
611 # base_url = "https://api.deepseek.com" # opt out of DeepSeek beta features
612 # model = "deepseek-v4-pro"
613 # Custom DeepSeek-compatible example:
614 # base_url = "https://your-provider.example/v1"
615 # model = "deepseek-ai/DeepSeek-V4-Pro"
616 # http_headers = { "X-Model-Provider-Id" = "your-model-provider" } # optional custom request headers
617 # path_suffix = "/chat/completions" # override the API path; skips /v1 versioning when set
618 # reasoning_stream_style = "inline_tags" # route <think>...</think> content into Thinking cells
619
620 # DeepSeek Anthropic-compatible Messages route (opt-in)
621 # [providers.deepseek_anthropic]
622 # api_key = "YOUR_DEEPSEEK_API_KEY"
623 # base_url = "https://api.deepseek.com/anthropic"
624 # model = "deepseek-v4-pro"
625 # [providers.deepseek.auth] # provider-scoped auth source metadata; command execution lands in a follow-up slice
626 # source = "command"
627 # command = ["secret-tool", "lookup", "service", "codewhale-deepseek"]
628 # timeout_ms = 2000
629 # insecure_skip_tls_verify = true # last resort for private gateways; prefer SSL_CERT_FILE
630
631 # NVIDIA NIM-hosted DeepSeek V4 (https://build.nvidia.com)
632 [providers.nvidia_nim]
633 # api_key = "YOUR_NVIDIA_API_KEY"
634 # base_url = "https://integrate.api.nvidia.com/v1"
635 # model = "deepseek-ai/deepseek-v4-pro" # or deepseek-ai/deepseek-v4-flash
636
637 # Generic OpenAI-compatible endpoint. Use the built-in `openai` provider for
638 # third-party gateways; do not invent a custom provider name. For non-local
639 # http:// gateways, launch with DEEPSEEK_ALLOW_INSECURE_HTTP=1 only on a
640 # trusted network.
641 [providers.openai]
642 # api_key = "YOUR_OPENAI_COMPATIBLE_API_KEY"
643 # base_url = "https://api.openai.com/v1"
644 # model = "gpt-4.1"
645 # Gateway example:
646 # base_url = "https://gateway.example/v1"
647 # model = "your-deepseek-compatible-model"
648 # Alibaba Bailian / Model Studio DashScope OpenAI-compatible example:
649 # base_url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
650 # model = "qwen-plus"
651 # context_window = 1000000 # set the gateway/model's real total context window
652 # insecure_skip_tls_verify = true # last resort for private gateways; prefer SSL_CERT_FILE
653
654 # AtlasCloud OpenAI-compatible endpoint (https://www.atlascloud.ai/docs/models/llm)
655 [providers.atlascloud]
656 # api_key = "YOUR_ATLASCLOUD_API_KEY"
657 # base_url = "https://api.atlascloud.ai/v1"
658 # model = "deepseek-ai/deepseek-v4-flash"
659
660 # Wanjie Ark / 万界方舟 OpenAI-compatible endpoint
661 [providers.wanjie_ark]
662 # api_key = "YOUR_WANJIE_API_KEY"
663 # base_url = "https://maas-openapi.wanjiedata.com/api/v1"
664 # model = "deepseek-reasoner" # or the exact model ID enabled on your Wanjie account
665
666 # Volcengine / Volcano Engine Ark Coding API
667 [providers.volcengine]
668 # api_key = "YOUR_VOLCENGINE_API_KEY"
669 # base_url = "https://ark.cn-beijing.volces.com/api/coding/v3"
670 # model = "DeepSeek-V4-Pro" # or DeepSeek-V4-Flash
671
672 # OpenRouter — multi-provider gateway (https://openrouter.ai)
673 [providers.openrouter]
674 # vendor = "deepinfra" # exact upstream slug; disables OpenRouter fallbacks
675 # api_key = "YOUR_OPENROUTER_API_KEY"
676 # base_url = "https://openrouter.ai/api/v1"
677 # model = "deepseek/deepseek-v4-pro"
678 # OpenRouter-compatible gateways can reuse this provider so reasoning/cache
679 # parsing stays on the OpenRouter-compatible path instead of generic OpenAI:
680 # base_url = "https://openrouter-compatible.example/v1"
681 # model = "deepseek/deepseek-v4-pro"
682 # Recent large model IDs also accepted here include arcee-ai/trinity-large-thinking,
683 # minimax/minimax-m3, minimax/minimax-m2.7, xiaomi/mimo-v2.5-pro, qwen/qwen3.6-flash,
684 # qwen/qwen3.6-35b-a3b, qwen/qwen3.6-max-preview, qwen/qwen3.6-27b, qwen/qwen3.6-plus,
685 # qwen/qwen3.7-max, google/gemma-4-31b-it, z-ai/glm-5.1, z-ai/glm-5.2,
686 # moonshotai/kimi-k2.6,
687 # nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free, and nvidia/nemotron-3-ultra.
688
689 # OrcaRouter — OpenAI-compatible aggregation gateway (https://www.orcarouter.ai)
690 [providers.orcarouter]
691 # api_key = "YOUR_ORCAROUTER_API_KEY"
692 # base_url = "https://api.orcarouter.ai/v1"
693 # model = "deepseek/deepseek-v4.1-flash-1017" # built-in default for this provider
694 # Namespaced wire models pass through verbatim (deepseek/deepseek-v4-pro,
695 # deepseek/deepseek-v4-flash); OrcaRouter's own auto-routing model is
696 # selectable as "orcarouter/auto".
697
698 # Xiaomi MiMo OpenAI-compatible endpoint (https://platform.xiaomimimo.com)
699 [providers.xiaomi_mimo]
700 # api_key = "YOUR_XIAOMI_KEY"
701 # base_url = "https://token-plan-sgp.xiaomimimo.com/v1" # Token Plan / tp- keys
702 # # base_url = "https://token-plan-ams.xiaomimimo.com/v1" # Token Plan Europe / Amsterdam
703 # # base_url = "https://api.xiaomimimo.com/v1" # Pay-as-you-go / sk- keys
704 # model = "mimo-v2.6-pro" # chat/reasoning
705 # Chat model IDs: mimo-v2.6-pro, mimo-v2.6-flash, mimo-v2.5-pro-ultraspeed
706 # Token Plan subscriptions use separate tp-* API keys plus api-key auth.
707 # mode = "token-plan-sgp" # default Token Plan endpoint
708 # mode = "token-plan-cn" # China cluster
709 # mode = "token-plan-ams" # Europe cluster
710 # mode = "pay-as-you-go" # standard API / sk- keys
711 # TTS aliases are also accepted by `codewhale speech`: tts, voice-design, voice-clone
712 # TTS model IDs: mimo-v2.5-tts, mimo-v2.5-tts-voicedesign, mimo-v2.5-tts-voiceclone, mimo-v2-tts
713
714 # Novita AI-hosted inference (https://novita.ai)
715 [providers.novita]
716 # api_key = "YOUR_NOVITA_API_KEY"
717 # base_url = "https://api.novita.ai/openai/v1"
718 # model = "deepseek/deepseek-v4-pro" # or deepseek/deepseek-v4-flash
719
720 # Fireworks AI-hosted DeepSeek V4 (https://fireworks.ai)
721 [providers.fireworks]
722 # api_key = "YOUR_FIREWORKS_API_KEY"
723 # base_url = "https://api.fireworks.ai/inference/v1"
724 # model = "accounts/fireworks/models/deepseek-v4-pro"
725
726 # SiliconFlow-hosted DeepSeek V4 (https://siliconflow.com)
727 [providers.siliconflow]
728 # api_key = "YOUR_SILICONFLOW_API_KEY"
729 # base_url = "https://api.siliconflow.com/v1"
730 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
731
732 # SiliconFlow China-hosted DeepSeek V4 (https://siliconflow.cn)
733 # Falls back to [providers.siliconflow] for api_key / base_url / model when unset.
734 [providers.siliconflow-CN]
735 # api_key = "YOUR_SILICONFLOW_API_KEY"
736 # base_url = "https://api.siliconflow.cn/v1"
737 # model = "deepseek-ai/DeepSeek-V4-Pro"
738
739 # Arcee AI direct OpenAI-compatible endpoint (https://docs.arcee.ai)
740 [providers.arcee]
741 # api_key = "YOUR_ARCEE_API_KEY"
742 # base_url = "https://api.arcee.ai/api/v1"
743 # model = "trinity-large-thinking" # or trinity-large-preview
744
745 # Moonshot/Kimi OpenAI-compatible endpoint (https://platform.kimi.ai)
746 [providers.moonshot]
747 # api_key = "YOUR_MOONSHOT_API_KEY" # or KIMI_API_KEY
748 # base_url = "https://api.moonshot.ai/v1" # or KIMI_BASE_URL
749 # model = "kimi-k3" # direct Moonshot K3 wire ID
750 # Direct K3 is always-thinking: off -> low, medium -> high, and max remains max.
751 # The exact route sends top-level reasoning_effort, max_completion_tokens, and
752 # omits temperature/top_p per https://platform.kimi.ai/docs/guide/kimi-k3-quickstart.
753 # Kimi Code membership path (key: https://www.kimi.com/code/console):
754 # api_key = "YOUR_KIMI_CODE_API_KEY"
755 # base_url = "https://api.kimi.com/coding/v1"
756 # model = "k3" # Kimi Code K3 wire ID
757 # K3 membership off -> enabled/low; dispatched auto selects a concrete tier.
758 # Only an omitted reasoning setting leaves the provider default in control.
759 # Moderato plans are capped at 262144; Allegretto and above unlock up to 1048576.
760 # context_window = 262144 # manually cap k3 to the Moderato/256K window
761 # context_window = 1048576 # Allegretto+ only; do not claim an unavailable entitlement
762 # Alternatively use model = "k3-256k" with context_window = 262144 for the fixed 256K route.
763 # Omit context_window to keep Codewhale's safe 262144-token bare-k3 baseline.
764 # `k3[1m]` is a Claude Code-only convention, not an API model ID; Codewhale rejects it.
765 # Kimi Code K2.7 remains available to all members as model = "kimi-for-coding".
766 # Kimi OAuth is not supported. Legacy auth_mode = "kimi_oauth" fails closed
767 # to the API-key guidance above without probing Kimi CLI credential files.
768
769 # Z.AI GLM Coding Plan endpoint (https://docs.z.ai)
770 [providers.zai]
771 # api_key = "YOUR_ZAI_API_KEY" # or Z_AI_API_KEY
772 # base_url = "https://api.z.ai/api/coding/paas/v4"
773 # # BigModel China Coding Plan endpoint:
774 # # base_url = "https://open.bigmodel.cn/api/coding/paas/v4"
775 # # General API endpoint, if you are not using the Coding Plan:
776 # # base_url = "https://api.z.ai/api/paas/v4"
777 # model = "GLM-5.3" # default; GLM-5.4 is the 1M multimodal Coding Plan flagship, GLM-5.3-Flash the fast sibling, GLM-5.2 the previous default, GLM-5.1 the smaller model, GLM-5-Turbo the 5.2 fast sibling
778 # # GLM-5.3 remains the default on the Z.ai Coding Plan (2026-08-13) and
779 # # carries no USD price. GLM-5.4 (2026-11) is selectable explicitly on the
780 # # Z.ai / BigModel Coding Plan for all tiers (`model = "GLM-5.4"`) with vision
781 # # input (image, video, PDF), 1M context, 128K (131072) maximum output, and no
782 # # USD price (pay-as-you-go Model API is not open yet). GLM-5.3-Flash
783 # # (2026-08-26) is the 1M multimodal fast sibling (`model = "GLM-5.3-Flash"`).
784 # # Explicit model selections keep their own id. Accounts not provisioned for
785 # # 5.3 can still see a 429 with entitlement code 1311.
786
787 # StepFun / StepFlash direct OpenAI-compatible endpoint (https://platform.stepfun.ai)
788 [providers.stepfun]
789 # api_key = "YOUR_STEPFUN_API_KEY" # or STEP_API_KEY
790 # base_url = "https://api.stepfun.ai/v1" # or STEP_BASE_URL
791 # # Coding Plan endpoint:
792 # # base_url = "https://api.stepfun.ai/step_plan/v1"
793 # model = "step-5" # or STEPFUN_MODEL / STEP_MODEL
794
795 # MiniMax direct OpenAI-compatible endpoint (https://platform.minimax.io)
796 [providers.minimax]
797 # api_key = "YOUR_MINIMAX_API_KEY"
798 # base_url = "https://api.minimax.io/v1"
799 # model = "MiniMax-M3" # or MiniMax-M2.7, MiniMax-M2.7-highspeed
800 # # MiniMax also publishes Anthropic-compatible endpoints:
801 # # global https://api.minimax.io/anthropic, China https://api.minimaxi.com/anthropic.
802
803 # Self-hosted SGLang OpenAI-compatible server
804 [providers.sglang]
805 # api_key = "OPTIONAL_SGLANG_TOKEN"
806 # base_url = "http://localhost:30000/v1"
807 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
808
809 # Self-hosted vLLM OpenAI-compatible server
810 [providers.vllm]
811 # api_key = "OPTIONAL_VLLM_TOKEN"
812 # base_url = "http://localhost:8000/v1"
813 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
814
815 # Self-hosted Ollama OpenAI-compatible server
816 [providers.ollama]
817 # api_key = "OPTIONAL_OLLAMA_TOKEN"
818 # base_url = "http://localhost:11434/v1"
819 # model = "deepseek-v4-flash" # or any local Ollama tag
820
821 # Hugging Face Inference Providers (https://huggingface.co/docs/api-inference)
822 # Provider aliases: huggingface, hugging-face, hugging_face, hf
823 # Env var aliases: HUGGINGFACE_API_KEY / HF_TOKEN, HUGGINGFACE_BASE_URL / HF_BASE_URL,
824 # HUGGINGFACE_MODEL / HF_MODEL
825 [providers.huggingface]
826 # api_key = "YOUR_HF_TOKEN"
827 # base_url = "https://router.huggingface.co/v1"
828 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
829
830 # DeepInfra — AI inference cloud (https://deepinfra.com)
831 [providers.deepinfra]
832 # api_key = "YOUR_DEEPINFRA_TOKEN"
833 # base_url = "https://api.deepinfra.com/v1/openai"
834 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
835
836 # ─────────────────────────────────────────────────────────────────────────────────
837 # Sakana AI Fugu Provider (https://api.sakana.ai)
838 # Provider aliases: sakana, sakana-ai, sakana_ai, fugu
839 # Env var aliases: FUGU_API_KEY, SAKANA_API_KEY
840 [providers.sakana]
841 # api_key = "YOUR_FUGU_API_KEY"
842 # base_url = "https://api.sakana.ai/v1"
843 # model = "fugu" # or fugu-ultra-20260615
844
845 # Meituan LongCat Provider (https://longcat.chat/platform)
846 # OpenAI-compatible curated gateway for Meituan's LongCat models.
847 # Provider aliases: longcat, long-cat, meituan-longcat, meituan
848 # Env var aliases: LONGCAT_API_KEY
849 [providers.longcat]
850 # api_key = "YOUR_LONGCAT_API_KEY"
851 # base_url = "https://api.longcat.chat/openai/v1"
852 # model = "LongCat-2.0"
853
854 # OpenCode Go (https://opencode.ai/docs/go/)
855 # Subscription-backed OpenAI-compatible Chat Completions route.
856 # Env vars: OPENCODE_GO_API_KEY, OPENCODE_GO_BASE_URL, OPENCODE_GO_MODEL
857 # Chat Completions models: deepseek-v4-pro, grok-4.5, glm-5.2, glm-5.1,
858 # kimi-k3, kimi-k2.7-code, kimi-k2.6, deepseek-v4-flash, mimo-v2.5,
859 # mimo-v2.5-pro.
860 # Models documented only on OpenCode Go's Anthropic `/messages` endpoint are
861 # intentionally not advertised by this provider yet.
862 [providers.opencode_go]
863 # api_key = "YOUR_OPENCODE_GO_API_KEY"
864 # base_url = "https://opencode.ai/zen/go/v1"
865 # model = "deepseek-v4-pro"
866
867 # OpenCode Zen (https://opencode.ai/docs/zen/)
868 # Model-aware gateway: GPT/Muse Spark use Responses, Claude/Qwen use Anthropic
869 # Messages, Gemini uses native Generate Content, and DeepSeek/MiniMax/GLM/Kimi/Grok/free
870 # models use Chat Completions.
871 # Env vars: OPENCODE_ZEN_API_KEY (preferred), OPENCODE_API_KEY,
872 # OPENCODE_ZEN_BASE_URL, OPENCODE_ZEN_MODEL
873 [providers.opencode_zen]
874 # api_key = "YOUR_OPENCODE_ZEN_API_KEY"
875 # base_url = "https://opencode.ai/zen/v1"
876 # model = "gpt-5.5" # Responses
877 # model = "muse-spark-1.2-contributor-free" # Responses (free tier, auto-routed to Responses — no wire needed)
878 # model = "claude-sonnet-4-6" # Anthropic Messages example
879 # model = "deepseek-v4-pro" # Chat Completions example
880 # Custom gateway equivalent (when not using the opencode_zen provider):
881 # [providers.my_opencode]
882 # kind = "openai-compatible"
883 # base_url = "https://opencode.ai/zen/v1"
884 # model = "muse-spark-1.2-contributor-free"
885 # wire = "responses"
886 # api_key_env = "OPENCODE_ZEN_API_KEY"
887
888 # Meta Model API / Muse Spark (https://developer.meta.com/ai/)
889 # OpenAI-compatible Chat Completions route.
890 # Provider aliases: meta, meta-ai, meta-model-api, muse, muse-spark
891 # Env var aliases: META_MODEL_API_KEY / MODEL_API_KEY,
892 # META_MODEL_API_BASE_URL / MODEL_API_BASE_URL,
893 # META_MODEL_API_MODEL / MODEL_API_MODEL
894 [providers.meta]
895 # api_key = "YOUR_META_MODEL_API_KEY"
896 # base_url = "https://api.meta.ai/v1"
897 # model = "muse-spark-1.1"
898
899 # xAI / Grok Provider (https://console.x.ai/)
900 # OpenAI-compatible Chat Completions route.
901 # Provider aliases: xai, x-ai, x_ai, grok
902 # Env var aliases: XAI_API_KEY, XAI_BASE_URL, XAI_MODEL
903 #
904 # Auth modes:
905 # api_key (default) — console.x.ai pay-per-use key via api_key / XAI_API_KEY / keyring
906 # oauth — `codewhale auth xai-device` uses Codewhale-owned storage.
907 # Reading an existing Grok CLI file requires explicit
908 # `codewhale auth external-consent --provider xai --mode read-only`.
909 [providers.xai]
910 # api_key = "YOUR_XAI_API_KEY"
911 # auth_mode = "oauth" # or "device_code" / "grok_cli"
912 # base_url = "https://api.x.ai/v1"
913 # model = "grok-4.7" # or grok-4.6, grok-4.5, grok-4.3, grok-build
914
915 # Mistral AI — la Plateforme (https://console.mistral.ai/)
916 # OpenAI-compatible Chat Completions route.
917 # Provider aliases: mistral, mistral-ai, mistralai, la-plateforme
918 # Env var aliases: MISTRAL_API_KEY, MISTRAL_BASE_URL, MISTRAL_MODEL
919 # Vibe Code subscription setup: docs/MISTRAL_VIBE.md
920 [providers.mistral]
921 # api_key = "YOUR_MISTRAL_API_KEY"
922 # base_url = "https://api.mistral.ai/v1"
923 # model = "mistral-code-latest" # or mistral-medium-latest, mistral-small-latest, mistral-large-latest
924
925 # Google Gemini — Google AI Studio (https://aistudio.google.com/apikey)
926 # Native Gemini Generate Content route (`:streamGenerateContent?alt=sse`) on
927 # the official Generative Language endpoint (see docs/PROVIDERS.md).
928 # Provider aliases: google, gemini, google-gemini, ai-studio
929 # Env var aliases: GEMINI_API_KEY, GOOGLE_API_KEY, GEMINI_BASE_URL, GOOGLE_BASE_URL
930 [providers.google]
931 # api_key = "YOUR_GEMINI_API_KEY"
932 # base_url = "https://generativelanguage.googleapis.com/v1beta"
933 # model = "gemini-3.1-pro-preview"
934
935 # ─────────────────────────────────────────────────────────────────────────────────
936 # Alibaba Cloud Model Studio — Token Plan
937 # (https://bailian.console.aliyun.com/)
938 #
939 # Token Plan Personal and Team share the same AP-Southeast (Singapore) endpoint.
940 # Available text/coding models: qwen3.8-max, qwen4-max-preview, qwen3.7-plus,
941 # qwen3.7-max, qwen3.6-flash, deepseek-v4-pro, deepseek-v4-flash-0731, glm-5.2
942 #
943 # Provider aliases: modelstudio-token-plan, modelstudio_token_plan,
944 # alibaba-token-plan, dashscope-token-plan
945 # Env var aliases: MODELSTUDIO_API_KEY (preferred), DASHSCOPE_API_KEY,
946 # MODELSTUDIO_TOKEN_PLAN_BASE_URL, MODELSTUDIO_TOKEN_PLAN_MODEL
947 [providers.modelstudio_token_plan]
948 # api_key = "YOUR_MODELSTUDIO_API_KEY"
949 # base_url = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1"
950 # model = "qwen3.8-max"
951 # # Anthropic-compatible dialect (same key, /apps/anthropic path):
952 # # provider = "modelstudio-token-plan-anthropic"
953 # # base_url = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic"
954
955 # ─────────────────────────────────────────────────────────────────────────────────
956 # Alibaba Cloud Model Studio — Coding Plan
957 # (https://bailian.console.aliyun.com/)
958 #
959 # Coding Plan uses a separate international endpoint (coding-intl.dashscope).
960 # Same model ids as the Token Plan except qwen4-max-preview, which is
961 # Token Plan only.
962 #
963 # Provider aliases: modelstudio-coding-plan, modelstudio_coding_plan,
964 # alibaba-coding-plan, dashscope-coding-plan
965 # Env var aliases: MODELSTUDIO_API_KEY (preferred), DASHSCOPE_API_KEY,
966 # MODELSTUDIO_CODING_PLAN_BASE_URL, MODELSTUDIO_CODING_PLAN_MODEL
967 [providers.modelstudio_coding_plan]
968 # api_key = "YOUR_MODELSTUDIO_API_KEY"
969 # base_url = "https://coding-intl.dashscope.aliyuncs.com/v1"
970 # model = "qwen3.8-max"
971 # # Anthropic-compatible dialect (same key, /apps/anthropic path):
972 # # provider = "modelstudio-coding-plan-anthropic"
973 # # base_url = "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic"
974
975 # ─────────────────────────────────────────────────────────────────────────────────
976 # Together AI Provider (https://www.together.ai/)
977 # Env var aliases: TOGETHER_API_KEY, TOGETHER_BASE_URL, TOGETHER_MODEL
978 [providers.together]
979 # api_key = "YOUR_TOGETHER_API_KEY"
980 # base_url = "https://api.together.xyz/v1"
981 # model = "deepseek-ai/DeepSeek-V4-Pro" # or deepseek-ai/DeepSeek-V4-Flash
982
983 # ─────────────────────────────────────────────────────────────────────────────────
984 # Baidu Qianfan Provider (https://intl.cloud.baidu.com/product/qianfan.html)
985 # Provider aliases: qianfan, baidu-qianfan, baidu_qianfan, baidu
986 # Env var aliases: QIANFAN_API_KEY / BAIDU_QIANFAN_API_KEY,
987 # QIANFAN_BASE_URL / BAIDU_QIANFAN_BASE_URL,
988 # QIANFAN_MODEL / BAIDU_QIANFAN_MODEL
989 [providers.qianfan]
990 # api_key = "YOUR_QIANFAN_API_KEY"
991 # base_url = "https://api.baiduqianfan.ai/v1"
992 # model = "ernie-4.0-turbo-8k" # or your Qianfan service/model id
993
994 # ─────────────────────────────────────────────────────────────────────────────────
995 # OpenAI Codex (ChatGPT) Provider — EXPERIMENTAL
996 # Run `codex login`, then explicitly grant read-only access to that exact file:
997 # codewhale auth external-consent --provider openai-codex --mode read-only
998 # Codewhale never refreshes or rewrites the Codex CLI file. No API key is
999 # stored here. Talks to the OpenAI Responses API at /codex/responses.
1000 # Env var aliases: OPENAI_CODEX_ACCESS_TOKEN / CODEX_ACCESS_TOKEN (token override),
1001 # OPENAI_CODEX_BASE_URL / CODEX_BASE_URL, OPENAI_CODEX_MODEL / CODEX_MODEL,
1002 # OPENAI_CODEX_ACCOUNT_ID / CODEX_ACCOUNT_ID, OPENAI_CODEX_AUTH_FILE, CODEX_HOME
1003 [providers.openai_codex]
1004 # base_url = "https://chatgpt.com/backend-api"
1005 # model = "gpt-6.1-sol"
1006 # The CLI writes this table after informed consent; do not copy it between
1007 # providers or machines. Absence means disabled.
1008 # [providers.openai_codex.external_credentials]
1009 # access = "read_only"
1010 # provider = "openai-codex"
1011 # source = "codex_cli"
1012 # path = "/absolute/path/to/.codex/auth.json"
1013 # consent_version = 1
1014
1015 # ─────────────────────────────────────────────────────────────────────────────────
1016 # Anthropic Provider (native Messages API)
1017 # Talks to https://api.anthropic.com/v1/messages with x-api-key auth — not an
1018 # OpenAI-compatible route. Models: claude-opus-5-5, claude-sonnet-5-5 (default),
1019 # claude-haiku-5-5. Env vars: ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL,
1020 # ANTHROPIC_MODEL.
1021 [providers.anthropic]
1022 # api_key = "sk-ant-..."
1023 # base_url = "https://api.anthropic.com"
1024 # model = "claude-sonnet-5-5"
1025
1026 # OpenModel Provider (Anthropic-compatible Messages API)
1027 # Talks to https://api.openmodel.ai/v1/messages with Bearer auth. OpenModel
1028 # routes DeepSeek, DashScope, Xiaomi, Claude, and other models by model id.
1029 # Env vars: OPENMODEL_API_KEY, OPENMODEL_BASE_URL, OPENMODEL_MODEL.
1030 [providers.openmodel]
1031 # api_key = "om-..."
1032 # base_url = "https://api.openmodel.ai"
1033 # model = "deepseek-v4-flash"
1034
1035 # Codewhale API (https://app.codewhale.net/settings?section=api)
1036 # Account-backed model access over the provider keys connected to the
1037 # customer's Codewhale account. The account's authenticated `GET /v1/models`
1038 # listing is the catalog authority: each `provider/model` row states its wire
1039 # (`chat-completions` → `/v1/chat/completions`, `anthropic-messages` →
1040 # `/v1/messages`, `responses` → `/v1/responses`). Every protocol authenticates
1041 # the account key with `Authorization: Bearer`, never `x-api-key`.
1042 # Provider aliases: codewhale-api, cw-api, codewhale-cloud
1043 # Env vars: CODEWHALE_API_KEY, CODEWHALE_API_BASE (HTTPS except loopback);
1044 # the generic CODEWHALE_MODEL override also applies.
1045 [providers.codewhale]
1046 # api_key = "cwc_key_..." # or `codewhale account api-keys create --name <name> --use`
1047 # base_url = "https://api.codewhale.net/v1"
1048 # model = "deepseek/deepseek-v4-pro" # provider/model exactly as the account catalog returns it
1049
1050 # ─────────────────────────────────────────────────────────────────────────────────
1051 # Web Search Provider
1052 # ─────────────────────────────────────────────────────────────────────────────────
1053 # Choose which backend the Web tool's search uses. Default is keyless Firecrawl
1054 # (bounded per-IP quota; `[search] api_key` or FIRECRAWL_API_KEY raises it).
1055 # Bing and DuckDuckGo HTML scraping need no API key. Tavily, Bocha, Metaso,
1056 # Baidu, Volcengine, Sofya, Serply, DeepSeek and SearchApi need an api_key;
1057 # SearXNG needs base_url.
1058 # API runtime failures and empty responses visibly degrade through DuckDuckGo
1059 # then Bing. Missing configuration and network-policy denials fail closed.
1060 #
1061 # [search]
1062 # provider = "firecrawl" # firecrawl | bing | duckduckgo | tavily | bocha | metaso | searxng | baidu | volcengine | sofya | serply | deepseek | searchapi
1063 # # firecrawl: Firecrawl Cloud search, keyless with a bounded per-IP quota
1064 # # duckduckgo: HTML scrape with Bing fallback
1065 # # bing: HTML scrape, no API key
1066 # # tavily: https://tavily.com — AI search, needs api_key
1067 # # TAVILY_API_KEY set + provider unset auto-selects tavily
1068 # # at runtime; it is never written to config.toml
1069 # # bocha: https://bochaai.com — 博查AI搜索,国内友好,需api_key
1070 # # metaso: https://metaso.cn — 秘塔AI搜索,需 api_key
1071 # # 设置 METASO_API_KEY 或 [search] api_key
1072 # # searxng: https://docs.searxng.org — trusted/self-hosted JSON API,
1073 # # set base_url; no public instance is used by default
1074 # # instance must enable JSON (settings.yml search.formats); HTML-only instances 403
1075 # # baidu: 百度 AI Search via qianfan.baidubce.com,需 api_key
1076 # # volcengine: 火山引擎 Ark web_search (免费 2 万次/月), 需 api_key
1077 # # 也回退到 VOLCENGINE_API_KEY / VOLCENGINE_ARK_API_KEY / ARK_API_KEY 环境变量
1078 # # sofya: https://sofya.co — AI search returning full page
1079 # # content (not snippets), needs api_key (ay_live_...);
1080 # # also falls back to the SOFYA_API_KEY env var
1081 # # serply: https://serply.io Google organic results with
1082 # # snippets, needs api_key;
1083 # # also falls back to the SERPLY_API_KEY env var
1084 # # deepseek: https://api-docs.deepseek.com/guides/search —
1085 # # api.deepseek.com/v1/tools/search, needs api_key;
1086 # # also falls back to the DEEPSEEK_API_KEY env var
1087 # # (the saved model-provider key is not reused)
1088 # # searchapi: https://www.searchapi.io — Google organic results
1089 # # (engine=google) with snippets, needs api_key;
1090 # # also falls back to the SEARCHAPI_API_KEY env var
1091 # base_url = "https://search.example/" # optional DuckDuckGo-compatible HTML endpoint;
1092 # # required SearXNG root or /search endpoint
1093 # api_key = "YOUR_SEARCH_KEY" # required for tavily, bocha, metaso, baidu, volcengine, sofya, serply, deepseek and searchapi; optional for firecrawl (raises the keyless quota); unused by searxng
1094 # # WARNING: treat config.toml like a secret file when
1095 # # storing API keys. Prefer env vars for local smoke tests.
1096 #
1097 # Env-var overrides:
1098 # CODEWHALE_SEARCH_PROVIDER → search.provider
1099 # DEEPSEEK_SEARCH_PROVIDER → search.provider (legacy alias)
1100 # CODEWHALE_SEARCH_API_KEY → search.api_key
1101 # DEEPSEEK_SEARCH_API_KEY → search.api_key (legacy alias)
1102 # CODEWHALE_SEARCH_BASE_URL → search.base_url
1103 # DEEPSEEK_SEARCH_BASE_URL → search.base_url (legacy alias)
1104 # FIRECRAWL_API_KEY → firecrawl key fallback
1105 # METASO_API_KEY → metaso key fallback
1106 # BAIDU_SEARCH_API_KEY → baidu key fallback
1107 # VOLCENGINE_API_KEY / VOLCENGINE_ARK_API_KEY / ARK_API_KEY → volcengine key fallback
1108 # SOFYA_API_KEY → sofya key fallback
1109 # SERPLY_API_KEY → serply key fallback
1110 # SEARCHAPI_API_KEY → searchapi key fallback
1111 # TAVILY_API_KEY → tavily autodetect when provider is unset (explicit
1112 # provider = "..." or CODEWHALE_SEARCH_PROVIDER still
1113 # wins; the autodetect is never persisted)
1114
1115 # ─────────────────────────────────────────────────────────────────────────────────
1116 # Network Policy (#135)
1117 # ─────────────────────────────────────────────────────────────────────────────────
1118 # Per-domain allow/deny rules for outbound network calls made by the TUI's
1119 # tools (`fetch_url`, `web_search`) and the MCP HTTP transport. Stdio MCP
1120 # servers and direct LLM API calls are unaffected.
1121 #
1122 # Precedence: deny wins. A host listed in both `allow` and `deny` is denied.
1123 #
1124 # Host-matching rules:
1125 # - Exact match: `api.deepseek.com` matches only `api.deepseek.com`.
1126 # - Subdomain wildcard: an entry starting with `.` (e.g. `.example.com`)
1127 # matches `api.example.com` and `a.b.example.com` but not the apex
1128 # `example.com`. To cover both, list both. `*.example.com` is also accepted.
1129 #
1130 # Defaults are intentionally conservative: when this section is absent, no
1131 # policy is enforced (mirrors pre-v0.7.0 behavior). To opt in:
1132 #
1133 # [network]
1134 # default = "prompt" # allow | deny | prompt
1135 # allow = ["api.deepseek.com", "github.com", ".githubusercontent.com"]
1136 # deny = []
1137 # proxy = ["github.com", ".githubusercontent.com"]
1138 # proxy_fake_ip_cidrs = ["198.18.0.0/15"] # requires both matching host and address
1139 # audit = true # one line per call to ~/.codewhale/audit.log
1140
1141 # ─────────────────────────────────────────────────────────────────────────────────
1142 # Verifier preview (#2093)
1143 # ─────────────────────────────────────────────────────────────────────────────────
1144 # Enables automatic claim-of-done verifier preview once the runtime trigger is
1145 # active. Manual `run_verifiers` remains available even when this is false.
1146 #
1147 # [verifier]
1148 # enabled = false
1149
1150 # ─────────────────────────────────────────────────────────────────────────────────
1151 # Advisor / Watcher (#3982)
1152 # ─────────────────────────────────────────────────────────────────────────────────
1153 # Optional background watcher that fires after each turn that contains tool
1154 # calls. It reads a bounded slice of recent tool interactions, makes a concise
1155 # LLM advisory call, and emits a brief note into the status area.
1156 #
1157 # Off by default. Enable with `[advisor] enabled = true` or toggle per-session
1158 # with `/advisor on` / `/advisor off`.
1159 #
1160 # Options (the full set — `AdvisorConfigToml` in crates/config/src/lib.rs):
1161 # enabled — master switch (default: false)
1162 # max_tool_calls — number of recent tool call/result pairs to read
1163 # (default: 10, clamped to 1–50)
1164 # rate_limit_secs — minimum seconds between successive advisor notes
1165 # (default: 60, clamped to 5–3600)
1166 # dedup_window_secs — notes whose content hash matches the previous note
1167 # within this window are dropped (default: 300)
1168 # model — model override for the advisory call; when absent the
1169 # advisor reuses the session's current model
1170 #
1171 # Unknown keys under [advisor] are silently ignored, not rejected — a typo
1172 # leaves the default in place with no error.
1173 #
1174 # [advisor]
1175 # enabled = false
1176 # max_tool_calls = 10
1177 # rate_limit_secs = 60
1178 # dedup_window_secs = 300
1179 # model = "deepseek-v4-flash"
1180
1181 # ─────────────────────────────────────────────────────────────────────────────────
1182 # Skills (#140)
1183 # ─────────────────────────────────────────────────────────────────────────────────
1184 # Settings for the `/skill install <spec>` community-skill installer.
1185 # * registry_url — curated index.json that resolves bare names to
1186 # `github:owner/repo` specs. Override to point at
1187 # a private fork or internal mirror.
1188 # * max_install_size_bytes — per-skill uncompressed size cap. Tarballs that
1189 # exceed this limit are rejected during validation.
1190 # Default: 5 MiB.
1191 #
1192 # `/skill install` is gated by `[network]`. Make sure `github.com` and
1193 # `raw.githubusercontent.com` are reachable (default `prompt` is fine — you'll
1194 # be asked once and can persist) before running it.
1195 #
1196 # [skills]
1197 # registry_url = "https://raw.githubusercontent.com/Hmbown/deepseek-skills/main/index.json"
1198 # max_install_size_bytes = 5_242_880
1199 # scan_codewhale_only = false # true: ignore Claude/OpenCode/Cursor/agentskills.io skill dirs
1200 # flat_workspace_root = false # true: opt in to trusted <workspace>/skills content
1201 # always_load = [] # skill names to preload in full at session start (64 KiB/skill, 128 KiB total)
1202
1203 # Model-stream budgets and HTTP transport. `config dump` shows effective values.
1204 # Legacy [tui] stream_* keys remain fallbacks when a canonical field is absent.
1205 [stream]
1206 open_timeout_secs = 180 # response headers, including connect (0 = env/default, 5-600)
1207 open_retries = 1 # re-sends after no response headers arrived in time (0 = off, 0-3)
1208 chunk_timeout_secs = 900 # per-SSE-chunk idle bound (0 = default, 1-3600)
1209 max_resumes = 3 # proven pre-dispatch connection recovery (0 = off, 0-10)
1210 max_transparent_retries = 2 # compatibility value; interrupted streams never reissue
1211 max_stream_errors = 5 # compatibility value; uncertain stream errors end the stream
1212 max_duration_secs = 1800 # one stream, not the whole turn (0 = default, 10-86400)
1213 max_content_mb = 10 # one stream's content (0 = default, 1-512)
1214 connect_timeout_secs = 30 # TCP/TLS setup (0 = default, 1-300)
1215 force_http1 = false # a truthy CODEWHALE_FORCE_HTTP1 still pins HTTP/1.1
1216 # Keepalive settings apply to newly built model/catalog/fallback clients.
1217 tcp_keepalive_secs = 30 # idle TCP probes (0 = off, 1-3600)
1218 http2_keep_alive_interval_secs = 15 # active HTTP/2 PINGs (0 = off, 1-3600)
1219 http2_keep_alive_timeout_secs = 20 # PING ACK deadline (0 = default, 1-3600)
1220
1221 # ─────────────────────────────────────────────────────────────────────────────────
1222 # TUI
1223 # ─────────────────────────────────────────────────────────────────────────────────
1224 [tui]
1225 mouse_capture = true # true: TUI-owned mouse selection (payload set by selection_copy_markdown); false: raw terminal selection/copy
1226 selection_copy_markdown = true # true: copy transcript drag selections as Markdown source; false: rendered text
1227 # Model steps are uncapped by default. Uncomment to install an explicit
1228 # ceiling; omission or 0 means no step limit, positive values clamp to 1-100000.
1229 # max_model_steps = 1000
1230 # A turn has no wall-clock limit unless you set one; omission or 0 means none.
1231 # turn_wall_clock_secs = 7200 # cumulative wall clock for one turn, excluding
1232 # time blocked on a human approval (30-86400)
1233 osc8_links = true # emit OSC 8 escapes around URLs (Cmd+click in iTerm2/Ghostty/Kitty/WezTerm/Terminal.app 13+); set false for terminals that misrender
1234 # What the bottom chrome shows. Each key is one thing on screen: `mode` is the
1235 # posture bar's plan/act/operate chip, everything else is a segment of the
1236 # metrics line under it. Omit the key to use the built-in default; set [] to
1237 # strip the metrics line down to the help hint. You can also edit this
1238 # interactively with `/statusline`.
1239 # Supported keys: mode, model, context_percent, cost,
1240 # balance (prepaid providers only: DeepSeek, DeepSeekCN, OpenRouter,
1241 # SiliconFlow), cache, tokens, ttft, output_rate, workspace, git_branch.
1242 # Legacy session_metrics enables both ttft and output_rate.
1243 # Retired in 0.9.13: status, agents, reasoning_replay, prefix_stability,
1244 # last_tool_elapsed, rate_limit — they drove nothing. Old files
1245 # keep loading; the retired keys are ignored.
1246 # status_items = ["mode", "model", "context_percent", "cost", "tokens"]
1247 # Size presets for the two rows themselves (#5950) — composition stays in
1248 # status_items; these only decide how much of a row paints:
1249 # posture_bar = "full" # full | compact | hidden (default full)
1250 # # compact keeps the posture chips (and the cap
1251 # # warning) and drops the clocks, counts and hint;
1252 # # hidden gives the row to the transcript.
1253 # metrics_line = "compact" # full | compact | hidden (default compact)
1254 # # compact keeps the route, context reading, cost
1255 # # and balance plus selected TTFT/rate when they fit.
1256 # # It drops secondary counts and help; hidden gives the row to the transcript.
1257 # # Also settable at runtime: /config posture_bar compact
1258 # notification_condition = "unfocused" # unfocused | always | never
1259 # "unfocused" = notify only after this terminal has been
1260 # in the background for two seconds (default);
1261 # "always" = allow configured notifications while focused;
1262 # successful turns skip the threshold;
1263 # "never" = suppress all operator notifications.
1264 # locale = "auto" # UI chrome language: auto | en | ja | zh-Hans | zh-Hant | pt-BR | es-419
1265 # # | vi | ko | ca | de | fr | id | hi | ru | uk
1266 # # "auto" reads LC_ALL → LC_MESSAGES → LANG; falls back to English.
1267 # # Override: `locale = "zh-Hans"` for Simplified Chinese regardless of OS locale.
1268 # # Also settable at runtime: /config locale zh-Hans
1269 # # Note: this only affects TUI labels/chrome — it does NOT change model output language.
1270 # mention_menu_behavior = "fuzzy" # fuzzy | browser; browser lists immediate directory children for @-mentions.
1271
1272 # ─────────────────────────────────────────────────────────────────────────────────
1273 # Transcript
1274 # ─────────────────────────────────────────────────────────────────────────────────
1275 # Prose — user messages, assistant answers, and reasoning/thinking — fills the
1276 # full content width, consistent with tool/status cells and the wide-frame
1277 # decision in #5322 (#5436). Owners who want a bounded reading measure on
1278 # ultrawide terminals can cap it in columns.
1279 [transcript]
1280 # prose_measure = 120 # positive integer: cap prose wrap at N columns.
1281 # 0 or absent = full content width (default).
1282 # Must be a positive whole number; tool, diff, and
1283 # status cells always keep the full content width.
1284
1285 # ─────────────────────────────────────────────────────────────────────────────────
1286 # Feature Flags
1287 # ─────────────────────────────────────────────────────────────────────────────────
1288 [features]
1289 shell_tool = true
1290 subagents = true
1291 web_search = true # enables canonical web.run plus the compatibility web_search alias
1292 apply_patch = true
1293 mcp = true
1294 exec_policy = true
1295 code_mode = true # execute_tools composes MCP/plugin/native calls; false defers it and offers tool_search
1296 # vision_model = false # enable vision model for image_analyze tool
1297 # plugin_creator = true # Beta, on by default. Enable the built-in `plugin_manager`
1298 # tool and Creator mode host module independently of
1299 # `extension_host` when Node.js or Bun is available.
1300 # Set false to disable the built-in Creator host module.
1301 # extension_host = false # EXPERIMENTAL. Run reviewed plugins' `native` host code
1302 # (TypeScript/JavaScript, Cordis/DSH plugin model) in a
1303 # separate Node.js (or, opt-in, Bun) process. Tools and
1304 # slash commands in this phase. Every
1305 # plugin tool is always Required and never
1306 # read-only; like any Required tool it runs without
1307 # a prompt under Full Access, under Bypass, or with a
1308 # matching session grant, which is bound to the
1309 # plugin's reviewed build (an update asks again).
1310 # Native code requires a verified OS sandbox: Seatbelt
1311 # on macOS, bubblewrap on Linux, and LPAC/Job on Windows.
1312 # An unavailable Native sandbox refuses activation.
1313 # Unix reads are limited to the selected runtime and
1314 # libraries, canonical host bundle, captured Core-managed
1315 # plugin stores and Native data. Writes stay in Native
1316 # data and private scratch; repository reads and direct
1317 # network are denied. Native plugins share one trusted
1318 # cohort, not separate per-plugin OS sandboxes.
1319 # On macOS a detached child can outlive process-group
1320 # cancellation while retaining the sandbox restrictions.
1321 # Builtin host policy is separate and diagnosed separately.
1322 # Toggling this changes the plugin activation policy,
1323 # so every plugin must be re-reviewed afterwards.
1324
1325 # [extension_host]
1326 # runtime = "node" # "node" (default), "bun" or "auto". Bun is an
1327 # # opt-in, qualified on macOS only. "auto" uses
1328 # # Bun >= 1.4.0 when one is found and starts,
1329 # # else Node. "bun"/"node" never fall back.
1330 # # Unset with only `bun` set: "bun".
1331 # bun = "~/.bun/bin/bun" # Bun >= 1.4.0. When set, the only Bun tried; a
1332 # # broken one fails instead of searching PATH and
1333 # # $BUN_INSTALL/bin or ~/.bun/bin.
1334 # node = "/usr/local/bin/node" # Node.js ^22.19 || >=24. When set, the only Node
1335 # # tried. Unset, every `node` on PATH is tried in
1336 # # order, skipping any inside node_modules or the
1337 # # working directory.
1338
1339 # Per-plugin settings for the plugin host, keyed by the plugin's manifest
1340 # name. The table is delivered to the plugin's `apply(ctx, config)` and checked
1341 # against the plugin's own `Config` schema, if it declares one. User config
1342 # only: a project's .codewhale/config.toml cannot set it. Read at start and at
1343 # `/plugin reload`, which re-activates a plugin whose table changed. At most
1344 # 16 KiB of plain TOML values; `/plugin show <name>` lists the keys, not the
1345 # values. Do not store secrets here: the plugin's code reads every value.
1346 #
1347 # [plugins."hello-extension".config]
1348 # greeting = "Howdy"
1349
1350 # ─────────────────────────────────────────────────────────────────────────────────
1351 # Vision Model Configuration (optional)
1352 # ─────────────────────────────────────────────────────────────────────────────────
1353 # Uses an OpenAI-compatible vision model API for the `image_analyze` tool.
1354 # api_key inherits from the main config if not specified.
1355 #
1356 # [vision_model]
1357 # model = "gemini-3.1-flash-lite-preview" # Required: vision-capable model ID
1358 # api_key = "YOUR_API_KEY" # Optional: defaults to main api_key
1359 # base_url = "https://generativelanguage.googleapis.com/v1beta/openai/" # Optional
1360 #
1361 # Xiaomi MiMo image understanding can be configured through the same tool:
1362 # model = "mimo-v2.6-flash"
1363 # api_key = "YOUR_XIAOMI_KEY"
1364 # base_url = "https://token-plan-sgp.xiaomimimo.com/v1" # Token Plan / tp- keys
1365
1366 # ─────────────────────────────────────────────────────────────────────────────────
1367 # Retry Configuration
1368 # ─────────────────────────────────────────────────────────────────────────────────
1369 [retry]
1370 enabled = true
1371 max_retries = 3
1372 initial_delay = 1.0
1373 max_delay = 60.0
1374 exponential_base = 2.0
1375 # jitter = true # randomize each backoff delay
1376 # jitter_factor = 0.1 # ±10% spread (0.0-1.0)
1377 # respect_retry_after = true # honor a server Retry-After header
1378
1379 # ─────────────────────────────────────────────────────────────────────────────────
1380 # Goal loop (`[goal]`) — operate-mode persistent goals
1381 # ─────────────────────────────────────────────────────────────────────────────────
1382 # Operate-mode goals run to their completion gate with no default token, time,
1383 # or continuation ceiling. A token budget, when supplied, is telemetry unless
1384 # `[goal] enforce_token_budget` is set. The keys below are the opt-in circuit
1385 # breakers.
1386 # [goal]
1387 # Optional safety backstop on automatic goal continuation passes.
1388 # Default: 0 (unlimited). Set a positive value to opt into a ceiling.
1389 # max_continuations = 100
1390 # Optional cancellable quiet period between successful turns, useful for
1391 # coordinator goals that poll on a cadence instead of keeping one provider
1392 # turn open. Default: 0 (continue immediately). Cap: 86400 (24h).
1393 # continuation_delay_seconds = 300
1394 # Per-turn step allowance while a goal is active (#5994): larger but still
1395 # finite. Default: 1000 (0/absent resolves to 1000). Range: 1..=100,000.
1396 # Bounds each turn, never the number of continuation passes; explicit
1397 # per-invocation ceilings (exec --max-turns, worker caps) always win.
1398 # max_steps = 1000
1399
1400 # ─────────────────────────────────────────────────────────────────────────────────
1401 # Context Compaction
1402 # ─────────────────────────────────────────────────────────────────────────────────
1403 # Auto-compaction is a saved UI setting edited with `/config` (`auto_compact`).
1404 # The optional saved threshold setting is `auto_compact_threshold_percent`
1405 # (default 80). There is no config-file
1406 # `[compaction]` table yet; runtime compaction budgets are chosen by the TUI
1407 # from the active model/context window.
1408
1409 # [context] supports one key, `project_pack` (default false, #4781). The
1410 # removed seam-manager keys (enabled, verbatim_window_turns, l1/l2/l3_threshold,
1411 # seam_model) are ignored if an older config still carries them.
1412
1413 # ─────────────────────────────────────────────────────────────────────────────────
1414 # Workshop / Tool-Output Budgets
1415 # ─────────────────────────────────────────────────────────────────────────────────
1416 # By default an oversized tool result uses bounded spillover: a result under the
1417 # byte threshold stays inline, a larger one gets a head/tail preview plus a
1418 # session artifact the model can read back. There is no synthesis sub-agent and
1419 # no per-call `raw = true` escape.
1420 #
1421 # `large_output_threshold_tokens` and `[workshop.per_tool_thresholds]` only take
1422 # effect when the process opts in to adaptive evidence routing with
1423 # `CODEWHALE_ADAPTIVE_OUTPUT_ROUTING=1`; they set where a result stops being
1424 # inline and becomes handle-only evidence. Per-tool keys are exact tool names as
1425 # the model sees them (`bash`, `fetch_url`, ...). The two byte ceilings below
1426 # apply either way.
1427 #
1428 # [workshop]
1429 # large_output_threshold_tokens = 4096
1430 # # Optional model-visible byte ceilings (#5367). Absent keeps the
1431 # # compile-time defaults (read 50KiB / read_file 16KiB, then the
1432 # # compact 12K-char floor). Values raise the floor; they never lower
1433 # # it. Hard cap is 2MiB.
1434 # # read_result_max_bytes = 102400
1435 # # tool_result_max_bytes = 102400
1436 # [workshop.per_tool_thresholds] # adaptive routing only
1437 # bash = 2048 # shell output becomes handle-only evidence sooner
1438 # fetch_url = 8192 # web pages can be large; give them more room
1439
1440 # ─────────────────────────────────────────────────────────────────────────────────
1441 # Profile Example (for multiple environments)
1442 # ─────────────────────────────────────────────────────────────────────────────────
1443 # Select a profile with `deepseek --profile <name>` or `DEEPSEEK_PROFILE=<name>`.
1444 # A profile's provider tables override the same fields of the base tables.
1445 [profiles.work.providers.deepseek]
1446 api_key = "WORK_DEEPSEEK_API_KEY"
1447 base_url = "https://api.deepseek.com/beta"
1448
1449 [profiles.dev]
1450 allow_shell = true
1451
1452 [profiles.dev.providers.deepseek]
1453 api_key = "DEV_DEEPSEEK_API_KEY"
1454
1455 [profiles.nvidia-nim]
1456 provider = "nvidia-nim"
1457 default_text_model = "deepseek-ai/deepseek-v4-pro"
1458
1459 [profiles.nvidia-nim.providers.nvidia_nim]
1460 api_key = "YOUR_NVIDIA_API_KEY"
1461 base_url = "https://integrate.api.nvidia.com/v1"
1462
1463 # ─────────────────────────────────────────────────────────────────────────────────
1464 # Desktop Notifications (OSC 9 / BEL on long agent-turn completion)
1465 # ─────────────────────────────────────────────────────────────────────────────────
1466 # Emits an escape sequence to the terminal when a turn **completes successfully**
1467 # and took longer than `threshold_secs`. Failed or cancelled turns are
1468 # intentionally silent. Useful when you tab away from the TUI and want an alert
1469 # for "your task is ready".
1470 #
1471 # method = "auto" # auto | osc9 | kitty | ghostty | bel | off
1472 # auto: native/terminal banner for known terminals.
1473 # On macOS, the native banner is silent; on Linux,
1474 # unknown terminals stay silent instead of ringing BEL.
1475 # osc9: \x1b]9;<msg>\x07 (iTerm2-style; shows macOS notification)
1476 # bel: explicit \x07 beep (MessageBeep on Windows)
1477 # off: disable banners; an explicit completion sound is independent
1478 # threshold_secs = 30 # only notify when the turn took >= this many seconds
1479 # include_summary = false # include elapsed time + cost in the notification body
1480 # subagent_completion = "final-only" # always | final-only | off — notices when
1481 # background work finishes: sub-agents, background
1482 # shells and durable tasks. final-only (default) sends
1483 # one notice naming everything that finished once no
1484 # agent, workflow or durable task is still running (a
1485 # running shell such as a dev server never holds it
1486 # back); off silences them entirely.
1487 # completion_sound = "off" # off | beep | bell | file — opt-in turn-completion sound
1488 # sound_file = "E:\\google\\downloads\\notify.wav" # WAV used when completion_sound = "file" (Windows)
1489 [notifications]
1490 # method = "auto"
1491 # threshold_secs = 30
1492 # include_summary = false
1493 # subagent_completion = "final-only"
1494 # completion_sound = "off"
1495 # sound_file = "E:\\google\\downloads\\notify.wav"
1496
1497 # Lifecycle event outbox: opt-in JSONL stream of session/turn/subagent
1498 # lifecycle events for supervisors and automation harnesses. One JSON line
1499 # per event (RuntimeEventEnvelope schema), appended and flushed on every
1500 # emit; seq is monotonic per file and recovers from the last line on open.
1501 # UNCOMMENT `path` TO ENABLE — unset/empty = OFF = behavior unchanged.
1502 # Fires for interactive TUI sessions AND headless `codewhale exec` runs.
1503 # See docs/CONFIGURATION.md → Lifecycle Outbox for the file contract.
1504 # [lifecycle_outbox]
1505 # path = "~/.codewhale/notifications/outbox.jsonl"
1506 # webhook_url = "https://example.com/hooks/codewhale" # optional: POST {"at", "event"} JSON per event
1507 # webhook_token = "" # optional: sent as `Authorization: Bearer <token>`
1508 # # delivery is best-effort: failures are logged and dropped
1509
1510 # Opt-in per-event sound cues (#4817): deterministic, terminal-bell level
1511 # (BEL bytes only — functional signals, platform-safe no-op when the terminal
1512 # ignores BEL). Off by default. When completion_sound is active, turn-complete
1513 # is left to that channel so the two never double-ding.
1514 # [notifications.event_sound]
1515 # enabled = false # master switch, default off
1516 # events = ["turn-complete", "approval-needed"] # allow-list; unknown names ignored
1517 # min_interval_ms = 2000 # per-event rate limit
1518 # quiet = false # true silences all event sounds
1519
1520 # ─────────────────────────────────────────────────────────────────────────────────
1521 # Workspace Snapshots (#137)
1522 # ─────────────────────────────────────────────────────────────────────────────────
1523 # Each turn the TUI takes a `pre-turn:<seq>` and `post-turn:<seq>` snapshot of
1524 # your workspace into a side-git repo at:
1525 #
1526 # ~/.codewhale/snapshots/<project_hash>/<worktree_hash>/.git
1527 #
1528 # Your own `.git` is never touched — `--git-dir` and `--work-tree` are always
1529 # set together when shelling out to git. Use `/restore N` (slash command) or
1530 # the `revert_turn` tool to roll the working tree back. Conversation history
1531 # is unaffected.
1532 #
1533 # Disk footprint: ~1-2 GB worst case for a 100 MB workspace × 12 turns/day,
1534 # typically far less thanks to git's content-addressed storage. The session
1535 # boot prunes anything older than `max_age_days` (default 7).
1536 #
1537 # [snapshots]
1538 # enabled = true # Snapshot workspace pre/post each turn for /restore
1539 # max_age_days = 7 # Older snapshots pruned at session start
1540 # max_workspace_gb = 2 # Snapshots self-disable on first init when the
1541 # # non-excluded workspace exceeds this size in GB
1542 # # (v0.8.32). Default 2 GB protects against running
1543 # # codewhale in directories with hundreds of GB
1544 # # of datasets / model weights / docker dumps where
1545 # # `git add -A` would hang the TUI for hours. Set
1546 # # to 0 to disable the cap (v0.8.31 behaviour);
1547 # # raise to a higher number for legitimate large
1548 # # monorepos.
1549
1550 # ─────────────────────────────────────────────────────────────────────────────────
1551 # LSP Diagnostics (post-edit) (#136)
1552 # ─────────────────────────────────────────────────────────────────────────────────
1553 # After every successful file edit (`edit_file`, `apply_patch`, `write_file`),
1554 # the engine asks an LSP server for diagnostics on the file and injects them
1555 # as a synthetic system message before the next API call. This lets the agent
1556 # see compile breaks immediately without round-tripping through the user.
1557 #
1558 # Off until you add an `[lsp]` table below (uncomment it). Language servers
1559 # analyse the project and can run code the folder defines (build scripts,
1560 # plugins, toolchain files) outside the sandbox, so a server starts only in a
1561 # folder you trusted permanently and approved for that server: run
1562 # `/lsp approve <name>` in the terminal app, `/lsp status` to see where each
1563 # server stands, and `/lsp revoke <name>` to withdraw it. Desktop has no
1564 # approval step yet, so language servers do not start there. Failure modes
1565 # are non-blocking: a missing LSP binary, a crashed server, an unapproved
1566 # server or a timeout simply skips the post-edit hook for that turn.
1567 #
1568 # Built-in language → server defaults:
1569 # rust → rust-analyzer
1570 # go → gopls serve
1571 # python → pyright-langserver --stdio
1572 # typescript → typescript-language-server --stdio
1573 # java → jdtls
1574 # php → intelephense --stdio
1575 # vue → vue-language-server --stdio
1576 # c, cpp → clangd
1577 #
1578 # Java support uses Eclipse JDT LS via the `jdtls` command. IntelliJ IDEA is
1579 # not required, and installing IntelliJ IDEA alone does not install `jdtls`.
1580 #
1581 # Override the defaults via the `servers` table below.
1582 #
1583 # For languages not in the built-in list (Ruby, C#, Swift, etc.), use
1584 # `[lsp.custom.<ext>]` to register a language server:
1585 #
1586 # [lsp.custom.rb]
1587 # command = "ruby-lsp"
1588 # args = ["--stdio"]
1589 # language_id = "ruby"
1590 #
1591 # [lsp.custom.cs]
1592 # command = "csharp-ls"
1593 # args = []
1594 # language_id = "csharp"
1595 #
1596 # [lsp.custom.swift]
1597 # command = "sourcekit-lsp"
1598 # language_id = "swift"
1599 # [lsp]
1600 # enabled = true
1601 # poll_after_edit_ms = 5000
1602 # max_diagnostics_per_file = 20
1603 # include_warnings = false
1604 # [lsp.servers]
1605 # rust = ["rust-analyzer"]
1606 # go = ["gopls", "serve"]
1607 # java = ["jdtls"]
1608 # php = ["intelephense", "--stdio"]
1609 # vue = ["vue-language-server", "--stdio"]
1610
1611 # ─────────────────────────────────────────────────────────────────────────────────
1612 # Hooks (optional)
1613 # ─────────────────────────────────────────────────────────────────────────────────
1614 # Hooks run shell commands on lifecycle events (session start/end, tool calls, etc.).
1615 # Configure as `[[hooks.hooks]]` under a `[hooks]` table.
1616 #
1617 # SCOPE: hooks are a TUI runtime feature. They fire from the interactive TUI
1618 # and the engine turn loop it drives. `codewhale exec`, the CLI subcommands,
1619 # the app-server / ACP surfaces, and the `workflow` tool do NOT fire them.
1620 #
1621 # Available events (all 11): session_start, session_end, message_submit,
1622 # tool_call_before, tool_call_after, mode_change, on_error, turn_end,
1623 # subagent_spawn, subagent_complete, shell_env.
1624 # See docs/HOOKS.md for the per-event payload, env var, and steering contract.
1625 #
1626 # `message_submit`, `tool_call_before`, and `shell_env` are the only events
1627 # whose result can change what Codewhale does. The rest are observer-only —
1628 # which means their RESULT is ignored, not that the command is harmless. Every
1629 # hook is an arbitrary shell command running with your credentials.
1630 #
1631 # Note: `default_timeout_secs` below OVERRIDES each hook's own `timeout_secs`.
1632 # Leave it unset if you want per-hook timeouts to apply. `/hooks list` shows the
1633 # effective value and names the override. `default_timeout_secs = 0` is
1634 # REJECTED at load — it would expire every hook immediately — and per-hook
1635 # `timeout_secs` applies instead. The timeout applies to background hooks too:
1636 # on expiry the whole process group is killed and then reaped, best-effort,
1637 # with a bounded reap wait (see docs/HOOKS.md → Timeouts).
1638 #
1639 # `background = true` means submitted and never awaited. The hook still gets
1640 # the documented stdin payload, environment, and timeout — it just has no exit
1641 # code, so it cannot steer. `shell_env` ignores the flag and always runs in the
1642 # foreground because its stdout is the contract.
1643 #
1644 # A condition that references context its event never carries is REJECTED at
1645 # load, logged, and shown by `/hooks list` — for example an `exit_code`
1646 # condition outside `tool_call_after` / `on_error`, or a `mode` condition on
1647 # `shell_env`. Rejection is per entry: a broken hook never drops another one
1648 # that happens to share its name. `on_error` fires for tool failures with the
1649 # tool name, call id, and reported exit code attached, so tool-scoped and
1650 # exit-code-scoped `on_error` hooks are supported.
1651 #
1652 # `shell_env` (#456) is special: the hook runs immediately before each
1653 # `exec_shell` invocation and its stdout is parsed as `KEY=VALUE\n` lines.
1654 # Those vars are applied on top of `exec_shell`'s environment. For LOCAL
1655 # execution that environment is built from a fixed allowlist of parent
1656 # variables (PATH, HOME, LANG, TERM, …) — an ambient secret exported in your
1657 # terminal is NOT forwarded to `exec_shell` by itself, so this hook is the
1658 # supported way to supply one. If an external sandbox backend is configured,
1659 # that allowlist does NOT apply: the backend owns its base environment and your
1660 # `shell_env` values are TRANSMITTED to it. Later hooks override
1661 # earlier ones. Use this for ephemeral credentials, per-skill PATH adjustments,
1662 # or short-lived tokens. The resolved KEY names (NEVER values) are written to
1663 # `~/.codewhale/audit.log` so each session can be reconciled later. Hook
1664 # failure / timeout simply contributes no vars — it does not abort the shell
1665 # call.
1666 #
1667 # [hooks]
1668 # enabled = true
1669 # default_timeout_secs = 30
1670 #
1671 # [[hooks.hooks]]
1672 # event = "session_start"
1673 # command = "echo 'Codewhale session started'"
1674 #
1675 # # Inject ephemeral creds into every shell call. Output one
1676 # # KEY=VALUE per line on stdout (export prefix optional).
1677 # [[hooks.hooks]]
1678 # name = "aws-creds"
1679 # event = "shell_env"
1680 # command = "aws-vault export my-profile --format=env"
1681 # # Optionally limit to specific tool names / categories:
1682 # # condition = { type = "tool_category", category = "shell" }
1683 #
1684 # # Observe sub-agent lifecycle events. These hooks receive bounded JSON
1685 # # metadata on stdin and are warn-only: failures do not affect sub-agent
1686 # # scheduling, prompts, or results. continue_on_error has no effect for
1687 # # these observer events; later matching hooks always continue.
1688 # [[hooks.hooks]]
1689 # name = "subagent-audit"
1690 # event = "subagent_complete"
1691 # command = "~/.codewhale/hooks/subagent-audit.sh"
1692
1693 # ─────────────────────────────────────────────────────────────────────────────────
1694 # Runtime API (`deepseek serve --http`) (#561)
1695 # ─────────────────────────────────────────────────────────────────────────────────
1696 # Tuning knobs for the local HTTP/SSE daemon. The server binds to 127.0.0.1
1697 # by default and is intended for local UIs (whalescale-desktop, dashboards,
1698 # automation scripts). Today this section only controls the CORS allow-list;
1699 # host/port/workers stay on `--host`, `--port`, and `--workers` flags.
1700 #
1701 # Built-in defaults always include:
1702 # http://localhost:3000 http://127.0.0.1:3000
1703 # http://localhost:1420 http://127.0.0.1:1420
1704 #
1705 # Use `cors_origins` to add extra dev origins (e.g. Vite's default `:5173`).
1706 # User entries STACK on top of the defaults — they do not replace them. The
1707 # CLI flag `--cors-origin URL` (repeatable) and env var
1708 # `DEEPSEEK_CORS_ORIGINS=url1,url2` resolve to the same merged list.
1709 #
1710 # [runtime_api]
1711 # cors_origins = ["http://localhost:5173", "http://127.0.0.1:5173"]
1712
1713 # ─────────────────────────────────────────────────────────────────────────────────
1714 # Tool Overrides & Plugins ([tools])
1715 # ─────────────────────────────────────────────────────────────────────────────────
1716 # The `[tools]` table lets you disable any built-in tool, or add your own
1717 # tool backed by a script or command — without forking or recompiling the
1718 # binary. A script or command cannot replace a built-in: an override keyed by
1719 # a built-in name is refused (logged) and the built-in stays active.
1720 #
1721 # Plugin scripts dropped in the plugin directory are auto-discovered and
1722 # registered as model-visible tools alongside the built-in ones. A script may
1723 # declare `# approval: suggest` (the default) or `# approval: required`;
1724 # `# approval: auto` is no longer supported and falls back to the default.
1725 #
1726 # Scripts receive the tool's JSON input on **stdin** and must return a
1727 # JSON `ToolResult` (`{"content": "...", "success": true}`) on **stdout**.
1728 #
1729 # [tools]
1730 # # Custom plugin directory (defaults to `~/.codewhale/tools/`)
1731 # plugin_dir = "~/.codewhale/tools"
1732 #
1733 # [tools.overrides]
1734 # # Disable a tool entirely — removes it from the model-visible catalog.
1735 # "Web" = { type = "disabled" }
1736 #
1737 # # Add a tool backed by a script. Relative paths resolve against plugin_dir.
1738 # "audited_shell" = { type = "script", path = "audit-shell.sh" }
1739 #
1740 # # Add a tool backed by a command (binary on PATH or absolute path).
1741 # "bat_reader" = { type = "command", command = "bat", args = ["--paging=never"] }
1742 #
1743 # # Scripts can also accept static arguments before the JSON input:
1744 # "cached_fetch" = { type = "script", path = "cached-fetch.sh", args = ["--ttl", "300"] }
1745
1746 # ──────────── Enterprise example: audit-logging shell wrapper ──────────────
1747 # Drop `audit-shell.sh` (below) in `~/.codewhale/tools/`, where it registers
1748 # itself as `audited_shell`, and turn the built-in shell off (`Bash` and its
1749 # lowercase `bash` form). Other shell-capable tools, such as the terminal
1750 # tools, stay available; disable them too if every command must pass the
1751 # wrapper.
1752 #
1753 # [tools.overrides]
1754 # "Bash" = { type = "disabled" }
1755 # "bash" = { type = "disabled" }
1756 #
1757 # The wrapper logs every request to `~/.codewhale/audit/shell.log`, then
1758 # delegates to your own approved shell executor. Do not pipe the raw JSON
1759 # request into `sh -s`; parse the command field and enforce your policy first.
1760 #
1761 # ```sh
1762 # #!/usr/bin/env sh
1763 # # name: audited_shell
1764 # # description: Audit-logging shell wrapper
1765 # # approval: required
1766 # LOGDIR="${HOME}/.codewhale/audit"
1767 # mkdir -p "$LOGDIR"
1768 # LOGFILE="$LOGDIR/shell.log"
1769 # input=$(cat)
1770 # echo "[$(date -Iseconds)] $input" >> "$LOGFILE"
1771 # printf '%s\n' '{"content":"audit wrapper dry run: configure an executor","success":false}'
1772 # ```
1773
1774 # ─────────────────────────────────────────────────────────────────────────────────
1775 # Workflow automatic launch, approval, isolation, and activity (#4128)
1776 # ─────────────────────────────────────────────────────────────────────────────────
1777 # First-class knobs for automatic Workflow orchestration. When the table is
1778 # omitted entirely, the runtime uses these product defaults. Later launch,
1779 # approval, and activity-persistence paths all read through this one model.
1780 # [workflow]
1781 # # Allow the parent agent to auto-launch Workflow for multi-agent work.
1782 # # Set false to require an explicit `/workflow` opt-in.
1783 # automatic = true
1784 # # Auto-start read-only plans without an approval card when automatic is on.
1785 # auto_start_read_only = true
1786 # # Require an approval card before write/shell/network launches.
1787 # require_approval_for_writes = true
1788 # # Optional owner-selected total child limit. Zero leaves work uncapped.
1789 # max_children = 0
1790 # # Maximum concurrently live agents inside one run (others wait for a slot).
1791 # max_concurrent = 64
1792 # # Optional structural Workflow depth limit; zero leaves it uncapped.
1793 # # This is separate from Runtime child delegation below.
1794 # max_depth = 0
1795
1796 # ─────────────────────────────────────────────────────────────────────────────────
1797 # Agent Fleet roster, role registry, and execution requests (#3165, #3167)
1798 # ─────────────────────────────────────────────────────────────────────────────────
1799 # [fleet]
1800 # # Fleet stores member identity and route intent. Project trust, host identity,
1801 # # secrets, approvals, sandboxing, filesystem/network reach, and tool authority
1802 # # are Runtime policy and are deliberately not configured here. Pre-0.9.11
1803 # # trust keys are accepted only as ignored migration input.
1804 #
1805 # # Headless worker execution hardening (#3027)
1806 # [fleet.exec]
1807 # # Tools always allowed regardless of role
1808 # allowed_tools = []
1809 # # Tools always disallowed (overrides role and task spec)
1810 # disallowed_tools = ["exec_shell"]
1811 # # Optional hard ceiling on worker steps (tool calls + model turns).
1812 # # Omit or set 0 for the unbounded default; use a positive value to opt in.
1813 # max_turns = 500
1814 # # Runtime child-agent depth for fleet workers. Shares ONE recursion axis with
1815 # # standalone sub-agents (a fleet worker IS a headless sub-agent). This is an
1816 # # execution request, not Fleet member identity. 0 blocks child agents (the
1817 # # root worker still runs); omit to leave depth uncapped.
1818 # max_spawn_depth = 3
1819 # # Extra system prompt injected into every headless worker
1820 # append_system_prompt = "Never modify .git/config or change remotes."
1821 # # Output format: "text" (default) or "stream-json" for ndjson events
1822 # output_format = "text"
1823 #
1824 # # Fleet profiles define named agent configurations the roster can dispatch.
1825 # # Built-in profiles are always available: manager, operator, scout, builder,
1826 # # reviewer, verifier, synthesizer, general. User-defined profiles under
1827 # # [fleet.profiles] override or extend the built-in set by id. Precedence
1828 # # is Workspace (.codewhale/agents/*.toml) > Config ([fleet.profiles]) > BuiltIn.
1829 # # See /fleet setup for an in-app profile-authoring wizard.
1830 # [fleet.profiles.ci-linter]
1831 # slot = "verifier"
1832 # loadout = "fast"
1833 # model = "deepseek-v4-pro"
1834 #
1835 # [fleet.profiles.ci-linter.role]
1836 # name = "CI Linter"
1837 # description = "Runs linters and formatters"
1838 # instructions = "Run cargo fmt --check and cargo clippy; never apply fixes."
1839 #
1840 # [fleet.profiles.pr-reviewer]
1841 # slot = "reviewer"
1842 # loadout = "inherit"
1843 #
1844 # [fleet.profiles.pr-reviewer.role]
1845 # name = "PR Reviewer"
1846 # description = "Reviews PRs with GitHub access"
1847 # instructions = "Review diffs for correctness, regressions, and missing tests."
1848
1849 # ─────────────────────────────────────────────────────────────────────────────────
1850 # Named fleets live in files, not inline tables (0.9.14).
1851 #
1852 # Inline [fleets.<name>] tables were removed: define named fleets as
1853 # `fleets/<name>.toml` under $CODEWHALE_HOME or the workspace instead
1854 # (see docs/FLEET.md). Old inline tables still parse but are ignored.
1855 # ─────────────────────────────────────────────────────────────────────────────────
1856
1857 # ─────────────────────────────────────────────────────────────────────────────────
1858 # Requirements (admin constraints) example file
1859 # ─────────────────────────────────────────────────────────────────────────────────
1860 # allowed_approval_policies = ["on-request", "untrusted", "never"]
1861 # allowed_sandbox_modes = ["read-only", "workspace-write"]
1862
1862 lines TOML