Skip to content

Show a chat's saved permission mode while its agent isn't reporting - #34546

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/chat-permission-pill-idle
Oct 28, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/chat-permission-pill-idle

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

Problem

In an existing Claude or Codex chat, the composer's permission pill read a greyed-out "Permissions" instead of the chat's mode (for example "Full access"), and it could not be opened to change the mode. This happened whenever the chat's agent process was not running and reporting its mode: every chat after an app restart, every chat before its first turn, and any chat whose host connection dropped.

Regression from #32334. On hosts that support "use the agent's own settings" (every current host, including local), the pill showed only the mode a running agent reported. The 10-25 decision for that PR was that chats following the agent's own settings stay disabled until the agent reports. The code applied that rule to every chat, including chats with an explicit mode. Orca applies an explicit mode itself at the next start and the next fresh turn, so it is always known.

Change

structuredAgentSessionPermissionDescriptor:

  • A live report still wins, including a mode outside the list (Plan mode, Read only).
  • With no report, a chat with an explicit mode shows its saved mode and can be changed again. This is the behavior before Let chats follow the agent permission setting #32334 and on older hosts.
  • Chats that follow the agent's own settings are unchanged: disabled until the agent reports.
  • A report the agent sends with a mode Orca can't name still shows the placeholder.

Desktop and phone share this descriptor.

Intended and temporary differences

  • The pill shows the saved mode, which the next fresh turn applies, not proof of what a still-running process uses. Two windows can differ: a resumed continuation run that starts in "Approve for me" before its report arrives, and a dropped host connection while the agent still runs. The next report or fresh turn reconciles both, and builds before Let chats follow the agent permission setting #32334 had the same windows. This is the common pattern: an existing chat shows its stored mode and stays selectable.

  • Temporary: if a mode pick is refused and the following options read also fails, the pill can keep showing the refused mode until the chat's next read; fixed by #31208. That existing settlement repair stays with its current owner.

Plan

One PR, about 5 production lines, no saved field or wire change. The design was reviewed before code: a Fable plan review and an independent Codex check both chose "fall back to the saved mode for explicit chats" over "show only the stored mode" (which would drop the agent's own-settings reporting that the 10-25 decision requires).

Tests

  • structured-agent-session-permission-option.test.ts: on a capable host, an explicit chat with no report shows its saved mode and is settable. The own-settings and null-report cases are unchanged.
  • structured-permission-report-publication.unit.test.ts: after the report is lost, desktop and phone show the saved "Full access" instead of "Permissions".

Chats with an explicit mode showed a disabled 'Permissions' placeholder whenever no running agent had reported, which is every idle or resumed chat, so the mode could not be read or changed. A live report still wins; chats that follow the agent's own settings still wait for the report.
@brennanb2025

brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Review status: complete at ce3ae3d after the single main sync.

Existing explicit-mode chats showed a disabled Permissions placeholder when their agent had no live report. This patch restores the saved mode and allows the existing permission menu, while preserving report-only behavior for chats using the agent's own settings.

Temporary, tracked in #31208: if a mode pick is refused and the following options read also fails, the pill can keep showing the refused mode until the chat's next read; fixed by #31208. This existing settlement mechanism stays with its current owner. Per the lane owner's 10-27 ruling, this focused display fix proceeds without waiting for that repair.

One full source-review round and bounded verification are complete. Correctness, architecture, final reference comparison, readiness and the narrow main-merge review passed. CI is green on this head. Five exact descriptor/publication/desktop/mobile test files passed: 62 tests, zero failures or skips.

The branch-only desktop screenshot run passed with persisted Claude and Codex fixture chats, saved Full access, no live permission report, and the ordinary host capability and guards. Both permission buttons were enabled and both menus opened with Full access checked. No real agents or lifecycle flow were exercised; Codex’s isolated-home sign-in notice remains visible. The native iPhone 17 Pro screenshot run also passed: the shipping composer’s options summary showed Full access, and tapping Permissions opened an enabled menu with Full access selected. The phone used an isolated, persisted Claude fixture through the production pairing and permission derivation paths, in the native iOS dev client loading this head’s shipping mobile bundle. No real agent ran in either screenshot check.

For Brennan's review

Claude idle composer:
Claude idle composer showing Full access

Claude enabled permission menu:
Claude permission menu with Full access selected

Codex idle composer:
Codex idle composer showing Full access

Codex enabled permission menu:
Codex permission menu with Full access selected

Native phone idle composer:
Native phone idle composer

Native phone options summary:
Native phone options showing Full access

Native phone enabled permission menu:
Native phone permission menu with Full access selected

Code spots for review:

@brennanb2025
brennanb2025 marked this pull request as ready for review October 27, 2026 22:48
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: fbc29b02-843d-4d91-ae56-220e0e85a4a1
Commits

Reviewing files that changed from the base of the PR and between 5e49b6d and ce3ae3d.

Files selected for processing: 3
  • src/shared/structured-agent-session-permission-option.test.ts
  • src/shared/structured-agent-session-permission-option.ts
  • tests/e2e/structured-permission-report-publication.unit.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@brennanb2025
brennanb2025 merged commit ab512bf into main Oct 28, 2026
75 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/chat-permission-pill-idle branch October 28, 2026 12:44
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