Skip to content

feat(agents): add intermediate Auto permission mode across supported harnesses - #13348

Closed
drvitalaraujo wants to merge 5 commits into
stablyai:mainfrom
drvitalaraujo:feat/agent-permission-auto-mode
Closed

drvitalaraujo wants to merge 5 commits into
stablyai:mainfrom
drvitalaraujo:feat/agent-permission-auto-mode

Conversation

@drvitalaraujo

@drvitalaraujo drvitalaraujo commented Aug 9, 2026 •

Copy link
Copy Markdown

What

Adds an intermediate Auto agent-permission preset between Manual and Yolo. Closes #13081.

Today the global preset is binary: Manual (approve everything) or Yolo (fully permissive flags such as --dangerously-skip-permissions / --dangerously-bypass-approvals-and-sandbox). Both Anthropic and OpenAI actually recommend a middle ground — Claude Code's Auto mode and Codex's "Approve for me" — and most other harnesses ship an equivalent. This PR makes that middle ground selectable.

User-visible changes

  • Settings → Agents: the Agent Permissions segmented control is now Manual / Auto / Yolo (was Yolo / Manual).
  • Onboarding agent step: the old "Yolo / Dangerously skip permissions" checkbox is replaced with the same Manual / Auto / Yolo segmented control, so both surfaces share one vocabulary.
  • A profile with custom launch-arg overrides ("mixed") now renders with no selected segment in settings and onboarding, and simply continuing onboarding no longer rewrites it — previously a mixed profile was silently converted to Yolo. A preset is only applied when the user explicitly picks one.

Auto presets per agent (vendor-documented flags)

Agent Auto launch preset Source
claude, claude-agent-teams --permission-mode auto verified against claude --help (agent-teams launches the claude binary)
openclaude --permission-mode auto Claude-Code-compatible flag surface
antigravity --mode=accept-edits Antigravity CLI permission mode
codex --approve-for-me verified against codex --help
grok --permission-mode auto verified against grok --help
gemini --approval-mode auto_edit gemini-cli docs
qwen-code --approval-mode auto qwen-code docs
devin --permission-mode smart docs.devin.ai
goose env GOOSE_MODE=smart_approve goose permission modes

Agents researched and confirmed to have no single intermediate CLI preset intentionally fall back to manual (never escalated to yolo) when Auto is selected: copilot, amp, rovo, cline, cursor, kimi, aider, crush, continue, kiro, mistral-vibe, hermes, ante, trae, autohand, command-code, prime-agent.

Behavior details

  • AgentPermissionMode gains 'auto'; classification is by exact preset match (empty → manual, yolo preset → yolo, auto preset → auto, anything else → mixed).
  • applyAgentPermissionMode only overwrites args/env that exactly equal a known preset (or are empty). Whitespace-decorated or otherwise custom values are treated as user-authored and never clobbered.
  • Manual overrides inside an otherwise Auto profile are preserved rather than being rewritten to Auto.
  • Codex approval-state notification suppression remains mode-aware, while genuine request_user_input waits continue to surface under Auto/Yolo attribution.
  • Env-based presets (goose) resolve and apply symmetrically with args-based ones.

Remote/compat note

Auto remains encoded as launch args/env inside existing GlobalSettings fields, so no settings schema field was added. Current native, shared-control, and web clients advertise settings.agent-permission-auto.v1. For clients without that capability, the host projects permission settings to Manual and fences agentDefaultArgs / agentDefaultEnv writes while the stored profile contains Auto, preventing a legacy client from widening Auto to Yolo. Unrelated settings continue to round-trip normally.

Tests

  • pnpm typecheck — clean (node, cli, web).
  • pnpm build — clean (desktop, relay, CLI, Electron renderer/main/preload, projected web client, and native platform build).
  • Targeted vitest: 154 tests across 12 files on current main after synchronization, covering shared permission logic, AgentsPane, AgentStep, onboarding persistence, Codex notification suppression, remote version skew, and native/shared-control/web capability handshakes.
  • Localization catalog, extraction, and coverage checks all pass; en/es/ja/ko/zh catalogs use terminology consistent with the visible segment labels.
  • Changed TypeScript/TSX files pass oxlint; max-lines ratchet and git diff --check pass.
  • Full pnpm lint reaches the unchanged upstream verify:skill-bundle-manifest staleness failure after all preceding lint, code-quality, reliability, bundled-skill-guide, and max-lines gates pass; this PR does not modify those generated skill artifacts.
  • Full local pnpm test is environment-blocked on this Windows machine because native module rebuilds require Visual Studio Build Tools; unrelated platform/filesystem failures reproduce on the base commit. Deferring to CI for the full suite.

