Repository navigation
fix(native-chat): seed the chat permission default from Claude's and Codex's own arguments - #28100
Conversation
…al toggle as it shows The one-time copy into Settings -> Chat -> Permissions gave Full access only when every agent's arguments were exactly the bypass flag, so a profile the toggle shows as Yolo (agents set differently, or an extra flag) got Ask. Follow the toggle: Manual seeds Ask, anything it shows as Yolo seeds Full access.
…Codex's own arguments The Yolo/Manual toggle has no saved value: it summarises every agent's arguments and shows Yolo for any mix, including after Manual when another agent keeps custom arguments. Seeding from it would grant Full access to people who chose Manual. Read what Claude and Codex chats checked before they had modes instead: Full access when both launch with their bypass flag, otherwise Ask.
|
New chats could start asking for approvals even when Claude and Codex both still bypassed them: the one-time default required every agent's arguments to exactly match its skip flag. This PR instead reads the existing Claude and Codex argument checks. Both bypass → Full access; otherwise → Ask for approval. Saved choices win. Review completed at 726f870. The independent architecture, correctness, readiness and performance passes found no P0/P1 issue. Keep the design. No source changes were needed during this review; two description sentences were corrected to avoid promising unchanged behavior when Claude and Codex disagree. Verified:
Deferred P2 — R28100-READY-01: the raw Windows shell value passed during loading can now fail settings loading when an older profile has a non-string shell value, such as 7, and no saved chat permission mode. The real bundled loader succeeds on main and throws “shell?.trim is not a function” here under simulated Windows. Normal shell controls do not produce this malformed value. Repairing/removing the invalid shell value is a practical workaround; malformed-profile hardening remains deferred. Windows rendered QA is BLOCKED: both remote Codex supervisors stopped at sign-in, and an authenticated local operator then confirmed opencode was absent on Windows high spec. All three permitted model commands failed before driver creation. No Windows app/UI result is claimed. Live SSH, paired web/mobile, mixed-version binaries, folder-workspace sessions and real Claude/Codex commands were not exercised; their relevant settings paths were inspected. Mac test apps/profiles and its QA worktree are cleaned up. The Windows operator shell exited; the two earlier sign-in sessions and their worktrees are preserved because orchestration did not retain ownership needed to release them safely. No merge or auto-merge was performed. Original M4Air captures at the reviewed head: Both bypass flags among model arguments → Full access. Selecting Ask, then restarting the same profile → Ask remains saved. |
…Codex's own arguments (stablyai#28100) * fix(native-chat): seed the chat permission default from the Yolo/Manual toggle as it shows The one-time copy into Settings -> Chat -> Permissions gave Full access only when every agent's arguments were exactly the bypass flag, so a profile the toggle shows as Yolo (agents set differently, or an extra flag) got Ask. Follow the toggle: Manual seeds Ask, anything it shows as Yolo seeds Full access. * fix(native-chat): seed the chat permission default from Claude's and Codex's own arguments The Yolo/Manual toggle has no saved value: it summarises every agent's arguments and shows Yolo for any mix, including after Manual when another agent keeps custom arguments. Seeding from it would grant Full access to people who chose Manual. Read what Claude and Codex chats checked before they had modes instead: Full access when both launch with their bypass flag, otherwise Ask. (cherry picked from commit f0ccfcc)
…Codex's own arguments (#28100) * fix(native-chat): seed the chat permission default from the Yolo/Manual toggle as it shows The one-time copy into Settings -> Chat -> Permissions gave Full access only when every agent's arguments were exactly the bypass flag, so a profile the toggle shows as Yolo (agents set differently, or an extra flag) got Ask. Follow the toggle: Manual seeds Ask, anything it shows as Yolo seeds Full access. * fix(native-chat): seed the chat permission default from Claude's and Codex's own arguments The Yolo/Manual toggle has no saved value: it summarises every agent's arguments and shows Yolo for any mix, including after Manual when another agent keeps custom arguments. Seeding from it would grant Full access to people who chose Manual. Read what Claude and Codex chats checked before they had modes instead: Full access when both launch with their bypass flag, otherwise Ask. (cherry picked from commit f0ccfcc)


ELI5
#26116 (merged, not in a release yet) gave Claude and Codex chats their own permission setting: "ask me before running commands" (Ask for approval) or "just run them" (Full access). It also added a default for new chats, under Settings → Chat → Permissions. The first time someone runs a build with #26116, Orca fills that default in once, from how they already had Orca set up.
That one-time fill-in looked at the wrong thing, so many people who never had approval prompts in chat would land on Ask for approval. Their new chats would then stop before every command. A user already reported this from the chat side (STA-10345: "every single command needs manual confirmation").
This PR fills the default from Claude's and Codex's existing arguments. If both already bypassed approvals, new chats start with Full access; otherwise they start with Ask for approval.
What Changed
Terms used below
--dangerously-skip-permissions; for Codex it's--dangerously-bypass-approvals-and-sandbox. Orca stores each agent's launch arguments in Settings → Agents.Who gets what as the new-chat default
--dangerously-skip-permissions --model opus--yolo), Claude and Codex untouchedBefore: the fill-in gave Full access only when all ~35 agents' arguments were exactly their skip flag. Any difference anywhere counted as "mixed" and gave Ask, even though Claude and Codex chats themselves had been running without prompts.
After: Full access when Claude's and Codex's own arguments contain their skip flag, otherwise Ask. Other agents' arguments are ignored, because only Claude and Codex chats use this setting. Before #26116, this was exactly the check each Claude or Codex chat made when it started.
Unchanged:
Mechanism:
loadedChatPermissionSetting(runs when settings load) now asksresolvedTuiAgentArgsBypassPermissions('claude' | 'codex', …). That's the existing helper that tokenizes the arguments the way the launch does, so a flag inside a quoted prompt or after--doesn't count. A brand-new profile's default is written directly as Full access, because Orca's shipped Claude and Codex arguments carry their skip flags. A test checks the two stay in agreement.Why
The default should preserve Full access when both chat agents already used it and avoid granting it when either did not. It reads the same two argument values the chats themselves read before they had their own permission setting.
Alternatives considered:
If Claude and Codex disagree (one has its skip flag, the other doesn't), the result is Ask, because there's a single default for both. That's rare and errs toward asking.
Companion PR: #28099 makes chats created before #26116 use this same default, instead of Ask. Each PR stands on its own.
Linked Issue
STA-10345 (user feedback). Follow-up to #26116, which hasn't shipped in a release yet.
Visual Proof
Both screenshots use the same profile, created on a build from just before #26116 with Claude's arguments set to
--dangerously-skip-permissions --model opus(Agent Permissions still shows Yolo). Each build opened its own copy of that profile.Before (main): Settings → Chat → Permissions for new chats comes out as Ask for approval, although Claude still launches with the skip flag.
After (this PR): the same profile comes out as Full access.
Testing
src/shared/agent-chat-permission-mode.test.ts:normalize-loaded-global-settings.test.tspasses.Manual (macOS, hidden dev builds over CDP): upgraded the profile described under Visual Proof on main and on this branch, and read Settings → Chat and the saved value (
askon main,full-accesshere).I manually tested these changes locally
Automated tests added/updated, or explained why not below
Notes