Skip to content

feat(agents): add Auto to the global agent permission switch - #30677

Merged
nwparker merged 4 commits into
mainfrom
nwparker/codex-auto-mode
Oct 20, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/codex-auto-mode

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​585 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​554
Prod 22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​829 $\color{#cf222e}{\Huge{\mathbf{−}}}$​288 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​541

ELI5

Settings → Agents now has one permission switch with three choices: Manual | Auto | Yolo. Auto lets the agent approve routine actions itself; it works for Claude, Claude Agent Teams, and Codex. When you pick Auto, a small Other agents control appears so you choose what every other agent does. This PR changes how new terminal launches start. Native-chat integration is stacked in #30853.

What Changed

Before: the global switch offered only Manual or Yolo. Getting Auto meant hand-editing an agent's command arguments, and one agent with custom arguments left the switch permanently "mixed."

After:

  • Global switch: Manual | Auto | Yolo. A "Supported agents" tooltip lists the agents Auto applies to (Claude, Claude Agent Teams, Codex).
  • Other agents. Selecting Auto slides in an "Other agents [Manual | Yolo]" control, right-aligned beneath the switch. It changes only the agents that can't use Auto.
  • Mixed state. When agents disagree, no segment is selected and the description names the majority mode. Rows that differ show a badge (Manual / Auto / Yolo / Custom); clicking one opens the row with its own Permissions control. Rows with custom launch arguments offer "Replace with {mode}" instead of silently overwriting them.
  • Custom arguments are respected. Agents with custom launch arguments are left out of the summary and kept as-is by bulk changes.
  • Older hosts. If the host Orca is too old to understand Auto, the Auto segment is disabled with an inline note: "Auto needs a newer Orca on this host."
  • Row layout. Agent names no longer collide with the controls below ~1000px; a min-width that never took effect was removed.

Mechanism: the existing global permissions mutation gains an optional exceptAuto flag, which the Other agents control uses to update only non-Auto agents. The client sends it only to hosts that advertise the Auto capability (also new in this PR), so no older host ever receives it. The settings projection gains an optional nonAutoPermissionMode field; older clients ignore it. Each agent's change is still saved as that agent's CLI flags. Native-chat defaults and existing chats are unchanged here.

Why

Auto is a per-agent capability, but people think about permissions as one choice. Putting Auto in the global switch keeps that one choice, while the tooltip and the Other agents control make clear that it doesn't apply to every agent.

Alternatives we rejected:

  • A "Set defaults…" menu plus a dropdown on each supported row (the previous version of this PR): it hid the common choice behind a menu and added noise to every row.
  • A separate "Use Auto where supported" switch: two global switches can contradict each other, so it's hard to tell what an agent will actually do.
  • Placing "Other agents" to the left of the main switch: it read as the primary control and crowded the row. Below and right-aligned, it reads as a follow-up to choosing Auto.

Linked Issue

Refs #13081 — Claude Code Auto and Codex Approve for me. The stacked native-chat PR #30853 also addresses #25559.

Visual Proof

Real Orca Electron renderers, captured with Playwright CDP. The Mixed and tooltip captures were taken before native-chat moved to #30853; this PR's UI is identical, because #30853 only changes what is saved for chats.

Before (main) After: Auto
Before: Manual / Yolo only After: Auto with Other agents
More states

Yolo

Yolo selected

Supported agents tooltip

Supported agents tooltip

Mixed: no segment selected, exception badges on differing rows

Mixed state

Row opened from its badge, with its own Permissions control

Row expanded

Custom-arguments row: "Replace with {mode}"

Custom-arguments row expanded

Older host: Auto disabled with an inline note

Auto unsupported on this host

Light theme

Light theme

Narrow window

Narrow window

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

On macOS, with background launches:

  • pnpm tc passed.
  • About 15.7k vitest tests in the touched areas passed, covering the mutation with and without exceptAuto, custom-argument preservation, mixed-state summaries, the older-host gate, and the backward-compatible projection.
  • tests/e2e/agent-auto-permissions.spec.ts passed headless.
  • Changed-code quality gate, localization check, and RPC params catalog check passed.
  • Inspected the rendered settings UI through CDP screenshots in light, dark, and a narrow window.

Full repository lint/test/build remain for CI. Platform and host paths have automated coverage; live Linux/Windows/SSH validation was not performed.

Review

Stack: merge this settings PR first, then #30853 for native-chat integration. #19244 overlaps agent rows and permission mappings; reconcile its global presets with this switch. #14745 concerns Claude's live native-chat permission picker and is relevant to the second PR.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material copied or translated.

Notes

Auto requires CLI support. Mixed versions: exceptAuto is sent only to hosts advertising Auto, and older clients ignore nonAutoPermissionMode. No git-provider behavior or stream opcode changed.

Checklist

  • This PR is small and focused
  • Explained before/after, mechanism, and approach
  • Before/after visual proof attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and compatibility impact considered
  • Local checks listed above; CI covers remaining repository gates

@nwparker nwparker changed the title feat(agents): add Auto permissions for Claude and Codex feat(agents): configure Auto permissions per supported agent Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ac38280-f69b-439f-8596-91c5a1f2829d
📥 Commits

Reviewing files that changed from the base of the PR and between df620b1 and 7de2bc4.

📒 Files selected for processing: 1
  • tests/e2e/agent-auto-permissions.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The changes add Auto permission mode and per-agent permission controls for terminal agents. Shared settings logic resolves and projects Auto and non-Auto modes, and the renderer displays global settings, per-agent controls, and exception badges. Host capability checks gate scoped permission mutations. Tests cover permission resolution, host support, launch arguments, UI behavior, and saved settings.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 7de2b

No actionable merge-blocking risk was identified; the unexecuted E2E path remains normal validation follow-up.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 30.19% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 52 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: adding Auto to the global agent permission switch.
Description check Passed The description is complete and relevant. It covers the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility, review context, and checklist. The linked issue uses…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and relevant. It covers the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility, review context, and checklist. The linked issue uses “Refs #13081” instead of the template’s preferred “Fixes #” format, and the AI Disclosure section is omitted, but these do not prevent the description from being mostly complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the nwparker/codex-auto-mode branch from 77352a0 to fc03f7f Compare October 19, 2026 19:56
@nwparker nwparker changed the title feat(agents): configure Auto permissions per supported agent feat(agents): configure Auto terminal permissions per supported agent Oct 19, 2026
…xceptions

Replace the Set defaults menu and inline per-row dropdowns with a global
Manual | Auto | Yolo switch. Auto reveals an Other agents control beneath it,
mixed states badge exceptions, and each row's expanded panel owns its
per-agent permission choice.
@nwparker nwparker changed the title feat(agents): configure Auto terminal permissions per supported agent feat(agents): add Auto to the global agent permission switch Oct 19, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 894e5a58-4400-40fc-8bb5-a96074b43d09
📥 Commits

Reviewing files that changed from the base of the PR and between 77352a0 and 6a222db.

📒 Files selected for processing: 28
  • src/renderer/src/components/settings/AgentCatalogRow.tsx
  • src/renderer/src/components/settings/AgentLaunchSettingsCatalog.tsx
  • src/renderer/src/components/settings/AgentPermissionsSetting.tsx
  • src/renderer/src/components/settings/AgentRowPermissions.tsx
  • src/renderer/src/components/settings/AgentsPane.test.tsx
  • src/renderer/src/components/settings/AgentsPane.tsx
  • src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx
  • src/renderer/src/components/settings/SettingsFormControls.tsx
  • src/renderer/src/components/settings/agent-launch-settings-transport.ts
  • src/renderer/src/components/settings/agent-permission-baseline.ts
  • src/renderer/src/components/settings/agent-permission-mode-label.ts
  • src/renderer/src/components/settings/agent-row-permission-model.ts
  • src/renderer/src/components/settings/agents-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-launch-runtime-capability.ts
  • src/shared/agent-launch-settings-auto-projection.test.ts
  • src/shared/agent-launch-settings-permissions.test.ts
  • src/shared/agent-launch-settings.ts
  • src/shared/rpc-contract/agent-launch-settings-params.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts
  • tests/e2e/agent-auto-permissions.spec.ts
  • tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts
💤 Files with no reviewable changes: 5
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/ja.json
🚧 Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/components/settings/agents-search.ts
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment on lines +146 to +156
export function resolveAgentPermissionModeSummary(
args: AgentPermissionSettings
): AgentPermissionMode {
const presets = presetPermissionModes(args)
const autoModes = presets.filter(({ agent }) => agent in AUTO_TUI_AGENT_ARGS)
// Auto changes only supporting agents, so the rest keep their existing permission policy.
if (autoModes.length > 0 && autoModes.every(({ mode }) => mode === 'auto')) {
return 'auto'
}
return combinePermissionModes(presets.map(({ mode }) => mode))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '170,205p' src/shared/tui-agent-permissions.ts
rg -n "onboarding(Completed|Complete|Version|Dismissed)|showOnboarding|reopenOnboarding|restartOnboarding|replayOnboarding" src/renderer/src src/shared src/main | head -40
sed -n '1,60p' src/renderer/src/components/onboarding/use-onboarding-yolo-permissions.ts

Repository: stablyai/orca

Length of output: 6574


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- onboarding files ---'
rg --files src/renderer/src/components/onboarding src/renderer/src/components/sidebar | sort
printf '%s\n' '--- show action and menu caller ---'
sed -n '1,140p' src/renderer/src/components/onboarding/show-onboarding-event.ts
sed -n '110,165p' src/renderer/src/components/sidebar/SidebarSettingsHelpMenu.tsx
printf '%s\n' '--- onboarding references and mounts ---'
rg -n -F --glob '*.{ts,tsx}' -e 'showOnboardingFromRenderer' -e 'Onboarding' -e 'onboarding' src/renderer/src/components/onboarding src/renderer/src | head -200
printf '%s\n' '--- persistence block ---'
sed -n '1,235p' src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts
printf '%s\n' '--- onboarding tests around entry and persistence ---'
sed -n '1,230p' src/renderer/src/components/onboarding/use-onboarding-flow-persistence.test.ts

Repository: stablyai/orca

Length of output: 42582


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- reopen action ---'
nl -ba src/renderer/src/components/onboarding/show-onboarding-event.ts
printf '%s\n' '--- settings menu caller ---'
nl -ba src/renderer/src/components/sidebar/SidebarSettingsHelpMenu.tsx | sed -n '125,155p'
printf '%s\n' '--- render gate and flow entry ---'
nl -ba src/renderer/src/components/onboarding/should-show-onboarding.ts
rg -n -F --glob '*.{ts,tsx}' -e 'shouldShowOnboarding' -e 'onboarding-reopened' -e 'OnboardingFlow' src/renderer/src/components/onboarding src/renderer/src | head -80
printf '%s\n' '--- agent persistence exact block ---'
nl -ba src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts | sed -n '170,210p'
printf '%s\n' '--- permission replacement exact block ---'
nl -ba src/shared/tui-agent-permissions.ts | sed -n '175,220p'

Repository: stablyai/orca

Length of output: 16207


Preserve Auto permissions when onboarding is reopened.

The Settings help menu can reopen onboarding after Auto is configured. The reopened flow resets to the agent step, where auto is treated as Yolo and replaces Auto arguments with dangerous-skip arguments. Preserve the saved Auto configuration until the user changes the permission toggle.

Suggested fix
-import { applyAgentPermissionMode } from '../../../../shared/tui-agent-permissions'
+import {
+  applyAgentPermissionMode,
+  resolveAgentPermissionModeSummary
+} from '../../../../shared/tui-agent-permissions'
...
      if (currentStepId === 'agent') {
        const defaultTuiAgent = selectedAgentOrBlank(selectedAgent)
+       const preserveAutoPermissions =
+         !yoloPermissionsChosen.current &&
+         resolveAgentPermissionModeSummary({
+           agentDefaultArgs: settings.agentDefaultArgs,
+           agentDefaultEnv: settings.agentDefaultEnv
+         }) === 'auto'
        await updateSettings({
          defaultTuiAgent,
-         ...applyAgentPermissionMode({
-           mode: yoloPermissions ? 'yolo' : 'manual',
-           agentDefaultArgs: settings.agentDefaultArgs,
-           agentDefaultEnv: settings.agentDefaultEnv
-         }),
+         ...(preserveAutoPermissions
+           ? {}
+           : applyAgentPermissionMode({
+               mode: yoloPermissions ? 'yolo' : 'manual',
+               agentDefaultArgs: settings.agentDefaultArgs,
+               agentDefaultEnv: settings.agentDefaultEnv
+             })),

@nwparker
nwparker merged commit 8d05016 into main Oct 20, 2026
43 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