Repository navigation
Add agent permission mode controls - #5440
Conversation
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit 56db093 on Jun 16, 2026 1:36am UTC. |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR introduces an agent permission mode system with three modes: Yolo, Manual, and Mixed. A new shared module 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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: 5
🧹 Nitpick comments (2)
src/shared/tui-agent-permissions.ts (1)
124-137: ⚡ Quick winAdd 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 winUse a secure default for
yoloPermissions(or make the prop required).
yoloPermissions = truemakes this component permissive if a caller forgets to pass the prop. Given the restrictive-by-default permission goal, default this tofalseor 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
📒 Files selected for processing (16)
src/renderer/src/components/onboarding/AgentStep.test.tsxsrc/renderer/src/components/onboarding/AgentStep.tsxsrc/renderer/src/components/onboarding/OnboardingFlow.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/agents-search.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-launch-defaults.tssrc/shared/tui-agent-permissions.test.tssrc/shared/tui-agent-permissions.ts
| const [yoloPermissions, setYoloPermissions] = useState( | ||
| resolveAgentPermissionModeSummary({ | ||
| agentDefaultArgs: settings?.agentDefaultArgs, | ||
| agentDefaultEnv: settings?.agentDefaultEnv | ||
| }) !== 'manual' | ||
| ) |
There was a problem hiding this comment.
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
| "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" |
There was a problem hiding this comment.
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
| "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" |
There was a problem hiding this comment.
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
| "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" |
There was a problem hiding this comment.
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
| "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" |
There was a problem hiding this comment.
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


Summary
Fixes #5385
Test plan