Repository navigation
Conversation
A chat saved as Approve for me (auto) relaunched with --permission-mode default whenever the saved model catalog had no row confirming auto support for the chat's model (catalog not yet probed after an update/restart, a fingerprint miss, or a full model id). Claude Code already falls back from auto by itself on a model that can't run it, so launch the saved choice as is. Fixes #30032 Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Contributor
|
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 8 minutes. 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 |
nwparker
marked this pull request as draft
October 25, 2026 17:04
Contributor
Author
|
Closing in favour of #30914 (merged), which covers native Claude resume permission mode more completely. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
If you set a Claude chat to Approve for me, Orca could reopen it later (after an update, restart, or terminal-host restart) asking you to approve everything. The picker still said Approve for me. That happened because Orca checked its cached model list before passing your choice to Claude, and when the cache was empty or didn't list the chat's model, it quietly fell back to Ask. Now Orca passes the saved choice straight to Claude. Claude already falls back by itself when a model can't run auto mode.
Root cause
structuredAgentSessionLaunchPermission(structured-agent-session-launch-permission.ts) read the saved-only model catalog and downgradedautotoask(--permission-mode default) unless a catalog row matchedrecord.options.modelexactly and hadsupportsAutoMode: true. The row can be missing for reasons that have nothing to do with the model:savedOnly, so it never waits for the probe)claude-opus-5-5[1m]) instead of the listed aliasThe explicit
--permission-mode defaultalso overrides the user'spermissions.defaultMode.The downgrade isn't needed. Claude Code 2.1.310 handles it at startup:
initialPermissionModeFromCLIresolves the CLI mode through its auto gate, which setsfromAutoFallbackand then notifies "auto mode unavailable for this model". It doesn't fail. I checked this with the real binary against a fake Anthropic server:--permission-mode auto --model claude-sonnet-4-20250514and--model claude-3-5-haiku-20241022both start and report"permissionMode":"default"ininit, with exit status success.--model opusreports"permissionMode":"auto".What changed
savedChatPermissionMode), with no catalog read. The picker, the mobile options read, and the outgrown-child restart check all read this same function, so they stay consistent with each other.effectiveChatPermissionModeandchatPermissionModeNeedsModelSupport, plus the tests that pinned the catalog downgrade.offeredChatPermissionModes). That part is unchanged.This is a smaller alternative to #30914, which also takes the catalog out of launch policy but goes further: it restarts the session on a model change when the opened mode differs, and keeps per-turn option retention (+2388/−531, 59 files). This PR takes only the launch-policy part, credited to @brennanb2025.
How I verified it
Isolated dev Electron (separate userData, HOME, and
CLAUDE_CONFIG_DIR), real Claude Code 2.1.310, fake Anthropic server, native Claude chat set to Approve for me (permissionMode: auto, modelopus):--permission-mode auto--permission-mode auto--resume=… --permission-mode default, picker shows "Ask for approval"--resume=… --permission-mode auto, picker shows "Approve for me"pnpm tcpasses.pnpm testpasses on 26 related native-chat, Claude, and permission test files (397 tests).check:code-quality:changedpasses.launches Claude auto without consulting a model list) fails on main.Risk
Low. The diff is about 25 lines added and 250 removed, nearly all of it tests and dead helpers.
autochoice would reject--permission-mode auto. Structured chat already depends on recent stream-json SDK flags.Fixes #30032