Enable Auto Compact by default in VS Code (#12739)

* feat(vscode): enable Auto Compact by default

The SDK-based extension has no fallback context management: with auto
compact off, hitting the model's context window fails the request with a
provider error and retrying keeps failing (the legacy extension truncated
the oldest half of the conversation in this situation). The CLI already
defaults compaction on (agentic); align the extension with it.

* chore: add changeset for Auto Compact default-on
This commit is contained in:
Saoud Rizwan
2026-07-30 12:02:02 -07:00
committed by GitHub
parent 078d9f63f0
commit 892837d352
4 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Enable Auto Compact by default so long chats automatically compress conversation history instead of failing at the model context limit. It can be disabled in Settings → Features → "Auto Compact".
+3 -1
View File
@@ -904,7 +904,9 @@ export async function buildSessionConfig(input: SessionConfigInput): Promise<Cor
}
const stateManager = StateManager.get()
const globalUseAutoCondense = stateManager.getGlobalSettingsKey("useAutoCondense") ?? false
// Auto compact is on by default; keep this fallback aligned with the
// `useAutoCondense` default in shared/storage/state-keys.ts.
const globalUseAutoCondense = stateManager.getGlobalSettingsKey("useAutoCondense") ?? true
const compactionStrategy = readCompactionStrategyGlobally()
const enableCheckpoints = stateManager.getGlobalSettingsKey("enableCheckpointsSetting") ?? true
const useAutoCondense = input.taskSettings?.useAutoCondense ?? globalUseAutoCondense
+1 -1
View File
@@ -274,7 +274,7 @@ const USER_SETTINGS_FIELDS = {
hooksEnabled: { default: true as boolean },
yoloModeToggled: { default: false as boolean },
autoApproveAllToggled: { default: false as boolean },
useAutoCondense: { default: false as boolean },
useAutoCondense: { default: true as boolean },
subagentsEnabled: { default: false as boolean },
worktreesEnabled: { default: false as boolean },
preferredLanguage: { default: "English" as string },
@@ -298,7 +298,7 @@ export const ExtensionStateContextProvider: React.FC<{
onboardingModels: undefined,
mcpResponsesCollapsed: false, // Default value (expanded), will be overwritten by extension state
yoloModeToggled: false,
useAutoCondense: false,
useAutoCondense: true,
compactionStrategy: "basic",
subagentsEnabled: false,
worktreesEnabled: { user: true, featureFlag: false },