Skip to content

Let chats follow the agent permission setting - #32334

Merged
brennanb2025 merged 73 commits into
mainfrom
brennanb2025/agent-permission-own-chats
Oct 25, 2026
Merged

brennanb2025 merged 73 commits into
mainfrom
brennanb2025/agent-permission-own-chats

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 72 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1880 $\color{#cf222e}{\Huge{\mathbf{−}}}$​659 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1221
Prod 82 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​859 $\color{#cf222e}{\Huge{\mathbf{−}}}$​370 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​489

The problem

Orca had two separate permission settings. Terminals used the agent's permission from Settings → Agents, or the agent's own config when you picked "Use 's own settings". New chats ignored that and used a different default from Settings → Chat. So a chat could run with different permissions from your terminal, and permissions you had set in Claude's or Codex's own config (for example Claude's defaultMode) never applied in chats.

What changes for you

  • New chats start with the agent's permission from Settings → Agents, the same choice terminals use.
  • With "Use 's own settings", Orca doesn't pick a mode for the chat. Claude or Codex uses its own config, as it does in a terminal.
  • Settings → Chat no longer has its own permission dropdown. It shows what each agent's chats start with and links to Settings → Agents.
  • The chat's permission menu (desktop and phone) lists only the modes and checks the one the agent is actually running.
    • If the agent runs a mode that isn't in the list (Claude's plan mode, Codex read-only), the button shows that mode's name and nothing is checked.
    • A Claude chat's button stays disabled until Claude reports its mode, right after the chat starts working.
    • Picking a mode changes only that chat.
  • OpenCode, Grok and OMP chats on "own settings" show Ask for approval, because that is exactly what Orca does for them.
  • Existing chats keep their saved permission, model and effort. Where your old chat default and terminal setting disagreed, the terminal setting is kept.

How it works

  • Claude: when no mode is given, Claude's SDK still adds --permission-mode default, which overrides the user's own config. Orca sets the SDK's resolvePermissionModeInCli option so Claude decides from its settings files instead. That option works but isn't in the SDK's published types, and an upstream request asks Anthropic to make it public: SDK sends --permission-mode default when permissionMode is omitted, overriding the user's permissions.defaultMode anthropics/claude-agent-sdk-typescript#519. If a future SDK drops it, chats fall back to Ask for approval (never more access than chosen), and a test that runs the real SDK fails.
  • Codex: Orca leaves the permission fields out when starting the chat, so Codex uses config.toml. Reopening a chat keeps the mode that chat already had.
  • The menu only displays the reported mode. It never changes a saved setting and never blocks sending a message.

Older apps and servers

  • An older app or phone that changes the old Settings → Chat dropdown now sets the all-agents permission, which affects terminals and chats together.
  • On an older paired server, a chat on "own settings" uses that server's existing chat setting, and everything keeps working. An older app may show Ask or no permission button for those chats.

Differences from the common pattern

The common pattern always tells the agent which mode to use, so the menu just shows that choice. Here, "own settings" lets the agent decide, so the menu shows what the agent reports, names a mode outside the list, and stays disabled until the mode is known. These are intended.

Not in this PR

Testing

  • Real Claude and Codex chats on "own settings": starting, upgrading from the previous build and reopening, with real replies, plus a chat set to Ask for approval. QA ran on 12c40f3ba84; later commits only change how the menu displays the mode, tests and comments.
  • Menu screenshots on desktop and phone, drawn with a scripted Claude report rather than a live agent, on b2a3c656d52.
  • Review and CI pass on 29e45f21763, including the adapted permission persistence/reload test with every assertion retained. It includes main 27e7f8fd6d6, the catalog correction and the test-only dropdown adaptation. All eight real-Claude config cases also passed on this head: user/project/local precedence, no default, bypass, explicit modes, per-chat isolation/reopen and disabled-before-report, with real replies and screenshots in the review status. The earlier lifecycle and phone evidence carries.
State Desktop Phone
Claude reports Accept edits: it's checked
Plan mode: named on the button, nothing checked
Before Claude reports: button disabled

Tracked in #31315. Author: @BrennanKB5.

  • This change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

…flags into Arguments

Terminals and new chats read one stored choice per agent (Use the agent's own
settings, Ask for approval, Accept edits, Approve for me, Full access). Orca adds
the flag at launch; Arguments hold only the user's own text. A one-time move
lifts Orca's flags out of saved Arguments. Older clients still see and write
the flag as part of Arguments; the host translates.
…rmission-one-setting

# Conflicts:
#	src/renderer/src/web/preload-api/web-preferences-store.ts
…rmission-one-setting

# Conflicts:
#	src/shared/global-settings-base.ts
@brennanb2025
brennanb2025 marked this pull request as ready for review October 23, 2026 10:41

@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.

🧹 Nitpick comments: 1
tests/e2e/structured-agent-session-launch-admission.unit.test.ts: 1

353-447: Trivial · Maintainability & Code Quality · Heavy lift

Assert the user-visible result through the DOM.

This test is under tests/e2e/**, but it validates hook return values instead of the rendered Send control and notice. The test can pass while component wiring or text rendering is broken. Set up state through window.__store and assert the DOM with getByRole and visibility matchers, or move pure hook coverage to a renderer unit test.

As per coding guidelines, E2E tests must assert user-visible behavior through the DOM.

Source: Coding guidelines


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb849cce-8ed3-46b1-84af-6a65b926ba05
Commits

Reviewing files that changed from the base of the PR and between 0e610b8 and 20b9542.

Files selected for processing: 1
  • tests/e2e/structured-agent-session-launch-admission.unit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@blacksmith-sh

This comment has been minimized.

@brennanb2025
brennanb2025 merged commit 23798ef into main Oct 25, 2026
56 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/agent-permission-own-chats branch October 26, 2026 01:11
smwbev added a commit to smwbev/orca that referenced this pull request Oct 26, 2026
338 commits landed on main between dbde821 and fd25eb0. All seven catalogs and en-runtime-required.json conflicted, so they are taken from main and the prune is recomputed in one pass: the previous 1,633 keys plus 4, none left the set. stablyai#32971 dropped the readers of settings.agents.loadingHost and permissionChoiceDescription, stablyai#32334 the reader of permissionEachOwnDescription, and stablyai#31859 the reader of auto.hooks.useIpcEvents.56d3ec4203. The two permission descriptions exist only in en.json, so en.json sheds 1,637 and the other six catalogs 1,635. en.json goes from 17,143 entries to 15,506; en-runtime-required.json keeps 643 of them.

catalog-nested-settings.test.ts listed loadingHost among the agent settings it checks across catalogs; with its last reader gone, the key comes off that list and the test checks the other ten.

native-chat-shared-copy-matches-catalog.test.ts merged cleanly again and still differs from main by exactly the branch's edit.
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.

1 participant