From d4e4ecd639d2879b628a47c0f2f8fabdb0fa6ee7 Mon Sep 17 00:00:00 2001 From: luoxk Date: Sun, 24 May 2026 22:22:45 +0800 Subject: [PATCH] fix: always accept 'auto' in defaultMode settings schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When TRANSCRIPT_CLASSIFIER feature flag is disabled (e.g., in sidecar builds), the SettingsSchema rejects 'auto' as a valid defaultMode value. This causes the entire ~/.claude/settings.json to fail Zod validation and be silently discarded — losing enabledPlugins, hooks, env, and all other user settings. Users who set permissions.defaultMode to 'auto' in the upstream Claude Code CLI (where the feature flag is enabled) then open the same settings.json in a sidecar or desktop build (where the flag may be off) hit "Unknown skill" errors because plugin discovery reads empty enabledPlugins from the failed parse. Fix: always include 'auto' in the defaultMode enum regardless of the TRANSCRIPT_CLASSIFIER feature flag. The schema should accept all valid mode values for settings file compatibility, even if the runtime doesn't activate auto-mode behavior when the flag is off. --- src/utils/settings/types.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils/settings/types.ts b/src/utils/settings/types.ts index 62aa755f8..2e07afc7e 100644 --- a/src/utils/settings/types.ts +++ b/src/utils/settings/types.ts @@ -57,11 +57,7 @@ export const PermissionsSchema = lazySchema(() => 'List of permission rules that should always prompt for confirmation', ), defaultMode: z - .enum( - feature('TRANSCRIPT_CLASSIFIER') - ? PERMISSION_MODES - : EXTERNAL_PERMISSION_MODES, - ) + .enum([...EXTERNAL_PERMISSION_MODES, 'auto']) .optional() .describe('Default permission mode when Claude Code needs access'), disableBypassPermissionsMode: z