fix(server): ACP auto-approvals allow once instead of always - #13802
Conversation
When the runtime policy approves an ACP permission prompt itself, the adapter answered with the agent's `allow_always` option whenever one was offered. Agents may persist that answer beyond the session: Grok saves its bash and monitor `always-allow` as a project-wide grant, so every prompt T3 auto-approved turned into a lasting allow outside T3's policy. Answer with `allow_once`, and use `allow_always` only when the agent offers no once option. The grok_monitor fixture's recorded answer is updated to the option T3 now sends, and it asserts the choice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR narrowly changes ACP auto-approved permission responses from persistent allow-always grants to single-request allow-once grants, with focused replay coverage. Because this changes authorization and permission lifetime behavior, it warrants human review. You can add or adjust custom eligibility rules. Learn more. |
98400c6
into
t3code/codex-turn-mapping
When T3's runtime policy approves an ACP permission prompt itself, it answers with the agent's
allow_alwaysoption whenever one is offered. Agents may keep that answer beyond the session, so each auto-approved prompt can become a lasting grant outside T3's policy.The recorded
grok_monitorfixture shows it. Under Full access, Grok's monitor prompt offersalways-allow("Yes, and don't ask again for bash commands") andallow-once, and T3 answeredalways-allow. Grok records that as a project-wide grant in~/.grok/sessions/<cwd>/permission_*.toml(crates/codegen/xai-grok-workspace/src/permission/grants.rsrecord_prompt_outcome, at f0e3be1). The grant then applies to that project in any later Grok session, including a Supervised thread or the Grok TUI.What changed
selectAutoApprovedPermissionOptioninAcpAdapterV2prefersallow_onceand falls back toallow_alwaysonly when the agent offers no once option. A policy approval covers one request, which is whatallow_oncemeans in the ACP spec. The change is generic ACP with no per-agent code.Verification
grok_monitorreplay fixture: the recorded T3 answer (anexpect_outboundframe) now readsallow-once, andoutput.tsasserts it. I hand-edited that one outbound frame rather than re-recording, because a fresh live recording today took a different, shorter path (Grok ended the monitor in-turn), which would change the fixture's scenario. Everything Grok sent is unchanged.always-allow, the transcript expectsallow-once) and times out.vp test run src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t "(registry|cursor|antigravity|grok)": 23 passed. The registry fixture already answersallow-oncewhen it is offered first.vp test run src/orchestration-v2/Adapters/{Grok,Acp,AcpRegistry,Antigravity,Cursor}AdapterV2.test.ts src/provider/acp/AcpClientPolicy.test.ts: 169 passed.vp exec tsc --noEmit -p .inapps/server: no errors.knip --workspace apps/server --exports: clean.vp linton touched files: one pre-existing warning on an untouched import.Related: #13796 (the user-facing "Always allow this session" on Grok bash prompts).
Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code