Screenshots

Onboarding — Agent Permissions (Windows, dark mode)

Orca onboarding showing the Agent Permissions control with Auto selected

Settings — Agent Permissions (Windows, dark mode)

Orca Settings showing Auto selected and vendor-specific launch flags

AI code-review summary

This change was produced with a multi-agent pipeline (Grok 4.5 implementer → GPT-5.6 reviewer → GPT-5.6 fixer, coordinated by Claude Fable 5 in Orca itself). The adversarial review pass explicitly checked: cross-platform behavior (Windows/macOS/Linux; no path or shell assumptions), SSH/remote and folder workspaces (capability-gated legacy projection and write fencing), per-agent integration correctness (exact vendor flag spellings; unsupported agents fall back to Manual), performance (pure preset-map lookups outside hot paths), UI quality (existing shadcn SettingsSegmentedControl, STYLEGUIDE tokens, localized labels and accessible names), and basic security risk (Auto never widens an agent beyond its vendor intermediate mode; custom user args are preserved). Review findings were addressed in commit 8565141.

Contributor

X: @drvitalfaraujo

drvitalaraujo and others added 3 commits August 9, 2026 13:08
Add a third global agent-permission preset between Manual and Yolo for
vendor-verified intermediate flags (Claude/Codex/Grok). Agents without a
verified auto preset fall back to manual args instead of escalating to
yolo. Settings and onboarding share the same Manual/Auto/Yolo control,
and Codex approval notifications suppress under both yolo and auto.

Closes #13081

Co-Authored-By: Grok 4.5 <[email protected]>
F1: Restrict Codex notification suppression in renderer and main to YOLO-only; Auto waits remain visible, while the request_user_input carve-out stays intact.

F2: Preserve mixed onboarding profiles with an unselected permission control and skip applyAgentPermissionMode until the user explicitly chooses a preset.

F3: Use exact stored argument equality for overwrite eligibility so whitespace-only and padded preset values remain custom.

F4: Replace Spanglish and untranslated Manual prose in es, ja, ko, and zh with natural copy matching each locale's visible labels.

F5: Add hook/component flow regressions for async Auto hydration, Auto preservation, mixed preservation, unsupported-agent manual fallback, and the main-process Codex carve-out.

F6: Documented only: Older remote clients classify Auto args as custom/mixed; F2-style guard only exists in new clients, and capability-gating settings publication remains out of scope.

Co-Authored-By: Codex <[email protected]>
…harnesses

Broaden AUTO_TUI_AGENT_ARGS beyond claude/codex/grok to every harness with a
vendor-documented intermediate mode, and add AUTO_TUI_AGENT_ENV for goose.

Per-agent Auto presets (vendor docs):
- claude, claude-agent-teams, openclaude, antigravity: --permission-mode auto
- codex: --approve-for-me (existing)
- grok: --permission-mode auto (existing)
- gemini: --approval-mode auto_edit (gemini-cli docs; underscore)
- qwen-code: --approval-mode auto-edit (qwen-code docs; hyphen)
- devin: --permission-mode smart (docs.devin.ai/cli/reference/permissions)
- goose env: GOOSE_MODE=smart_approve (goose docs: auto|approve|chat|smart_approve)

Researched but excluded (no single intermediate CLI preset; stay manual under Auto):
copilot, amp, rovo, cline, cursor, kimi, aider, crush, continue, kiro,
mistral-vibe, hermes, ante, trae, autohand, command-code.

Env plumbing now resolves/applies auto env presets symmetrically with yolo.

Co-Authored-By: Grok <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds auto to agent permission modes and introduces vendor-specific Auto presets. Onboarding state, persistence, controls, and tests now support Manual, Auto, Yolo, and mixed configurations. Settings controls, search metadata, and localized strings expose Auto mode. Runtime capability negotiation and RPC handling support version-skewed clients. Codex notification suppression moves to a shared helper and remains limited to Yolo waiting or blocked states.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The implementation satisfies issue #13081 by adding Manual, Auto, and Yolo modes, including Claude Auto and Codex Approve for me support.
Out of Scope Changes check ✅ Passed The UI, localization, compatibility, Codex handling, and tests directly support the Auto permission-mode objectives and show no unrelated code changes.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding an intermediate Auto permission mode for agents.
Description check ✅ Passed The description covers the user-visible changes, screenshots, testing results, AI review, security risks, compatibility behavior, and known limitations.

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.

