Repository navigation
Show a chat's saved permission mode while its agent isn't reporting - #34546
Conversation
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.
|
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 enabled permission menu: Codex enabled permission menu: Native phone enabled permission menu: Code spots for review: |
|
Warning Review limit reachedYou'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. View limit details
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 |







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: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".