Skip to content

feat(delegate): add --write/--plan delegation permission modes - #23

Merged
datj9 merged 3 commits into
mainfrom
feat/delegation-modes
Sep 8, 2026
Merged

datj9 merged 3 commits into
mainfrom
feat/delegation-modes

Conversation

@datj9

@datj9 datj9 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Why

crossagent could run second-opinion (read-only) delegations but had no ergonomic way to grant an executor write access. Delegated write tasks silently ran read-only — the exact failure crossagent's no-silent-failure ethos exists to prevent. There was also no path an orchestrating Claude agent could use, since the auto-mode classifier blocks the literal --yolo token in a command an agent emits.

What

Advisor-agnostic --write / --plan intents that expand to each advisor's native permission flags.

  • Advisor gains write_args/plan_args tuples + mode_args() / supports_mode(). Built-ins: commandcode --yolo, opencode --auto, claude bypassPermissions, codex --sandbox workspace-write (stock codex exec is read-only, confirmed by probe).
  • --write / --plan / --permission-mode are one argparse mutually-exclusive group, shared by the foreground and start parsers via _add_mode_args.
  • --write on a read-only advisor hard-fails (exit 2), never a silent read-only run. --plan on an advisor with no plan flags warns and uses its default. --write without --allow-path warns about unbounded access.
  • Semantic mode persists to command.json and re-expands against the child advisor on escalation — a --write job escalates to a peer that can also write, or the rung is refused and audited. The independent verifier stays read-only regardless of mode.
  • --list-advisors shows each advisor's write/plan flags.

Verification

  • Full suite: 537 passing (+24 new).
  • ruff format clean on all changed files.
  • Live end-to-end:
    • crossagent start --agent cmd --write --allow-path add.py --check ... → succeeded | check 0 | scope ok, file written within scope.
    • crossagent start --agent codex --write ... → file written (confirms the codex read-only fix).

Notes

  • Two empirical findings: commandcode --permission-mode auto-accept does not enable writes in -p mode (needs --yolo); --allow-path scope enforcement requires a git repo (fails closed otherwise).
  • Reviewed twice (plan + code) by an independent model; all CRITICAL/HIGH items folded in.
  • cline was not added (not installed on this machine; flags/telemetry unverifiable).

🤖 Generated with Claude Code

crossagent could run second-opinion (read-only) delegations but had no
ergonomic way to grant an executor write access, so delegated write tasks
silently ran read-only. Add advisor-agnostic --write/--plan intents that
expand to each advisor's native permission flags.

- Advisor gains write_args/plan_args tuples + mode_args()/supports_mode();
  built-ins: cmd --yolo, opencode --auto, claude bypassPermissions,
  codex --sandbox workspace-write (stock codex exec is read-only).
- --write/--plan/--permission-mode are one mutually-exclusive group, shared
  by the foreground and start parsers.
- --write on a read-only advisor hard-fails (exit 2), never a silent
  read-only run; --plan on an advisor with no plan flags warns; --write
  without --allow-path warns about unbounded access.
- Semantic mode persists to command.json and re-expands against the CHILD
  advisor on escalation; a --write escalation onto a read-only rung is
  refused and audited. Verifier stays read-only regardless of mode.
- --list-advisors shows each advisor's write/plan flags.

Verified live end-to-end with commandcode and codex (--write writes within
--allow-path scope, check + scope gates green). 537 tests pass (+24).
@datj9 datj9 self-assigned this Sep 6, 2026
@datj9
datj9 force-pushed the feat/delegation-modes branch from a4cbef0 to 500dd11 Compare September 8, 2026 08:06
@datj9
datj9 merged commit e70c37a into main Sep 8, 2026
6 checks passed
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