Repository navigation
feat(agents): add intermediate Auto permission mode across supported harnesses - #13348
drvitalaraujo wants to merge 5 commits into
Conversation
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]>
📝 WalkthroughWalkthroughThe change adds 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/renderer/src/components/settings/AgentsPane.test.tsx (1)
435-441: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the Auto selection callback.
This test checks only the displayed value. It does not verify that selecting
autoforwardsautotoonChange. 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
📒 Files selected for processing (21)
src/main/agent-hooks/codex-auto-approval-notification-suppression.test.tssrc/main/agent-hooks/codex-auto-approval-notification-suppression.tssrc/main/index.tssrc/renderer/src/components/onboarding/AgentStep.test.tsxsrc/renderer/src/components/onboarding/AgentStep.tsxsrc/renderer/src/components/onboarding/OnboardingFlow.tsxsrc/renderer/src/components/onboarding/agent-permission-onboarding-flow.test.tsxsrc/renderer/src/components/onboarding/use-onboarding-flow-persistence.tssrc/renderer/src/components/onboarding/use-onboarding-flow.tssrc/renderer/src/components/settings/AgentsPane.test.tsxsrc/renderer/src/components/settings/AgentsPane.tsxsrc/renderer/src/components/settings/SettingsFormControls.tsxsrc/renderer/src/components/settings/agents-search.tssrc/renderer/src/components/terminal-pane/codex-auto-approval-notification-suppression.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/tui-agent-permissions.test.tssrc/shared/tui-agent-permissions.ts
|
Pushed Fixed:
Validation:
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. |
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
|
|
|
@coderabbitai check again, it's done |
|
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 allLength 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.tsLength of output: 103593
I found no new issues in the reviewed permission-mode, version-skew, onboarding, and Codex notification paths. The implementation now:
You are interacting with an AI system. |
|
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. |
|
Synced this PR with current Additional follow-up fixes:
Post-sync validation:
@brennanb2025 @nwparker the branch is conflict-free and ready for maintainer workflow approval/review when convenient. |
|
Waiting for this feature... |
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
Auto presets per agent (vendor-documented flags)
--permission-mode autoclaude --help(agent-teams launches the claude binary)--permission-mode auto--mode=accept-edits--approve-for-mecodex --help--permission-mode autogrok --help--approval-mode auto_edit--approval-mode auto--permission-mode smartGOOSE_MODE=smart_approveAgents 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
AgentPermissionModegains'auto'; classification is by exact preset match (empty → manual, yolo preset → yolo, auto preset → auto, anything else → mixed).applyAgentPermissionModeonly 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.request_user_inputwaits continue to surface under Auto/Yolo attribution.Remote/compat note
Auto remains encoded as launch args/env inside existing
GlobalSettingsfields, so no settings schema field was added. Current native, shared-control, and web clients advertisesettings.agent-permission-auto.v1. For clients without that capability, the host projects permission settings to Manual and fencesagentDefaultArgs/agentDefaultEnvwrites 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).mainafter synchronization, covering shared permission logic, AgentsPane, AgentStep, onboarding persistence, Codex notification suppression, remote version skew, and native/shared-control/web capability handshakes.git diff --checkpass.pnpm lintreaches the unchanged upstreamverify:skill-bundle-manifeststaleness 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.pnpm testis 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)
Settings — Agent Permissions (Windows, dark mode)
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