@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: 4

🧹 Nitpick comments (1)
src/renderer/src/components/settings/AgentsPane.test.tsx (1)

435-441: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the Auto selection callback.

This test checks only the displayed value. It does not verify that selecting auto forwards auto to onChange. Add that assertion to catch a regression that collapses Auto to Yolo.

Proposed test update
-    const element = AgentPermissionsSetting({ mode: 'auto', onChange: vi.fn() })
+    const onChange = vi.fn()
+    const element = AgentPermissionsSetting({ mode: 'auto', onChange })
     const props = element.props.children.props.action.props as {
       value: 'yolo' | 'auto' | 'manual' | 'mixed'
+      onChange: (value: 'yolo' | 'auto' | 'manual' | 'mixed') => void
     }
     expect(props.value).toBe('auto')
+    props.onChange('auto')
+    expect(onChange).toHaveBeenCalledWith('auto')

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb682860-4bf3-46fb-8719-d8253778093c

📥 Commits

Reviewing files that changed from the base of the PR and between 34f2a62 and 9bfadd5.

📒 Files selected for processing (21)
  • src/main/agent-hooks/codex-auto-approval-notification-suppression.test.ts
  • src/main/agent-hooks/codex-auto-approval-notification-suppression.ts
  • src/main/index.ts
  • src/renderer/src/components/onboarding/AgentStep.test.tsx
  • src/renderer/src/components/onboarding/AgentStep.tsx
  • src/renderer/src/components/onboarding/OnboardingFlow.tsx
  • src/renderer/src/components/onboarding/agent-permission-onboarding-flow.test.tsx
  • src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts
  • src/renderer/src/components/onboarding/use-onboarding-flow.ts
  • src/renderer/src/components/settings/AgentsPane.test.tsx
  • src/renderer/src/components/settings/AgentsPane.tsx
  • src/renderer/src/components/settings/SettingsFormControls.tsx
  • src/renderer/src/components/settings/agents-search.ts
  • src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts

Comment thread src/renderer/src/i18n/locales/es.json Resolved
Comment thread src/shared/tui-agent-permissions.ts Resolved
@drvitalaraujo

Copy link
Copy Markdown
Author

Pushed 8565141ad with the review fixes and additional version-skew hardening.

Fixed:

  • preserve Codex request_user_input waits under Auto/Yolo attribution;
  • use generated localization keys and consistent Spanish agent terminology;
  • preserve Manual overrides inside otherwise Auto profiles;
  • correct the Antigravity and Qwen Code Auto presets;
  • treat whitespace-decorated launch arguments as custom instead of silently normalizing them;
  • capability-gate Auto settings across web/native remote clients so older clients cannot widen Auto to Yolo;
  • show the permission-mode explanation inline per the UI style guide.

Validation:

  • 178 targeted tests passed across 12 files;
  • TypeScript typecheck passed;
  • oxlint passed for all changed TypeScript/TSX files;
  • localization catalog, extraction, and coverage checks passed;
  • max-lines ratchet and git diff --check passed.

The full lint command still reaches the pre-existing stale skill-bundle manifest failure documented on this PR; no unrelated generated skill manifests were changed.

@drvitalaraujo

Copy link
Copy Markdown
Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai rate limit to show your current review rate limit status.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
  • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
  • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai emit path instructions to emit generated path-specific review instructions for this repository.
  • @coderabbitai resolve merge conflict to automatically resolve merge conflicts.
  • @coderabbitai autofix to automatically fix issues identified in unresolved review comments.
  • @coderabbitai fix-ci to automatically fix failing CI checks in a stacked pull request.
  • @coderabbitai fix-ci commit to automatically fix failing CI checks by committing fixes to the current branch.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

@drvitalaraujo I will review the updated changes, including the permission-mode UI shown in the Comment image.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@drvitalaraujo

Copy link
Copy Markdown
Author

@coderabbitai check again, it's done

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Current commit =="
git rev-parse HEAD
git status --short
echo

echo "== PR merge base and changed files =="
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"
printf 'Base: %s\n' "$base"
git diff --name-status "$base"...HEAD
echo

