Repository navigation
Agents: store each agent's permission itself; terminals and new chats read it - #31315
Conversation
…flags into Arguments Terminals and new chats read one stored choice per agent (Use the agent's own settings, Ask for approval, Accept edits, Approve for me, Full access). Orca adds the flag at launch; Arguments hold only the user's own text. A one-time move lifts Orca's flags out of saved Arguments. Older clients still see and write the flag as part of Arguments; the host translates.
…keep primitives unstyled
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
608caf23-e8a4-4c6b-91b0-53540483a5e6
📒 Files selected for processing: 59
mobile/src/session/ai-vault-resume-launch.tssrc/main/native-chat/agent-session-wire/at-rest-command-context.tssrc/main/native-chat/structured-agent-configured-args.tssrc/main/orcad/orcad-account-services.tssrc/main/persistence-settings-update.test.tssrc/main/persistence/applying-settings/settings-update.tssrc/main/persistence/loading-store/normalize-loaded-global-settings.tssrc/main/persistence/loading-store/prepare-loaded-profile-settings.tssrc/main/preflight/codex-workspace-relative-path.test.tssrc/main/runtime/agent-launch-settings-rollback.tssrc/main/runtime/runtime-client-agent-launch-settings-durability.test.tssrc/main/runtime/runtime-client-agent-launch-settings.test.tssrc/main/runtime/runtime-client-settings.tssrc/main/runtime/runtime-store-contract.tssrc/main/runtime/session-construction/agent-session/get-agent-session-execution-namespace.tssrc/main/runtime/structured-agent-launch-support.tssrc/main/runtime/workspaces/workspace-process-listing.tssrc/main/startup/main-process-runtime-service.tssrc/renderer/src/components/onboarding/use-onboarding-flow-persistence.tssrc/renderer/src/components/onboarding/use-onboarding-yolo-permissions.tssrc/renderer/src/components/settings/AgentCatalogRow.tsxsrc/renderer/src/components/settings/AgentLaunchDefaultsEditor.tsxsrc/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsxsrc/renderer/src/components/settings/AgentPermissionChoiceControls.tsxsrc/renderer/src/components/settings/agent-launch-settings-transport.tssrc/renderer/src/components/settings/agent-row-permission-model.tssrc/renderer/src/components/settings/chat-permission-search.tssrc/renderer/src/hooks/composer-state/folder-submit-orchestration.tssrc/renderer/src/hooks/composer-state/quick-startup-plan.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/agent-account-restart-startup.tssrc/renderer/src/lib/ai-vault-antigravity-reference-startup.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-parity-workspace-start.test-fixture.tssrc/renderer/src/lib/launch-work-item-direct-agent.tssrc/renderer/src/lib/onboarding-folder-agent-startup.tssrc/renderer/src/store/slices/repos-onboarding-folder-startup.test.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/web/preload-api/web-preference-normalization.tssrc/renderer/src/web/preload-api/web-preferences-store.tssrc/shared/agent-chat-permission-host-support.tssrc/shared/agent-chat-permission-mode.tssrc/shared/agent-launch-permission-updates.tssrc/shared/agent-launch-runtime-capability.tssrc/shared/agent-launch-settings.tssrc/shared/agent-startup-plan-inputs-extra-agent-args.spec.tssrc/shared/agent-startup-plan-inputs.tssrc/shared/ai-vault-resume-startup.tssrc/shared/default-global-settings.tssrc/shared/global-settings-base.tssrc/shared/native-chat-session-option-defaults.tssrc/shared/rpc-contract/agent-launch-settings-params.tssrc/shared/tui-agent-auto-permissions.test.tssrc/shared/tui-agent-launch-defaults.spec.tssrc/shared/tui-agent-launch-defaults.tssrc/shared/tui-agent-permission-choice.test.tssrc/shared/tui-agent-permission-choice.tssrc/shared/tui-agent-permission-lift.tssrc/shared/tui-agent-startup.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Limit the permission toast to terminals. · AgentLaunchSettingsCatalog.tsx:130-135
src/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsx:130-135
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLimit the permission toast to terminals.
claude-agent-teamsis a catalog agent with recognized permission flags, but it has no registered chat permission support. Its inferred mode therefore cannot apply to new chats.🐛 Suggested fix
- '{{agent}} set to {{mode}} in terminals and new chats.', + '{{agent}} set to {{mode}} in terminals.',
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9284077b-9a12-4302-baf0-fdcdda3ab148
📒 Files selected for processing: 39
mobile/src/session/ai-vault-resume-launch.tssrc/main/codex/codex-structured-launch-args.tssrc/main/persistence/loading-store/prepare-loaded-profile-settings.tssrc/main/runtime/runtime-client-agent-launch-settings-durability.test.tssrc/main/runtime/runtime-client-settings.tssrc/renderer/src/components/settings/AgentCatalogRow.tsxsrc/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsxsrc/renderer/src/components/settings/AgentLaunchSettingsSection.test.tsxsrc/renderer/src/components/settings/AgentLaunchSettingsSection.tsxsrc/renderer/src/components/settings/AgentPermissionChoiceControls.tsxsrc/renderer/src/components/settings/ChatBehaviorSetting.test.tsxsrc/renderer/src/components/settings/ChatBehaviorSetting.tsxsrc/renderer/src/components/settings/ChatPermissionSetting.tsxsrc/renderer/src/components/settings/chat-permission-search.tssrc/renderer/src/hooks/composer-state/quick-startup-plan.tssrc/renderer/src/hooks/settings-navigation-build-options.tssrc/renderer/src/hooks/settings-navigation-interface-sections.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/agent-account-restart-startup.tssrc/renderer/src/lib/ai-vault-antigravity-reference-startup.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-work-item-direct-agent.tssrc/renderer/src/lib/onboarding-folder-agent-startup.tssrc/renderer/src/runtime/structured-agent-session-host-capability.tssrc/renderer/src/web/preload-api/web-preference-normalization.tssrc/shared/agent-chat-permission-mode.tssrc/shared/agent-chat-permission-support.tssrc/shared/agent-launch-permission-updates.tssrc/shared/agent-launch-settings.tssrc/shared/agent-permission-args.tssrc/shared/agent-permission-env.tssrc/shared/agent-session-option-agent-args.tssrc/shared/agent-startup-plan-inputs.tssrc/shared/ai-vault-resume-startup.tssrc/shared/tui-agent-launch-defaults.tssrc/shared/tui-agent-permission-choice.test.tssrc/shared/tui-agent-permission-choice.tssrc/shared/tui-agent-permission-lift.ts
🚧 Files skipped from review as they are similar to previous changes: 2
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/settings/AgentCatalogRow.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…rmission-one-setting # Conflicts: # src/renderer/src/web/preload-api/web-preferences-store.ts
…rmission-one-setting # Conflicts: # src/shared/global-settings-base.ts
…rmission-one-setting
|
Permission flags used to double as saved settings inside Arguments, while new chats kept a separate choice. That allowed terminal and chat permissions to drift. This PR stores one typed permission choice per agent, keeps user Arguments separate, and composes supported flags when launching. Existing profiles migrate conservatively; older clients and paired hosts retain their supported launch path. The full review completed six rounds, followed by the accepted bounded correction. Fixes cover required-option operands and raw flag ownership, Codex config aliases, host-specific Goose environment names, acknowledged Arguments/Environment editing and queued Reset, durable remote settings writes, and repeated parsing/projection work. The final reference, performance and readiness source checks found no remaining attributable P0/P1. Evidence and heads. Real Claude and Codex runs exercised startup/replies, History continuity, account-switch restart, previous-build upgrades/restarts and mixed desktop peers. Current compiled Coverage under the changed-flow QA rules. These are tests, not claimed runtime passes:
Intended differences from the common pattern: per-agent Own choice and supported narrowing at each surface; conservative three-shell text ownership; execution-host environment identity (POSIX exact, Windows folded, unknown conservative); capability-gated writes with old-server fallback; acknowledged queued Reset and remote durable writes. These preserve terminal commands, mixed versions and host ownership. Temporary: Own native chats retain the existing Chat default until #32334 / STA-11280. Merging this PR alone ships usable typed permissions; Own native-config parity follows there. Deferred/inherited: Command-field draft/Escape behavior, unusual For Brennan’s review: the permission resolver and precedence, conservative flag extraction, and legacy/new write translation. Settings before / after and Environment reopenCurrent compiled64a3: onboarding, real Claude/Codex replies and WSLOnboarding permission off / Own: Non-git Codex Full, custom argument and actual result: WSL Claude Ask, custom Read tools and actual file/read reply: |


















ELI5
Orca used to remember an agent's permission (Ask, Auto, Yolo) by typing a flag like
--dangerously-skip-permissionsinto that agent's Arguments box. Chats can't run flags, so they kept a second, separate copy of the setting, and the two drifted apart. Now Orca stores each agent's permission itself. Terminals add the flag when they launch, new chats start in the same mode, and the Arguments box holds only what you typed.What Changed
The problem.
--permission-mode autointo Settings → Agents → Arguments to get Claude Auto in chats. Terminals honored it. Chats silently ran Ask (tracked in [Feature]: Support the intermediate permission modes — Claude Code "Auto" mode and Codex "Approve for me" #13081).--model opusin Arguments made the permission read as "mixed", so Settings showed Yolo while Claude asked before every action ([Bug]: Terminal-backed Chat UI ignores Claude agentDefaultArgs permission mode #23853, [Bug]: Windows: Agent Permissions cannot switch from Yolo to Manual in Orca 1.4.215 #23387).What you see now (Settings → Agents).
Agent Permissions uses the chat's wording: Own settings · Ask for approval · Approve for me · Full access. It applies to every agent, in terminals and new chats. With Approve for me selected, a second row, Agents without Approve for me, sets the agents that lack it.
Each agent has a Permissions menu showing Same as all agents · X, Use <Agent>'s own settings, and each mode that agent's CLI can take. Agents with their own choice get a badge in the list.
The Arguments box shows the permission flag as a chip at the start of the box. Removing the chip (×) switches that agent to its own settings. If you type a permission flag Orca recognizes, it becomes the agent's setting and moves into the chip, and a toast says so.
If your Arguments set permissions in a way Orca doesn't map (for example
--permission-mode plan), the text stays as you wrote it. Terminals use it, and a note says chats use the Permissions menu instead.New chats start in the agent's permission. An agent set to its own settings keeps today's chat behavior: the Settings → Chat default, or feat(native-chat): apply per-agent Auto permission defaults #30853's per-agent copy. That page's description now says so.
"Use <agent>'s own settings" means Orca adds no permission flag, and the agent's own config (Claude
permissions.defaultMode, Codexconfig.toml) applies.Ask is now an explicit flag where the CLI has one:
--permission-mode default-a on-request -s workspace-write -c approvals_reviewer=user, matching what an Ask chat statesAgents without an Ask flag offer only their own settings and Full access.
One-time move. At load, each profile's saved Arguments are read once:
GOOSE_MODE=autobecomes Full access. Environment names match exactly on POSIX, case-insensitively on Windows, and conservatively when the execution platform is unknown; other entries are kept.Older clients and hosts.
settings.getandsettings.getAgentLaunch, and Goose's env the same way.arguments,permissions(Manual/Auto/Yolo), environment andsettings.updatewrites.permission/user-argumentsmutations only to hosts that advertisesettings.agent-permission.v1. Older hosts keep the existing Agents page and mutations.Mechanism.
agentPermissionDefaultandagentPermissionOverrides. The presence ofagentPermissionDefaultmarks a profile as moved, so there is no third flag.resolveTuiAgentLaunchArgs/resolveTuiAgentLaunchEnv, which now takes the settings slice.Why
This removes the structural fact behind #20977, #23853, #23387, #28100, #30853 and #30914's neighbours: a permission stored as free text that every reader re-parses, plus a second copy for chats. The flag-to-setting conversion happens on the host's write path, so every writer gets the same rule: old desktop clients, web, phone and CLI.
Differences from the common pattern, labelled:
Linked Issue
Tracked in #13081. Related: #23853, #23387, #30853, #30449 (chats never translate free-text CLI flags; unchanged here), #24508 (earlier stale attempt at typed storage; its classifier and cut checks are reused here).
Visual Proof
Before, main-created preset:
After upgrade:
The review status comment includes real agent replies, restart/History, WSL and carried migration/paired-host screenshots.
Testing
src/shared/tui-agent-permission-choice.test.tscovers:--model opusplus the flag, empty Arguments, an unrecognized permission flag, Goose env under different capitalisation, quoted text64a3fcca0ec; earlier unchanged-flow evidence on70a4dfb3054carries under the current QA rules. Later commitsd21945388aeand155f39cea26are tests only; merges53310be9a31and5ce507820a6retain runtime evidence.AI Disclosure
Review
Full review: six historical rounds plus the accepted bounded correction; final source/reference/performance/readiness reconciliation complete. Fixed raw flag ownership, environment identity, editor acknowledgement/Reset and repeated parsing/projection work. The one review status comment records the full test/runtime mapping, inherited limitations, evidence heads and final CI.
Agent skill upstream boundary
Notes
Author: Brennan Benson (@BrennanKB5)
Checklist