fix(sdk): always use bypassPermissions mode unless in plan mode#825
fix(sdk): always use bypassPermissions mode unless in plan mode#825netrezver wants to merge 1 commit into
Conversation
The previous check required both skipPermissions setting AND non-plan mode. Since the UI already gates this via the permission mode selector, the extra skipPermissions guard prevents the SDK from bypassing permissions even when the user has not explicitly disabled the setting, causing unexpected permission prompts during normal use.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single-file permission handling logic update in ChangesPermission Mode Bypass Logic
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
The SDK's permission bypass is conditional on
settings.skipPermissionsbeingtruein addition to not being in plan mode. In practiceskipPermissionsdefaults tofalse, so even in the default UI workflow where the user has not explicitly enabled "plan mode", the SDK does not bypass permissions and throws unexpected tool-permission prompts during normal use.Root Cause
The double-guard (
settings.skipPermissions &&) meansbypassPermissionsis only set when the user has explicitly toggledskipPermissionson. For all other modes the SDK falls back to its own interactive permission flow, which conflicts with CloudCLI's own permission UI.Fix
Remove the
settings.skipPermissionsguard. Permission mode is already fully controlled by thepermissionModeselector in the UI.bypassPermissionsshould be the default for any non-plan session:How to Reproduce
skipPermissionsisfalse(the default — don't touch Settings).Files Changed
server/claude-sdk.jssettings.skipPermissions &&guard inmapCliOptionsToSDKSummary by CodeRabbit