Repository navigation
feat(acp): an agent can run each chat's own permission mode itself - #28455
Conversation
|
Some agents enforce Ask or Full access themselves, but Orca had no way to set that choice when a chat starts or reopens. This PR adds an optional Agent Client Protocol (ACP) declaration, applies the choice after saved settings are restored, and sends any remaining permission request to the person. No agent uses the declaration yet, so existing chats have no visible change. The review reproduced one dormant contract defect: a successful reply could omit the requested mode or report a different value, while startup still succeeded. Fixed in Two review rounds, the architecture challenge, final readiness checklist, and dedicated performance scan are complete with no remaining findings. Local validation passed 75 tests across seven ACP suites, 11 scripted contract probes, Electron QA is N/A because no agent enables this field. The new permission flow was tested with scripted agents; a real declaring agent, rendered chat UI, live remote execution, and performance timings were not exercised here; the later agent activation PR owns its recorded integration coverage. No other code findings were deferred, the parent PR was left untouched, and this PR was not merged. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
71580ab to
a955b2d
Compare
|
Orca could not pass a chat's own permission choice to an Agent Client Protocol (ACP) agent that enforces approvals itself. This PR adds a generic mapping: the host applies the chat's choice, falls back to Ask for missing or unmapped choices, and refuses to start if the agent does not confirm it. Requests from a declaring agent use the existing approval/question surface instead of Orca automatically answering them. No production agent opts in yet, so this PR changes no visible picker, tabs, focus, setup, or notices. PR 8 adds the enabled agent and owns live picker QA.
Ready for review; no merge performed. |
e73668c to
a94f0d1
Compare
411d720 to
f05f141
Compare
a94f0d1 to
a6cc794
Compare
f05f141 to
a341356
Compare
a6cc794 to
6b74006
Compare
a341356 to
5b1bd65
Compare
6b74006 to
6873ffe
Compare
5b1bd65 to
f9b8f4c
Compare
6873ffe to
80b124d
Compare
f9b8f4c to
4abb999
Compare
80b124d to
4c5c7ce
Compare
4abb999 to
85ab473
Compare
4c5c7ce to
6b4c263
Compare
85ab473 to
2162aaa
Compare
6b4c263 to
f090b03
Compare
2162aaa to
e6d2b82
Compare
e6d2b82 to
e5c1e2a
Compare
36a9859 to
47613e5
Compare
c328a27 to
529047a
Compare
47613e5 to
b4ca6d9
Compare
7d2c41d to
5cb96ec
Compare
b4ca6d9 to
3495a4e
Compare
5cb96ec to
e6b585a
Compare
3495a4e to
1ab34a3
Compare
e6b585a to
ad82282
Compare
1ab34a3 to
6aecbf4
Compare
ad82282 to
929a0a4
Compare
7775094 to
e2abbf0
Compare
929a0a4 to
5707583
Compare
e2abbf0 to
4f767db
Compare
5707583 to
2d88838
Compare
4f767db to
fdbb87d
Compare
2d88838 to
49fe731
Compare
fdbb87d to
796e987
Compare
…session config option An optional launch-spec field names the session config option and its ask/full values. Every new or reopened session gets the value for the chat's full-access posture before it is exposed, and a refusal fails the start. With the field present Orca no longer answers permission requests for the person. No agent sets it yet.
…t's own mode The launch spec maps each chat permission mode to its session option value; a start sets the value for the mode the host launches with (ask when it names none), replacing the global Agent Permissions full-access read. A mid-chat change takes effect through the host's existing restart of a child launched with another mode before the next send.
…option, whatever the agent names it
49fe731 to
d57b9b2
Compare
ELI5
Antigravity chats need Google's separate Antigravity chat server. An earlier version of this stack downloaded it silently the first time a chat started: about 18 seconds of "Working for Ns" with no progress and no Cancel, and every extra chat opened started another download. Now nothing downloads until the person clicks Install, which shows the size, progress and Cancel in Settings and in the new chat.
This PR covers permissions. Some chat agents, Antigravity's server among them, enforce permissions themselves: Orca tells the agent which of its own modes to run in, and the agent decides when to ask. Main has a per-chat permission picker (Ask for approval, Accept edits, Approve for me, Full access), but Orca had no way to hand that choice to such an agent. This PR lets an agent map each picker choice to one of its own modes. No agent uses it yet; Antigravity (#28595) is the first.
What Changed
This revision (moving to the common pattern): each agent's spec had to name its mode option's id (
configId), so a server that renamed the option would have been sent the wrong one. The mode option is now found the way the common pattern finds it: the session's select option in the standardmodecategory, whatever the agent calls it (falling back to the idmode). Antigravity's option ismodein that category, so its behavior is unchanged.permissionModeConfig: the agent's own value for each Orca mode it supports, set on the session'smode-category option. An Ask value is required. Every start, new or reopened, sets the value for the chat's mode after restoring the chat's saved options. The start fails with "Permission mode could not be confirmed" if the agent doesn't report that value back. A chat with no mode, or with a mode the spec doesn't map, runs the Ask value, so the agent never gets more access than the person chose.Why
The per-chat picker already owns the choice, where it is saved, and how a change reaches the host. Mapping that choice onto the agent's own modes reuses all of it: no second permission setting and no new message between client and host. Letting the agent enforce its own mode, rather than having Orca approve each request, keeps the agent's own rules about what counts as an edit and what counts as a command.
Linked Issue
N/A (maintainer; part of the Antigravity Chat UI stack).
Visual Proof
N/A: no agent sets the new field yet, so nothing visible changes. The picker for Antigravity arrives with #28595.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
One test through the real adapter, with an agent whose mode option has a non-standard id: a start in Accept edits sets the mapped value on that option, a start naming no mode requests the Ask value, and an agent that doesn't confirm the value fails the start. It fails if the chat's mode is ignored.
pnpm tc:node, the ACP and shared test folders (13,835 tests) and the code-quality gate passed.Review
Agent skill upstream boundary
Notes
Differences from the common pattern
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)