Skip to content

Commit 9eaa987

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts: # scripts/tui-tests/README.md
2 parents ba170b7 + 39ff307 commit 9eaa987

43 files changed

Lines changed: 5508 additions & 932 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ cargo build --release --locked --package claurst # binary: coven-code
104104
| `--thinking <TOKENS>` | | Extended-thinking budget in tokens (enables extended thinking) |
105105
| `--resume [<ID>]` | | Resume a previous session by ID; omit ID to resume the most recent |
106106
| `--print` | `-p` | Print mode: send prompt and exit (non-interactive / headless) |
107-
| `--permission-mode <MODE>` | | `default`, `accept-edits`, `bypass-permissions`, or `plan` |
107+
| `--permission-mode <MODE>` | | `default`, `accept-edits`, `bypass-permissions`, or `plan`. When omitted, an interactive session starts in the saved mode (never a saved `bypass-permissions`); headless runs use `default` |
108108
| `--max-turns <N>` | | Maximum agentic turns before stopping (default: 10) |
109109
| `--system-prompt <PROMPT>` | `-s` | Override the system prompt |
110110
| `--append-system-prompt <PROMPT>` | | Append text to the system prompt |

‎docs/commands.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Clear the current conversation history and start a fresh session. The session fi
7777
### /exit
7878
**Aliases:** `quit`, `q`
7979

80-
Exit the Coven Code REPL, like pressing `Ctrl+D` twice on an empty prompt. Finished turns are already saved. Typed while a turn runs, `/exit` waits for the turn to end, like any queued message. Quitting with `Ctrl+D` while a turn is still running stops it and saves it with your prompt and what it delivered so far. If it has not stopped within 2 seconds, for example while a tool ignores the stop, only your prompt from that turn is saved. With `COVEN_CODE_UI=next`, it then says the turn stopped, names each tool with no reported result, noting any last shown waiting for its turn or awaiting approval, and says what those did is unknown, names any finished tool whose result is not in the saved session, and gives the command to resume the session when the save succeeded. Quitting while auto-compaction runs waits up to 2 seconds for it, in both renderers. If it finishes in time, the compacted conversation is saved; otherwise the conversation is saved as it was before. In Next, quitting then prints only the command to resume, or that the session was not saved. Classic prints nothing after it exits, whether or not the save succeeded.
80+
Exit the Coven Code REPL, like pressing `Ctrl+D` twice on an empty prompt. Finished turns are already saved. Typed while a turn runs, `/exit` waits for the turn to end, like any queued message. Quitting with `Ctrl+D` while a turn is still running stops it and saves it with your prompt and what it delivered so far. If it has not stopped within 2 seconds, for example while a tool ignores the stop, only your prompt from that turn is saved. With `COVEN_CODE_UI=next`, it then says the turn stopped, names each tool with no reported result, noting any last shown waiting for its turn or awaiting approval, and says what those did is unknown, names any finished tool whose result is not in the saved session, and gives the command to resume the session when the save succeeded. Quitting while auto-compaction runs waits up to 2 seconds for it, in both renderers. If it finishes in time, the compacted conversation is saved; otherwise the conversation is saved as it was before. In Next, quitting then prints only the command to resume, or that the session was not saved. If the save at exit fails, both renderers print one line to stderr once the terminal is restored: `Session not saved; any earlier saved copy lacks this turn.` after a turn, or `Session not saved.` after auto-compaction. Classic prints nothing else after it exits.
8181

8282
```
8383
/exit

‎docs/configuration.md‎

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ the engine home. Global settings require **plain JSON**, without comments.
1414

1515
Shared `<coven-home>/settings.json` supplies only `model`, `theme`, and
1616
`permission_mode` defaults when the engine-global values remain at defaults.
17-
Command-line overrides apply after settings loading.
17+
Command-line overrides apply after settings loading. Which starts use the
18+
saved permission mode is described under [Permission Modes](#permission-modes).
1819

1920
### Per-project settings
2021

@@ -26,11 +27,13 @@ an unreadable or invalid file does not fall back to another file or parent.
2627
Project settings are sanitized before merging. Provider routing and credentials,
2728
MCP and LSP server definitions, hooks, hosted-review policy, persisted permission
2829
rules, and `workspace_paths` are discarded from this layer. Configure these
29-
in trusted engine-global settings instead.
30+
in trusted engine-global settings instead. `permission_mode` is not taken from
31+
this file either: a project file neither sets the mode nor resets the one you
32+
saved.
3033

3134
Merging is field-specific: some lists concatenate and maps merge. Omission does
3235
not always preserve a global value: project defaults can replace fields such as
33-
`permission_mode`, `theme`, and `output_format`. Keep project settings minimal
36+
`theme` and `output_format`. Keep project settings minimal
3437
and verify the effective behavior before relying on a global preference.
3538

3639
---
@@ -79,7 +82,7 @@ The `config` object holds runtime behaviour options.
7982

8083
| Key | Type | Default | Description |
8184
|-----|------|---------|-------------|
82-
| `permission_mode` | string | `"default"` | Controls how tool permissions are enforced. One of `"default"`, `"acceptEdits"`, `"bypassPermissions"`, `"plan"`. |
85+
| `permission_mode` | string | `"default"` | The mode an interactive session starts in when `--permission-mode` is not given. One of `"default"`, `"acceptEdits"`, `"bypassPermissions"`, `"plan"`; a saved `"bypassPermissions"` is not restored. |
8386

8487
See [Permission Modes](#permission-modes) for a full description of each value.
8588

@@ -330,6 +333,42 @@ coven-code --permission-mode accept-edits "refactor the auth module"
330333
coven-code --permission-mode bypass-permissions "..."
331334
```
332335

