Skip to content

Fix Claude Code Chats in Supervised Mode (rather than Full Access Mode)#1851

Open
tamaro-skaljic wants to merge 2 commits intopingdotgg:mainfrom
tamaro-skaljic:tamaro-skaljic/fix/1818
Open

Fix Claude Code Chats in Supervised Mode (rather than Full Access Mode)#1851
tamaro-skaljic wants to merge 2 commits intopingdotgg:mainfrom
tamaro-skaljic:tamaro-skaljic/fix/1818

Conversation

@tamaro-skaljic
Copy link
Copy Markdown

@tamaro-skaljic tamaro-skaljic commented Apr 9, 2026

What Changed

Fixes #1818

Why

When trying to use the Claude Code with Supervised rather than Full access mode, the chat rightaway fails with the error described in the issue.

The fix is to set the correct (default) permission mode when changing from Full access to Supervised.

Checklist

  • This PR is small and focused
  • I explained what changed and why

Note

Medium Risk
Changes how permissionMode is 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 explicit permissionMode into the SDK query options.

ClaudeAdapter now maps RuntimeMode to SDK PermissionMode (including "approval-required" -> "default") and no longer conditionally omits permissionMode; tests were updated to expect "default" instead of undefined for 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 sessions

Sessions started with runtimeMode: "approval-required" were not passing a permissionMode to the underlying query options, causing them to behave incorrectly. ClaudeAdapter.ts now maps "approval-required" to permissionMode: "default" and always includes permissionMode in query options for all runtime modes.

Macroscope summarized 99391f7.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a54f08fa-4ae0-41b2-97ce-6cd3c8caa869

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 9, 2026
@tamaro-skaljic tamaro-skaljic changed the title (fix): Fix Claude Code Adapter for Supervised Chats Fix Claude Code Chats in Supervised Mode (rather than Full Access Mode) Apr 9, 2026
@Soif2Sang
Copy link
Copy Markdown

I've ran into the same issue and had a similar fix; I would like to mention that after switching from a full permission that fails to a supervised in the same chat fails because it says the conversation is not found
image

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 9, 2026

Approvability

Verdict: 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>
@juliusmarminge juliusmarminge force-pushed the tamaro-skaljic/fix/1818 branch from 3b0dae3 to fd7dc09 Compare April 9, 2026 18:18
@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Apr 9, 2026
- Map runtime modes to permission modes with an explicit lookup
- Include approval-required as the default permission path
@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: : Cannot set permission mode to bypassPermissions because the session was not launched with --dangerously-skip-permissions

3 participants