Skip to content

fix: keep read-only and keyless turns within their permission - #471

Merged
BunsDev merged 1 commit into
mainfrom
fix/scheduled-and-keyless-permission
Nov 14, 2026
Merged

BunsDev merged 1 commit into
mainfrom
fix/scheduled-and-keyless-permission

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Scheduling a prompt now needs the permission a command needs, and keyless turns pass their permission mode to claude.

Changes

  • CronCreate asks the permission a command needs and CronDelete the permission a write needs. Plan mode and headless default-mode runs refuse both. Listing stays open.
  • The cron scheduler starts only for interactive sessions.
  • ProviderRequest carries the turn's permission mode, and the keyless claude transport passes it as --permission-mode. A request that names no mode runs as plan.
  • New tests: tools/tests/cron_permission.rs, additions to cli/tests/engine_contract.rs, and terminal case 20_scheduled_prompt.sh.

Validation

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets --locked -- -D warnings (Rust 1.100.0 and 1.99.1): clean
  • cargo test --workspace --locked --no-fail-fast with a throwaway HOME: no failures
  • Terminal suite at 120x40 and 80x24: 256 of 256 at each size
  • Not run locally: Windows and Linux. Hosted checks cover them.

Part of v0.9.1.

Scheduling a prompt (CronCreate) now asks the permission a command
needs, and cancelling one (CronDelete) the permission a write needs.
Plan mode and headless default-mode runs refuse both. Listing stays
open.

The cron scheduler starts only for interactive sessions. A headless run
is one turn under that turn's permission, and nothing a scheduled prompt
did would reach its output stream.

ProviderRequest carries the turn's permission mode. The keyless claude
transport passes it as claude's own --permission-mode (plan, default,
acceptEdits, bypassPermissions), so claude's settings can no longer
widen a read-only turn, and a full turn is no longer refused. A request
that names no mode, such as /review or /rename, runs as plan.

The existing cron tests now run with full permission, which scheduling
needs. New tests cover scheduling under each mode, the mode reaching
the keyless transport, and headless runs not firing scheduled prompts.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 14, 2026 5:40am UTC

Request Review

@BunsDev
BunsDev merged commit 75d55c0 into main Nov 14, 2026
15 checks passed
BunsDev added a commit that referenced this pull request Nov 15, 2026
Brings in v0.9.1, including #471, which makes the keyless transport pass
each turn's permission mode to the CLI as `--permission-mode`.

One conflict, in `spawn_turn` in `providers/claude_cli.rs`: both sides
changed the argument list. Resolved by keeping both, main's
`build_args(model, resume, permission)` followed by the policy arguments.

This commit is the mechanical resolution only. The policy can still name
a permission mode of its own here, which would put two on the command
line, and the pipes fixture fails on that. The next commit removes the
mode from the policy.

Co-Authored-By: Cody <cody@opencoven.ai>
Coven-Familiar: cody
Coven-Harness: Claude Code / claude-fable-5-2
Signed-off-by: Val Alexander 👑 <val@opencoven.ai>
BunsDev added a commit that referenced this pull request Nov 15, 2026
Since #471 the keyless transport passes each turn's permission mode to
the CLI. Coven's policy object also named one, so a policy launch would
have carried `--permission-mode` twice, and which one applied depended on
the CLI's argument parsing.

The policy no longer names a mode. `build_args` is the only place the
flag comes from, and it carries the turn's own mode. The policy object
now refuses unknown fields, so a Coven that still sends `permissionMode`,
or any later field this engine does not know, fails the turn instead of
having part of its policy dropped. Nothing released sends the old shape.

The pipes fixture checks, with and without a policy, that the CLI
receives exactly one `--permission-mode`.

Refs OpenCoven/coven#1738

Co-Authored-By: Cody <cody@opencoven.ai>
Coven-Familiar: cody
Coven-Harness: Claude Code / claude-fable-5-2
Signed-off-by: Val Alexander 👑 <val@opencoven.ai>
BunsDev added a commit that referenced this pull request Nov 15, 2026
The CLI applies allow rules in plan mode as well. Coven's policy allows
`touch`, `cp`, `mv` and a few more without asking, so a read-only turn
that was handed the policy could still create and move files: in a real
run through Coven, `touch` wrote a file in a `plan` turn. That undoes
what #471 set out to do for read-only turns.

The policy object now names two settings files. A turn that reaches the
CLI as `plan` gets `readOnlySettingsFile`, which carries the refusals
and no allow list. Every other turn gets `settingsFile`. The field is
required, and both files are checked on every turn, so a policy without
the read-only file is refused instead of leaving read-only turns with
the allow list.

`cli_permission_mode` now maps the turn's mode in one place, for both
`--permission-mode` and the choice of file.

Refs OpenCoven/coven#1738

Co-Authored-By: Cody <cody@opencoven.ai>
Coven-Familiar: cody
Coven-Harness: Claude Code / claude-fable-5-2
Signed-off-by: Val Alexander 👑 <val@opencoven.ai>
BunsDev added a commit to OpenCoven/coven that referenced this pull request Nov 15, 2026
The engine now passes each turn's own permission mode to Claude Code
(OpenCoven/coven-code#471). `COVEN_CLAUDE_POLICY` also named one, so an
engine launch would have carried `--permission-mode` twice.

The policy object no longer has `permissionMode`, and the helper that
mapped Coven's permission to Claude Code's name goes with it. The engine
gets the permission the way it always has, as its own `--permission-mode`
argument, and hands it on. The `claude` harness path is unchanged: Coven
passes the mode there itself, once.

The matching engine change refuses a policy that still names a mode, so
the two sides cannot disagree silently. Nothing released sends the old
shape.

Refs #1738

Co-Authored-By: Cody <cody@opencoven.ai>
Coven-Familiar: cody
Coven-Harness: Claude Code / claude-fable-5-2
Signed-off-by: Val Alexander 👑 <68980965+BunsDev@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 01a132fa Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant