Skip to content

Add agent permission mode controls - #5440

Merged
nwparker merged 2 commits into
mainfrom
nwparker/feature-default-agent-arguments-should-not-be-da
Jun 16, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/feature-default-agent-arguments-should-not-be-da

Conversation

@nwparker

@nwparker nwparker commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add a shared agent permission profile resolver for Yolo, Manual, and Mixed launch defaults
  • add the onboarding checkbox for Yolo / Dangerously skip permissions, defaulting to the current behavior
  • add an Agent Permissions switcher in Settings that preserves custom per-agent arguments

Fixes #5385

Test plan

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/tui-agent-permissions.test.ts src/renderer/src/components/settings/AgentsPane.test.tsx src/renderer/src/components/onboarding/AgentStep.test.tsx src/renderer/src/components/onboarding/use-onboarding-flow-persistence.test.ts
  • pnpm run typecheck
  • pnpm run lint
  • Electron verification: Settings > Agents renders Agent Permissions; Manual clears Orca-owned yolo args/env; Yolo restores them

Open in Stage

@ghost

ghost commented Jun 16, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Define agent permission modes and logic
2 Add localization for permission controls
3 Implement permission controls in onboarding
4 Add permission switcher to Settings
Open in Stage

Chapters generated by Stage for commit 56db093 on Jun 16, 2026 1:36am UTC.

@nwparker

Copy link
Copy Markdown
Contributor Author

Screenshot evidence for the new Agent Permissions setting:

Agent Permissions setting

@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5cc3a60a-93e4-4bdf-8312-82d79aeeb2c6

📥 Commits

Reviewing files that changed from the base of the PR and between da1ca3b and 56db093.

📒 Files selected for processing (7)
  • src/renderer/src/components/settings/AgentsPane.test.tsx
  • src/renderer/src/components/settings/AgentsPane.tsx
  • 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
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/components/settings/AgentsPane.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json

📝 Walkthrough

Walkthrough

This PR introduces an agent permission mode system with three modes: Yolo, Manual, and Mixed. A new shared module tui-agent-permissions.ts defines the AgentPermissionMode type, per-agent Yolo argument/environment templates, and two exported functions: resolveAgentPermissionModeSummary (classifies current defaults as yolo/manual/mixed) and applyAgentPermissionMode (enforces a chosen mode onto default args/env). The existing DEFAULT_TUI_AGENT_ARGS/ENV exports are refactored to point at the Yolo templates. The settings AgentsPane gains a new AgentPermissionsSetting segmented control, and the onboarding AgentStep gains a "Yolo / Dangerously skip permissions" checkbox. Onboarding state management tracks a yoloPermissions boolean and persists it via applyAgentPermissionMode when the agent step completes. New i18n keys and tests accompany all additions.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes summary, test plan, and issue reference, but lacks required sections: Screenshots, AI Review Report, and Security Audit are missing. Add Screenshots section with visual evidence of Agent Permissions setting, AI Review Report confirming cross-platform compatibility checks (macOS, Linux, Windows), and Security Audit summary of input handling and permission model changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding agent permission mode controls throughout the codebase.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from #5385: a permission mode resolver, onboarding checkbox for opt-in yolo mode, and Settings UI to switch between Manual (restrictive default) and Yolo modes while preserving custom arguments.
Out of Scope Changes check ✅ Passed All changes are scoped to agent permission mode implementation. Localization updates for multiple languages and test coverage additions appropriately support the core feature without unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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 and usage tips.

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

🧹 Nitpick comments (2)
src/shared/tui-agent-permissions.ts (1)

124-137: ⚡ Quick win

Add a short “why” comment for the selective mutation rules.

The (!currentArgs || currentArgs === yoloArgs) and env-equivalence gates are policy-critical and non-obvious. Add a 1–2 line rationale explaining why only Orca-owned defaults are rewritten while custom values are preserved.

As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”

Source: Coding guidelines

src/renderer/src/components/onboarding/AgentStep.tsx (1)

19-20: ⚡ Quick win

Use a secure default for yoloPermissions (or make the prop required).

yoloPermissions = true makes this component permissive if a caller forgets to pass the prop. Given the restrictive-by-default permission goal, default this to false or require the prop.

Suggested change
 type AgentStepProps = {
   selectedAgent: TuiAgent | null
@@
-  yoloPermissions?: boolean
+  yoloPermissions: boolean
   onYoloPermissionsChange?: (enabled: boolean) => void
 }
@@
-  yoloPermissions = true,
+  yoloPermissions,

Also applies to: 23-30


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b2ae31ca-fa21-45e8-8a21-db8640854358

📥 Commits

Reviewing files that changed from the base of the PR and between 7f3aac9 and da1ca3b.

📒 Files selected for processing (16)
  • 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/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/agents-search.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-launch-defaults.ts
  • src/shared/tui-agent-permissions.test.ts
  • src/shared/tui-agent-permissions.ts

Comment on lines +244 to +249
const [yoloPermissions, setYoloPermissions] = useState(
resolveAgentPermissionModeSummary({
agentDefaultArgs: settings?.agentDefaultArgs,
agentDefaultEnv: settings?.agentDefaultEnv
}) !== 'manual'
)

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.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Preserve mixed permission mode instead of collapsing it to a boolean.

This flow reduces 'mixed' to true (!== 'manual') and then persists as yolo, which can silently broaden permissions for users who never interacted with this control during onboarding. Keep the full AgentPermissionMode in flow state (or gate mode application behind an explicit interaction flag) before persisting.

Also applies to: 595-599

Comment thread src/renderer/src/i18n/locales/es.json Outdated
Comment on lines +4284 to +4290
"agentPermissions": "Agent Permissions",
"agentPermissionsInfo": "Agent permissions info",
"agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
"agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
"agentPermissionsYolo": "Yolo",
"agentPermissionsManual": "Manual",
"agentPermissionsMixed": "Mixed"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate newly added es locale strings (currently English/mixed).

es.json now ships English UI copy in multiple new keys (Lines 4284-4290, Line 6325-Line 6326, Line 8823-Line 8826), so Spanish users will see mixed-language labels/tooltips in Settings and Onboarding.

Suggested patch
-          "agentPermissions": "Agent Permissions",
-          "agentPermissionsInfo": "Agent permissions info",
-          "agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
-          "agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
+          "agentPermissions": "Permisos del agente",
+          "agentPermissionsInfo": "Información sobre permisos del agente",
+          "agentPermissionsTooltip": "Los argumentos personalizados del agente no cambian al alternar modos.",
+          "agentPermissionsDescription": "Elige si Orca inicia agentes con menos solicitudes de permisos o con comprobaciones manuales.",
           "agentPermissionsYolo": "Yolo",
           "agentPermissionsManual": "Manual",
-          "agentPermissionsMixed": "Mixed"
+          "agentPermissionsMixed": "Mixto"
...
-            "agentPermissions": "Agent Permissions",
-            "agentPermissionsDescription": "Switch agent permission defaults between Yolo and Manual."
+            "agentPermissions": "Permisos del agente",
+            "agentPermissionsDescription": "Cambia los permisos predeterminados del agente entre Yolo y Manual."
...
-          "showMoreAgents": "Mostrar {{value0}} más agents→",
-          "yoloPermissionsLabel": "Yolo / Dangerously skip permissions",
-          "yoloPermissionsInfo": "Agent permission info",
-          "yoloPermissionsTooltip": "Skip permission checks for agents for less interruptions"
+          "showMoreAgents": "Mostrar {{value0}} agentes más→",
+          "yoloPermissionsLabel": "Yolo / Omitir permisos (peligroso)",
+          "yoloPermissionsInfo": "Información sobre permisos del agente",
+          "yoloPermissionsTooltip": "Omite las comprobaciones de permisos de los agentes para tener menos interrupciones"

Also applies to: 6325-6326, 8823-8826

Comment thread src/renderer/src/i18n/locales/ja.json Outdated
Comment on lines +4269 to +4275
"agentPermissions": "Agent Permissions",
"agentPermissionsInfo": "Agent permissions info",
"agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
"agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
"agentPermissionsYolo": "Yolo",
"agentPermissionsManual": "Manual",
"agentPermissionsMixed": "Mixed"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the newly added Japanese keys (currently English).

These new ja.json entries are still English, so Japanese users will see mixed-language UI in Settings search and Onboarding.

Suggested localized replacements
-          "agentPermissions": "Agent Permissions",
-          "agentPermissionsInfo": "Agent permissions info",
-          "agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
-          "agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
-          "agentPermissionsYolo": "Yolo",
-          "agentPermissionsManual": "Manual",
-          "agentPermissionsMixed": "Mixed"
+          "agentPermissions": "エージェント権限",
+          "agentPermissionsInfo": "エージェント権限の情報",
+          "agentPermissionsTooltip": "モードを切り替えても、カスタムの agent 引数は変更されません。",
+          "agentPermissionsDescription": "Orca が agent を少ない権限確認で起動するか、手動確認で起動するかを選択します。",
+          "agentPermissionsYolo": "Yolo",
+          "agentPermissionsManual": "手動",
+          "agentPermissionsMixed": "混在"
-            "agentPermissions": "Agent Permissions",
-            "agentPermissionsDescription": "Switch agent permission defaults between Yolo and Manual."
+            "agentPermissions": "エージェント権限",
+            "agentPermissionsDescription": "エージェント権限の既定値を Yolo と手動の間で切り替えます。"
-          "showMoreAgents": "{{value0}} 件の agents をさらに表示→",
-          "yoloPermissionsLabel": "Yolo / Dangerously skip permissions",
-          "yoloPermissionsInfo": "Agent permission info",
-          "yoloPermissionsTooltip": "Skip permission checks for agents for less interruptions"
+          "showMoreAgents": "さらに {{value0}} 件の agents を表示→",
+          "yoloPermissionsLabel": "Yolo / 危険: 権限チェックをスキップ",
+          "yoloPermissionsInfo": "エージェント権限の情報",
+          "yoloPermissionsTooltip": "中断を減らすため、agent の権限チェックをスキップします"

Also applies to: 6347-6348, 8823-8826

Comment thread src/renderer/src/i18n/locales/ko.json Outdated
Comment on lines +4269 to +4275
"agentPermissions": "Agent Permissions",
"agentPermissionsInfo": "Agent permissions info",
"agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
"agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
"agentPermissionsYolo": "Yolo",
"agentPermissionsManual": "Manual",
"agentPermissionsMixed": "Mixed"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

New Korean-locale entries are still English and will show mixed-language UI.

The newly added values for Agent Permissions (settings/search) and onboarding yolo copy are English in ko.json, so Korean users will see untranslated text in these new flows.

💡 Suggested localized replacements
-          "agentPermissions": "Agent Permissions",
-          "agentPermissionsInfo": "Agent permissions info",
-          "agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
-          "agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
-          "agentPermissionsYolo": "Yolo",
-          "agentPermissionsManual": "Manual",
-          "agentPermissionsMixed": "Mixed"
+          "agentPermissions": "에이전트 권한",
+          "agentPermissionsInfo": "에이전트 권한 정보",
+          "agentPermissionsTooltip": "모드를 전환해도 사용자 지정 에이전트 인수는 그대로 유지됩니다.",
+          "agentPermissionsDescription": "Orca가 에이전트를 적은 권한 확인으로 실행할지, 수동 확인으로 실행할지 선택합니다.",
+          "agentPermissionsYolo": "Yolo",
+          "agentPermissionsManual": "수동",
+          "agentPermissionsMixed": "혼합"

-            "afbf35be68": "안정적인 세션",
-            "agentPermissions": "Agent Permissions",
-            "agentPermissionsDescription": "Switch agent permission defaults between Yolo and Manual."
+            "afbf35be68": "안정적인 세션",
+            "agentPermissions": "에이전트 권한",
+            "agentPermissionsDescription": "에이전트 권한 기본값을 Yolo와 수동 사이에서 전환합니다."

-          "showMoreAgents": "{{value0}}개 더 많은 agents 표시→",
-          "yoloPermissionsLabel": "Yolo / Dangerously skip permissions",
-          "yoloPermissionsInfo": "Agent permission info",
-          "yoloPermissionsTooltip": "Skip permission checks for agents for less interruptions"
+          "showMoreAgents": "에이전트 {{value0}}개 더 보기→",
+          "yoloPermissionsLabel": "Yolo / 위험한 권한 건너뛰기",
+          "yoloPermissionsInfo": "에이전트 권한 정보",
+          "yoloPermissionsTooltip": "중단을 줄이기 위해 에이전트 권한 확인을 건너뜁니다."

Also applies to: 6309-6311, 8823-8826

Comment thread src/renderer/src/i18n/locales/zh.json Outdated
Comment on lines +4269 to +4275
"agentPermissions": "Agent Permissions",
"agentPermissionsInfo": "Agent permissions info",
"agentPermissionsTooltip": "Custom agent arguments stay unchanged when switching modes.",
"agentPermissionsDescription": "Choose whether Orca launches agents with fewer permission prompts or with manual checks.",
"agentPermissionsYolo": "Yolo",
"agentPermissionsManual": "Manual",
"agentPermissionsMixed": "Mixed"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize new zh keys instead of shipping English fallback text.

These newly added zh locale entries are still English, so Chinese users will see mixed-language UI in Settings/Search/Onboarding. Please translate these values in-place for the zh locale file.

Also applies to: 6310-6311, 8824-8826

@nwparker

Copy link
Copy Markdown
Contributor Author

Updated screenshot after removing the Mixed segment:

Agent Permissions setting with Yolo and Manual

@nwparker
nwparker merged commit 13f7163 into main Jun 16, 2026
1 check failed
@nwparker
nwparker deleted the nwparker/feature-default-agent-arguments-should-not-be-da branch June 16, 2026 01:38
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 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]: Default Agent Arguments Should Not Be --dangerously-skip-permissions/--yolo default

1 participant