Fix Claude Code Chats in Supervised Mode (rather than Full Access Mode)#1851
Fix Claude Code Chats in Supervised Mode (rather than Full Access Mode)#1851tamaro-skaljic wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
ApprovabilityVerdict: Approved A clear bug fix that adds a missing mapping for the 'approval-required' runtime mode to the 'default' permission mode. The change is small, well-typed, and accompanied by a test update confirming the intended behavior. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
3b0dae3 to
fd7dc09
Compare
- Map runtime modes to permission modes with an explicit lookup - Include approval-required as the default permission path

What Changed
Fixes #1818
Why
When trying to use the Claude Code with
Supervisedrather thanFull accessmode, the chat rightaway fails with the error described in the issue.The fix is to set the correct (
default) permission mode when changing fromFull accesstoSupervised.Checklist
Note
Medium Risk
Changes how
permissionModeis set for Claude SDK sessions, affecting tool permission enforcement between supervised and full-access modes. Incorrect mapping could either block sessions or unintentionally relax permissions.Overview
Fixes Claude Code sessions started in supervised (
approval-required) mode by always passing an explicitpermissionModeinto the SDK query options.ClaudeAdapternow mapsRuntimeModeto SDKPermissionMode(including"approval-required" -> "default") and no longer conditionally omitspermissionMode; tests were updated to expect"default"instead ofundefinedfor supervised sessions.Reviewed by Cursor Bugbot for commit 99391f7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Claude Code chats in supervised mode by passing
permissionMode: "default"for approval-required sessionsSessions started with
runtimeMode: "approval-required"were not passing apermissionModeto the underlying query options, causing them to behave incorrectly. ClaudeAdapter.ts now maps"approval-required"topermissionMode: "default"and always includespermissionModein query options for all runtime modes.Macroscope summarized 99391f7.