echo "== Focused diff =="
git diff --unified=60 "$base"...HEAD -- \
  src/shared/tui-agent-permissions.ts \
  src/main/agent-hooks/codex-auto-approval-notification-suppression.ts \
  src/main/runtime/rpc/methods/client-ui.ts \
  src/renderer/src/components/onboarding/AgentStep.tsx \
  src/renderer/src/components/onboarding/use-onboarding-flow.ts \
  src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts \
  src/shared/protocol-version.ts
echo

echo "== Focused source outlines =="
ast-grep outline src/shared/tui-agent-permissions.ts --items all
ast-grep outline src/main/agent-hooks/codex-auto-approval-notification-suppression.ts --items all
ast-grep outline src/main/runtime/rpc/methods/client-ui.ts --items all
ast-grep outline src/renderer/src/components/onboarding/AgentStep.tsx --items all

Length of output: 76454


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Permission helper call sites =="
rg -n -C 4 \
  'resolveAgentPermissionModeSummary\s*\(|resolveTuiAgentPermissionMode\s*\(|hasAutoAgentPermissionPreset\s*\(|projectAgentPermissionSettingsForLegacyClient\s*\(|isAutoApprovingPermissionMode\s*\(' \
  src
echo

echo "== Focused test outlines =="
ast-grep outline src/shared/tui-agent-permissions.test.ts --items all
ast-grep outline src/main/runtime/rpc/methods/client-ui-agent-permission-version-skew.test.ts --items all
ast-grep outline src/main/agent-hooks/codex-auto-approval-notification-suppression.test.ts --items all
ast-grep outline src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts --items all
echo

echo "== Relevant test cases =="
rg -n -C 8 \
  'Auto|auto|request_user_input|legacy|version.skew|manual override|whitespace|Antigravity|Qwen' \
  src/shared/tui-agent-permissions.test.ts \
  src/main/runtime/rpc/methods/client-ui-agent-permission-version-skew.test.ts \
  src/main/agent-hooks/codex-auto-approval-notification-suppression.test.ts \
  src/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.ts
echo

echo "== Main hook integration =="
rg -n -C 12 \
  'shouldSuppressCodexAutoApprovalSyntheticTitleFromHook\s*\(|toolName' \
  src/main/index.ts

Length of output: 103593


@drvitalaraujo Re-check complete for commit 8565141ad.

I found no new issues in the reviewed permission-mode, version-skew, onboarding, and Codex notification paths.

The implementation now:

  • preserves custom and whitespace-decorated launch arguments;
  • keeps Manual overrides distinct from Auto profiles;
  • prevents legacy clients from widening Auto settings to Yolo;
  • preserves Codex request_user_input waits;
  • uses the corrected Antigravity and Qwen Code Auto presets;
  • renders the inline Manual / Auto / Yolo control shown in the Comment image.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@drvitalaraujo

drvitalaraujo commented Aug 10, 2026 •

Copy link
Copy Markdown
Author

Synced this PR with current main in 51c9d724c and resolved the Japanese localization conflict using the new Agent terminology/policy.

Additional follow-up fixes:

  • mixed/custom permission profiles now show no selected segment in both Settings and onboarding instead of appearing as Yolo;
  • Prime Agent is explicitly covered as an unsupported-preset/manual fallback, preserving its custom launch arguments;
  • the PR description now reflects the current validation and fallback list.

Post-sync validation:

  • 154 targeted tests passed across 12 files;
  • full node/CLI/web typecheck passed;
  • full pnpm build passed, including desktop, relay, CLI, Electron, projected web client, and native platform build;
  • localization catalog, extraction, and coverage gates passed;
  • oxlint passed for all changed TypeScript/TSX files;
  • max-lines ratchet passed;
  • all CodeRabbit review threads are resolved;
  • full lint reaches only the unchanged upstream stale skill-bundle manifest gate after all preceding gates pass.

@brennanb2025 @nwparker the branch is conflict-free and ready for maintainer workflow approval/review when convenient.

@drvitalaraujo

Copy link
Copy Markdown
Author

Waiting for this feature...

@AmethystLiang @nwparker @brennanb2025

@drvitalaraujo drvitalaraujo closed this by deleting the head repository Sep 19, 2026
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.

[Feature]: Support the intermediate permission modes — Claude Code "Auto" mode and Codex "Approve for me"

4 participants