# Caudra 0.2 Preview 11

[v0.2.0-preview.11 on GitHub](https://github.com/caudra/caudra/releases/tag/v0.2.0-preview.11)

- Sign in to one provider with several subscriptions and API keys, and let Caudra switch between them without breaking the prompt cache.
- Config edits keep your comments.
- Opt-in cache warming keeps the Anthropic prompt cache alive through long tool runs.
- Editors and desktop apps get more of Caudra over ACP: several sessions, session management, sign-in, steering, and background subagents.
- Image generation, the host description, workflows, and automations move into the `code` tool as modules with on-demand help, and `tool_search` is gone.
- Snippets can sleep and read the clock, and `timeoutSec` bounds a run.

> **Important**
>
> **Close every other Caudra session before you start Preview 11.** On its first start, Preview 11 upgrades the session database in your [state directory](/docs/configuration/#directory-layout), and the upgrade needs exclusive access. This includes other terminals, editor sessions over ACP, and `caudra storage` commands. While any of them has the database open, Preview 11 does not start. It lists the sessions to close, and nothing is changed.
>
> The upgrade keeps your sessions, saves the old database as `caudra.db.v30.bak` next to `caudra.db`, and moves each saved provider login to `auth/accounts/<provider>/default.json`. Preview 10 and earlier cannot open the upgraded database or read the moved logins, and `caudra rollback` restores only the previous binary.

> **Warning**
>
> **Before you start Preview 11, remove the settings that deferred tools.** `image_generate`, `execution_environment`, `workflow`, and `automation` are now [modules of the `code` tool](/docs/code/#tools-reached-from-code), and `tool_search` is gone. A config or profile that still uses any of the following fails to load, with an error that names the fix:
>
> 1. Delete `defer_builtin_tools` from `[agent]` in `caudra.toml`.
> 2. Delete `tool_search` from `[decisions.features]`.
> 3. Replace `lazy` in a [system prompt profile](/docs/system-prompts/#choose-tool-availability)'s `tools` block with `eager` or `disabled`. An MCP tool that was `lazy` stays callable as `eager`.
> 4. Remove `code` from `agent.disabled_tools` and from profile overrides that disable it. `code` now hosts the modules and cannot be turned off, so turn off a module's tool group instead: `images` for `image`, `execution` for `host`, and `delegation` for `workflow` and `automation`.
>
> Permission rules, `agent.disabled_tools` entries, and profile groups that name the four tools keep working. In snippets, `decide()`, `rerank()`, `search()`, `servers()`, `resources()`, and `read_resource()` are now `decisions.decide()`, `decisions.rerank()`, `mcp.search()`, `mcp.servers()`, `mcp.resources()`, and `mcp.read_resource()`, and the old names raise `NameError` naming the new call.

## Code

- **Modules with on-demand help**: A `code` snippet now reaches everything beyond the interpreter through modules: `history`, `mcp`, `decisions`, `image`, `host`, `workflow`, and `automation`. `help()` lists them, and `help("image")` or `help("workflow.start")` shows the full reference with examples. The first `history.search`, `history.read`, `image.generate`, or `workflow.start` in a conversation returns its reference instead of running, unless `help` already showed it. The `code` description no longer changes with what the session connects, so the prompt cache holds. See [Modules](/docs/code/#modules).
- **Tools as module calls**: `await image.generate(prompt, out)`, `await host.environment()`, `await workflow.start(...)`, and `await automation.list()` run the tools they replace, with the same permission rules, plan mode checks, and cards, and return dicts to the snippet. Each call's row on the `code` card opens to the tool's own card. See [Tools reached from `code`](/docs/code/#tools-reached-from-code).
- **Sleep, clocks, and `timeoutSec`**: `time.sleep()` and `await asyncio.sleep()` now wait for real, and `time.time()`, `time.monotonic()`, and `datetime.now()` read the host clock in UTC. Waiting does not count toward the 30 seconds of computation, and `Esc` stops it. `timeoutSec` is back as a wall-clock deadline for the whole run, 120 seconds by default and up to 3600, so a snippet can poll a workflow. See [The Python subset](/docs/code/#the-python-subset) and [Run time](/docs/code/#run-time).
- **More Python**: Monty 1.2 adds CSV and TOML parsing, hashing, bisection, `os.path`, match statements, and dataclass field defaults.
- **JavaScript habits repaired**: A snippet that starts an assignment with `const`, `let`, or `var`, or passes a host call one JavaScript object, now runs as the Python it meant. See [Results and errors](/docs/mcp/#results-and-errors).
- **What a subagent did, on its task card**: A running task card now lists every step of the subagent, newest last, instead of only the current one. A `code` row reads like `code 3 calls` and lists the newest calls with their status. See [In the transcript](/docs/code/#in-the-transcript).

## Accounts

- **Several accounts per provider**: Each `caudra auth login` adds an account, such as a second Claude subscription or an API key, and `--name` names it. `caudra auth status` lists every account with the quota it has left, `caudra auth use <provider> <name|auto>` chooses one, and `caudra auth rename` and `caudra auth logout <provider> [name] [--all]` manage them. `--account <provider>:<name|auto>` and `CAUDRA_ACCOUNT` choose an account for one run. Several comma-separated keys in a provider's key variable become the accounts `env-1`, `env-2`, and so on. See [Accounts](/docs/accounts/).
- **Automatic switching**: With two or more accounts, Auto keeps each conversation on its account and moves it to another before the account runs out. It moves only where the prompt cache is cold anyway, unless the account is nearly spent or refused, and a rate limit shorter than 30 seconds waits on the same account. `ordered` tries the accounts in priority order, and `paced` uses the quota that resets soonest. `[<provider>.switching]` and `[[<provider>.accounts]]` in `providers.toml` set the thresholds, the order, and which API keys may take over from spent subscriptions. See [How Auto switches](/docs/accounts/#how-auto-switches).
- **Across providers**: With `[switching] providers = ["anthropic", "openai"]` in `providers.toml`, Auto moves a conversation to another provider's subscription once every subscription of its own runs out, and back once the first provider has quota again. See [Across providers](/docs/accounts/#across-providers).
- **Accounts in the TUI**: `/accounts` or `Ctrl+X i` lists, pins, adds, renames, orders, and removes the accounts of every provider, with fresh quota readings. The status bar shows the account a conversation uses, each switch adds a transcript row with its cause and cache cost, and `/usage` splits spend by account. `/login` also offers the xAI subscription sign-in.
- **Sign-in details**: A key saved by `caudra auth login` is now tried before the provider's key variable, and the prompt hides the key as you type it. `caudra auth logout` deletes only the credential and keeps the account entry in `providers.toml`.

## Cache warming

- **Opt-in cache warming**: `cache_warming = "running"` under `[agent]` in the global `caudra.toml` sends the last request again with `max_tokens: 0` shortly before its Anthropic prompt cache expires, while a run waits on a long tool, subagent, question, or permission prompt. `"idle"` also warms for up to 30 minutes after a run ends. It is off by default, covers the Anthropic API only, and warms only when that costs less than the cache write it avoids. `/usage` shows what warming cost and saved, or what it would have saved while it is off. See [Cache warming](/docs/token-economy/#cache-warming).

## ACP

- **Several sessions**: One `caudra acp` process now keeps every session an editor opens, each with its own tools, so sessions in different projects run side by side. Editors can list, resume, close, delete, and fork Caudra sessions, and the list shows each session's title and its first and last prompt. See [ACP](/docs/acp/) and [Sessions](/docs/acp/#sessions).
- **Sign-in**: Editors get a `caudra-login` auth method that runs `caudra auth login`, and `caudra acp` starts with no signed-in provider so the editor can offer it. See [Authentication](/docs/acp/#authentication).
- **Pickers and model catalog**: Editors get pickers for reasoning effort, mode, and permission mode beside the model, and a fast mode toggle where supported. The choices are saved with the session, and editors can list models before opening one. See [Config options](/docs/acp/#config-options).
- **Slash commands and compaction**: Editors list `/compact`, your skills, and MCP prompts as slash commands, and show compaction progress and retried provider requests. See [Slash commands](/docs/acp/#slash-commands).
- **Cancellation and steering**: Cancelling a prompt withdraws open permission prompts and questions and answers `cancelled` exactly once. A prompt sent right after a cancel runs once the cancelled turn ends, so editors such as Orca that steer by cancelling and prompting again work, and a prompt sent with `_meta.caudra.delivery: "steer"` joins the running turn. See [Prompts, cancellation, and steering](/docs/acp/#prompts-cancellation-and-steering).
- **Turn details**: Answers carry the turn's duration and usage, tool calls name their tool, shell calls report stdout, stderr, and exit code, and failures carry their text instead of a bare "Internal error". See [Turn updates](/docs/acp/#turn-updates).
- **Subagents and background tasks**: Subagents and shell commands can run in the background over ACP, as in the TUI. Editors that support ACP subagent sessions get one per subagent, editors that opt in with `_meta["caudra/childWork"]` can follow and stop this work, and other editors see each subagent's tool calls in the parent session. See [Subagents and background tasks](/docs/acp/#subagents-and-background-tasks).
- **Questions as permission requests**: An editor without form elicitation that sets `_meta["caudra/questionsViaPermission"]` gets the `question` tool's questions as permission requests. See [Permissions and questions](/docs/acp/#permissions-and-questions).
- **Answers every request**: A second prompt to a busy session is refused instead of left unanswered, and a stdin line that is not JSON or is over 64 MiB is skipped instead of breaking the connection.

## Changes

- **Image viewing**: The image viewer and workbench image tabs now zoom and pan. Pictures are sized to the terminal's cells and redrawn when the window or font changes, and a click outside the picture closes the viewer.
- **Orca resumes Caudra**: In an Orca terminal, Caudra now reports its session id, so Orca can reopen it with `caudra --resume <id>`, and lists running subagents as child rows. Off Windows, clicking a row switches to that subagent's chat when Orca supports it. See [Orca](/docs/notifications/#orca).
- **Docs from any modal**: A `?` on the top border of a modal such as `/accounts` or `/usage`, or `F1`, opens the manual section about it above the modal, so `Esc` returns to it. The key hints on the top border of `/usage` and `/tools` also answer a click. See [Docs](/docs/commands/#docs).
- **Tool cards fold like a file read**: `source_code_context`, `source_code_refs`, and `memory` reads now rest as one row that a click opens whole. A [Home Assistant](/docs/mcp/#home-assistant) or [Executor](/docs/mcp/#executor) call inside a `code` or `batch` card shows its whole card, a `memory` write shows the whole note, and a click on a write's title folds it in the expanded `/view` too. If you set your own `ui.always_collapsed` list, add `"source_code_context"`, `"source_code_refs"`, and `"memory_read"` to it.
- **One proxy for every request**: All of Caudra's own requests, decision endpoints and Lua's `caudra.net` included, now use `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY`, and `NO_PROXY`. A proxy set only in a project `.caudra/.env` no longer applies, so set it in your shell or the global `.env`. See [Network proxies](/docs/cli/#network-proxies).

## Fixes

- **Cancelling stops the running command**: Cancelling a turn while a `shell` command runs, with `Esc` or from an ACP editor, now stops the command and every process it started.
- **Config edits keep your comments**: Saving a provider or decision endpoint, toggling an MCP server, or saving sandbox records now changes only the keys that changed, and keeps your comments, quoting, and table order.
- **Refusals end the turn**: A provider refusal or content filter now ends the turn as refused instead of prompting a retry.
- **Resources read as their type**: An MCP resource that is not markdown now shows its text as the server wrote it.
- **Purposes sorted by spend**: The session's Per purpose table in `/usage` now lists the purpose that cost the most first.
