Skip to content

Commit cdeef22

Browse files
committed
fix: address PR feedback - restore autoCondenseContext in tests and remove type assertion
1 parent d9ecb75 commit cdeef22

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/core/tools/attemptCompletionTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "../../shared/tools"
1616
import { formatResponse } from "../prompts/responses"
1717
import { type ExecuteCommandOptions, executeCommand } from "./executeCommandTool"
18-
import { EXPERIMENT_IDS, experiments } from "../../shared/experiments"
18+
import { EXPERIMENT_IDS, experiments, experimentDefault } from "../../shared/experiments"
1919

2020
export async function attemptCompletionTool(
2121
cline: Task,
@@ -71,9 +71,9 @@ export async function attemptCompletionTool(
7171

7272
// Check if command execution is disabled via experiment
7373
const state = await cline.providerRef.deref()?.getState()
74-
const experimentsConfig = state?.experiments ?? {}
74+
const experimentsConfig = state?.experiments ?? experimentDefault
7575
const isCommandDisabled = experiments.isEnabled(
76-
experimentsConfig as Record<string, boolean>,
76+
experimentsConfig,
7777
EXPERIMENT_IDS.DISABLE_COMPLETION_COMMAND,
7878
)
7979

webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ describe("mergeExtensionState", () => {
221221
apiConfiguration: { modelMaxThinkingTokens: 456, modelTemperature: 0.3 },
222222
experiments: {
223223
powerSteering: true,
224+
autoCondenseContext: true,
224225
concurrentFileReads: true,
225226
disableCompletionCommand: false,
226227
} as Record<ExperimentId, boolean>,
@@ -235,6 +236,7 @@ describe("mergeExtensionState", () => {
235236

236237
expect(result.experiments).toEqual({
237238
powerSteering: true,
239+
autoCondenseContext: true,
238240
concurrentFileReads: true,
239241
disableCompletionCommand: false,
240242
})

0 commit comments

Comments
 (0)