Skip to content

feat(agent-tools): open a terminal child in the agent's own accept-edits or auto mode (FAP presets) - #5100

Merged
devswha merged 2 commits into
mainfrom
feat/fap-presets
Nov 30, 2026
Merged

devswha merged 2 commits into
mainfrom
feat/fap-presets

Conversation

@devswha

@devswha devswha commented Nov 30, 2026

Copy link
Copy Markdown
Owner

What

@code-yeongyu's #5093, rebased on main (after #5075) with one maintainer commit from its review round on top. His commit keeps his authorship; the review fixes could not be pushed to his branch (GitHub answered permission denied), so they land here instead. Thank you, @code-yeongyu.

FAP permission presets accept-edits and auto open a Claude Code or OmO terminal child in that agent's own mode of that name, pinned by its launch, for a lead agent only:

Harness accept-edits auto
Claude Code (terminal) --permission-mode acceptEdits --permission-mode auto
OmO (terminal) --permission-preset accept-edits --permission-preset auto
anything else unsupported unsupported

Review round (omo gate + Codex via the team proxy, gpt-6.2-sol-fast xhigh)

Supply chain: no dependency, lockfile, workflow or script change, no network call, no code taken from elsewhere.

Fixed in the maintainer commit:

  • Claude Code tells its mode only with a prompt (2.1.330's SessionStart carries none), so a child could take its first prompt in another mode (Manual, when auto is unavailable). The approval hub now answers the UserPromptSubmit hook of a preset child with decision: block when the told mode is not the pinned one, so that prompt never runs; later sends are refused as before (mode_changed).
  • A preset wider than read-only on another PC is refused before any card (it was dropped silently).
  • permission_preset: "full-access" on the terminal wire opens the write mode (it opened the ordinary mode); mode: "write" with another preset is refused.
  • An explicit preset on a wire that cannot hold it is refused again, read-only too for an agent that runs everything unasked (Prime Agent); harnesses lists no preset for such an agent.
  • The preset is stored in its own ledger field (preset), not as a new value of mode: a build from before presets still reads children.json after a rollback.
  • Harness gains presets in the generated types.
  • Tests: the drift refusal, the prompt block, full-access, conflicting fields, the cross-PC refusal, the face success path, and a contract test that each preset's pinned value is what the real hook told.

Real-agent verification (isolated HOME, team proxy, cheap model)

  • Claude Code 2.1.330 (claude -p, claude-haiku-4-5): its hook told acceptEdits for --permission-mode acceptEdits, auto for auto, and default for manual; recorded in server/agent-tools/fixtures/claude-2.1.330-preset-modes.json.
  • OmO 5.1.86 (omo -p): accept-edits wrote the file unasked, auto still asked before the edit, read-only refused; recorded in server/agent-tools/fixtures/omo-5.1.86-preset-modes.json.
  • Without Lead agents, accept-edits and auto answer not_granted (scope_denied in the FAP face).

The open question in #5093

thread_read keeps permission_preset: "read-only" for the ordinary mode, the nearest of the spec's four values (a client may treat the list as closed), and every thread view now also tells ovis.mode: ordinary (asks a person), write, accept-edits or auto. docs/fap.md says so.

Checks

On this branch: typecheck green, generated types fresh, bun test of server/agent-tools, server/approvals, the conventions, changelog and plugin-agent tests: 497 pass, 0 fail.

Supersedes #5093.

code-yeongyu and others added 2 commits December 1, 2026 01:00
…its or auto mode (FAP presets)

A lead agent asking permission_preset accept-edits or auto gets a terminal child whose launch pins the agent's own mode of that name (Claude Code --permission-mode acceptEdits/auto, OmO --permission-preset accept-edits/auto), held by the same mode checks; harnesses lists per harness the presets it can hold.
From the omo gate and Codex reviews of #5093:
- a Claude prompt told in another mode than the preset's launch pinned is stopped before it runs
  (the hub answers its UserPromptSubmit hook with a block); Claude tells no mode before the first prompt
- a preset wider than read-only on another PC is refused before any card
- permission_preset full-access on the terminal wire opens the write mode; mode write with another preset is refused
- an explicit preset on a wire that cannot hold it is refused again, read-only too for an agent that never asks
- the preset is kept in its own ledger field, so a build from before presets still reads children.json
- harnesses lists no preset for an agent that runs unasked; Harness gains presets in the generated types
- thread views tell ovis.mode (ordinary, write, accept-edits, auto) beside the spec's permission_preset
- fixtures of the live runs: what Claude Code 2.1.330's hook told per launch mode, OmO 5.1.86 per preset
- docs: OmO is held by its launch flag alone; Claude's hook refuses a drifted prompt
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9e186d8 and 4fe3983.

Files ignored due to path filters: 1

  • shared/harness-contract.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 21

  • changelog.d/fap-presets-own-mode.md
  • docs/fap.md
  • server/agent-tools/cross-pc.test.ts
  • server/agent-tools/drivers/terminal.test.ts
  • server/agent-tools/drivers/terminal.ts
  • server/agent-tools/fap-face.test.ts
  • server/agent-tools/fap-face.ts
  • server/agent-tools/fixtures/claude-2.1.330-preset-modes.json
  • server/agent-tools/fixtures/omo-5.1.86-preset-modes.json
  • server/agent-tools/harnesses.ts
  • server/agent-tools/hub.test.ts
  • server/agent-tools/hub.ts
  • server/agent-tools/lead.test.ts
  • server/agent-tools/ledger.ts
  • server/agent-tools/view.ts
  • server/approvals/claude.test.ts
  • server/approvals/claude.ts
  • server/approvals/hub.ts
  • shared/agents/claude.json
  • shared/agents/omo.json
  • shared/harness-contract.schema.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha
devswha merged commit 799710f into main Nov 30, 2026
22 checks passed
@devswha
devswha deleted the feat/fap-presets branch November 30, 2026 17:07
@devswha

devswha commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 4fe3983b9. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

main moved but untouched: merged without update. Its new commits up to 001f51b68 change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.

External PR by @code-yeongyu (his #5093, auto-closed when its base branch was deleted; his commit kept). Reviews on his head 9e110d6: omo gate (BLOCK: 2 MEDIUM) and Codex via the team proxy (gpt-6.2-sol-fast xhigh: no HIGH, 5 MEDIUM, 2 LOW); supply-chain clean; real Claude Code 2.1.330 and OmO 5.1.86 runs verified. One maintainer fix round (4fe3983) fixed every MEDIUM. Owner approved code-yeongyu's FAP PRs as a class (2026-12-01); lead asked to merge with pr-merge --update. LOW leftovers: none open.

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.

2 participants