Align Claude bypass mode and session controls#139
Conversation
Route Claude bypass mode through the Claude Agent SDK permission mode so it matches Claude Code and no longer relies on a Copilot-style autopilot shim. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Claude Code engine integration to use Claude’s native bypassPermissions permission mode (instead of a Copilot-style “autopilot” mode), including wiring the required SDK options and adding regression tests.
Changes:
- Replace the Claude “autopilot” mode with a new
bypassPermissionsmode and map selected UI mode → SDKpermissionMode. - Ensure sessions are recreated when entering
bypassPermissionsunless the session was created withallowDangerouslySkipPermissions. - Update UI mode styling/behavior for the new mode and add unit tests covering bypass behavior and session recreation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
electron/main/engines/claude/index.ts |
Implements bypassPermissions mode, validates/mappings to SDK PermissionMode, and passes allowDangerouslySkipPermissions with session recreation when needed. |
tests/unit/electron/engines/claude/index.test.ts |
Adds coverage for bypass permission pass-through, session recreation rules, and ensures “autopilot” is no longer exposed by getModes(). |
src/pages/Chat.tsx |
Updates mode badge styling so bypassPermissions is grouped with the “autonomous/auto-accept” styling bucket. |
src/components/PromptInput.tsx |
Updates mode color/icon/placeholder logic to treat “Bypass Permissions” similarly to “Autopilot” in the UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Keep Claude bypass mode and session model/mode/effort controls consistent across the chat UI and channel commands. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reuse the Claude session cleanup helper when rebuilding sessions for bypass permissions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Keep Claude session reuse defaults aligned with new-session defaults and close the session controls popover on Escape from any focused control. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
/modeas a current-session command, keep/modelsession-scoped, add/effort, and reconcile effort when channel model changes.Test plan
bun run typecheckbunx vitest run tests/unit/electron/engines/claude/index.test.ts tests/unit/electron/channels/shared/session-commands.test.ts tests/unit/electron/channels/shared/command-parser.test.ts tests/unit/electron/channels/feishu/feishu-card-builder.test.tsbun run build🤖 Generated with Claude Code