[BUG] VSCode extension: plan approval with "Yes, and auto-accept edits" enters acceptEdits instead of Auto mode (terminal enters Auto mode)
Environment
- VSCode extension: anthropic.claude-code 2.1.204 (darwin-arm64), bundled native CLI 2.1.204
- Terminal CLI for comparison: 2.1.202 (native install)
- macOS 26.5 (Darwin 25.5.0), VSCode 1.128.0
- Auto mode fully available for the account/model:
tengu_auto_mode_config.enabled = "enabled", model supports auto mode, nodisableAutoMode,useAutoModeDuringPlan: true(default)
Description
Approving a plan with "Yes, and auto-accept edits" behaves differently in the VSCode extension vs the terminal TUI:
- Terminal: session enters Auto mode (
permissionMode: "auto"), as expected when auto mode is available anduseAutoModeDuringPlanis not false. - VSCode extension: session enters "Edit automatically" (
permissionMode: "acceptEdits"), unconditionally.
Steps to reproduce
- In the VSCode extension, with an account/model where the terminal TUI shows "Yes, and use auto mode" on plan approval, start a session in Plan mode.
- Let Claude present a plan and approve it with "Yes, and auto-accept edits".
- Observe the permission mode indicator: it shows "Edit automatically" (acceptEdits). The extension host log confirms the webview sends
{"type":"set_permission_mode","mode":"acceptEdits","userInitiated":true}. - Repeat the equivalent flow in the terminal: the session lands in Auto mode.
Root cause (from inspecting the minified webview bundle)
The webview plan-approval component (minified wYe in webview/index.js, rendered once with {request, context, onPermissionModeChange}) hardcodes the mode in its approval handler:
R=async()=>{if(x){await i("acceptEdits",!0);...}e.accept(n||e.inputs)}
where x = request.toolName === "ExitPlanMode" and i = onPermissionModeChange. It never consults the store's autoModeAvailability (which the same bundle computes correctly and uses for the mode cycle list) nor useAutoModeDuringPlan.
The rest of the chain is fine: the extension host forwards the mode verbatim to the CLI (its internal mode set includes "auto"), and manually selecting Auto mode in the extension works. The divergence is only this one hardcoded call.
Expected behavior
Plan approval with auto-accept should follow the same decision as the terminal CLI: enter "auto" when auto mode is available (gate not disabled, model supports it, no disableAutoMode) and useAutoModeDuringPlan !== false; otherwise fall back to "acceptEdits".
Workaround
Locally patching the webview call site to remap acceptEdits -> auto (only for ExitPlanMode approvals, when autoModeAvailability.value === "available" and useAutoModeDuringPlan !== false) restores parity with the terminal, confirmed via the extension host log showing "mode":"auto" after approval.