336+
### Which mode a start uses
337+
338+
1. `--dangerously-skip-permissions`, then `--permission-mode`, when given. A
339+
run with a `--context` brief always bypasses permissions.
340+
2. Otherwise an interactive session starts in the saved `permission_mode`:
341+
the one `/config set permission-mode` or `/permissions set` wrote to your
342+
engine-global settings, or the shared default when that is `default`. A
343+
notification says that a saved `acceptEdits` or `plan` was restored.
344+
3. A saved `bypassPermissions` is never restored at startup. The session
345+
starts in `default` and a notification says so; pass
346+
`--permission-mode bypass-permissions` to use it. The notification stops
347+
when the saved mode is no longer `bypassPermissions`.
348+
4. Headless runs (`--print`, `--headless` or a prompt argument, whatever the
349+
output format) ignore the saved mode: without the flag they run in
350+
`default`.
351+
352+
A value that is not one of the four modes counts as `default`; in engine-global
353+
settings it also makes the whole file invalid, so its other settings are not
354+
loaded. Changing the saved mode with the `Config` tool needs the same approval
355+
as any other write; a session in `bypassPermissions` gives it without asking.
356+
The settings screen never saves the session's mode.
357+
358+
Two limits to know about:
359+
360+
- `coven-code acp` takes no `--permission-mode` and is not covered by the list
361+
above: it loads the mode saved in engine-global settings, including a saved
362+
`bypassPermissions`, with `plan` treated as `default`. Its tool approvals
363+
still go to the connected client; the saved mode reaches the keyless
364+
`claude` transport and the PowerShell risk gate.
365+
- An engine-global `default` cannot be told apart from no saved mode, so it
366+
does not override an `acceptEdits`, `plan` or `bypassPermissions` in the
367+
shared file: `/config set permission-mode default` reports success and the
368+
next start still acts on the shared mode (a shared `bypassPermissions` keeps
369+
producing the not-restored notification). Change the shared file, or pass
370+
`--permission-mode default`.
371+
333372
---
334373

335374
## AGENTS.md Memory Files
@@ -535,6 +574,7 @@ and `api_base` override the corresponding environment variables.
535574
| `COVEN_CODE_PROVIDER` | Active provider. Equivalent to `--provider`. |
536575
| `COVEN_CODE_API_BASE` | Override the API base URL for the active provider. Equivalent to `--api-base`. |
537576
| `COVEN_CODE_GOALS` | Set to `0` to disable the goal system (`/coven goal` command and `GoalCompleteTool`). |
577+
| `COVEN_CODE_DISABLE_UPDATE_CHECK` | Set to skip the release check an interactive session makes at startup: a request to GitHub's releases API unless a result from the last 24 hours is cached, and the update notice that follows. The variable only has to be present, so `0` or an empty value also disables the check; unset it to restore the default. `/update` and `coven-code upgrade` still contact GitHub when you run them. The model catalog refresh at startup is separate: see `COVEN_CODE_DISABLE_MODELS_FETCH` in [providers.md](providers.md). |
538578
| `COVEN_CODE_BRIDGE_URL` | Enable the remote-control bridge by setting the server URL. |
539579
| `COVEN_CODE_BRIDGE_TOKEN` | Bearer token for the remote-control bridge. |
540580
| `RUST_LOG` | Tracing filter (e.g. `debug`, `claurst_core=trace`). |

‎docs/keybindings.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ In vim insert mode, `Enter` also submits. Use `Shift+Enter` for newlines in vim
324324

325325
Pressing `Escape` while a turn is running cancels the whole turn, the same way `Ctrl+C` does, in both renderers: the model stops generating and the runtime cancels any tool call in progress. Live text stops streaming at once. Once the runtime has stopped, the partial answer it kept appears in the transcript and the saved session; it can include text that had not reached the screen yet. Nothing else the cancelled turn sends restarts it, so the next `Ctrl+C` starts the exit sequence instead of cancelling again. The input field keeps focus and you can send a follow-up message.
326326

327-
Until the runtime has actually stopped the turn, the status says the cancel is pending: `Cancelling…` in Classic, `cancelling` in the Next renderer (`COVEN_CODE_UI=next`). Then it shows `Cancelled.`, with no turn-done notice or bell, even if the turn had already finished when the cancel reached it. A cancel from remote control follows the same steps. Auto-compaction does not stop when cancelled: the status says the cancel is pending until the compaction finishes, then shows `Cancelled.`, although the conversation was compacted. When the Next inspector is open, the first `Escape` closes the inspector instead of cancelling.
327+
Until the runtime has actually stopped the turn, the status says the cancel is pending: `Cancelling…` in Classic, `cancelling` in the Next renderer (`COVEN_CODE_UI=next`). Then it shows `Cancelled.`, with no turn-done notice or bell, even if the turn had already finished when the cancel reached it. A cancel from remote control follows the same steps. Cancelling during auto-compaction stops it and leaves the conversation as it was, and the status shows `Cancelled. Auto-compact is off for this session.`; auto-compaction stays off for the rest of the session. If the compaction had already finished when the cancel reached it, the compacted conversation is kept and the status shows `Auto-compact complete.`. When the Next inspector is open, the first `Escape` closes the inspector instead of cancelling.
328328

329329
---
330330

0 commit comments

Comments
 (0)