Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions packages/types/src/experiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
* ExperimentId
*/

export const experimentIds = [
"powerSteering",
"concurrentFileReads",
"disableCompletionCommand",
"marketplace",
"multiFileApplyDiff",
] as const
export const experimentIds = ["powerSteering", "disableCompletionCommand", "marketplace", "multiFileApplyDiff"] as const

export const experimentIdsSchema = z.enum(experimentIds)

Expand All @@ -24,7 +18,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>

export const experimentsSchema = z.object({
powerSteering: z.boolean().optional(),
concurrentFileReads: z.boolean().optional(),
disableCompletionCommand: z.boolean().optional(),
marketplace: z.boolean().optional(),
multiFileApplyDiff: z.boolean().optional(),
Expand Down
104 changes: 52 additions & 52 deletions src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/prompts/tools/read-file.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ToolArgs } from "./types"

export function getReadFileDescription(args: ToolArgs): string {
const maxConcurrentReads = args.settings?.maxConcurrentFileReads ?? 15
const maxConcurrentReads = args.settings?.maxConcurrentFileReads ?? 5
const isMultipleReadsEnabled = maxConcurrentReads > 1

return `## read_file
Expand Down
9 changes: 2 additions & 7 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ export class ClineProvider
language: language ?? formatLanguage(vscode.env.language),
renderContext: this.renderContext,
maxReadFileLine: maxReadFileLine ?? -1,
maxConcurrentFileReads: maxConcurrentFileReads ?? 15,
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
settingsImportedAt: this.settingsImportedAt,
terminalCompressProgressBar: terminalCompressProgressBar ?? true,
hasSystemPromptOverride,
Expand Down Expand Up @@ -1586,12 +1586,7 @@ export class ClineProvider
telemetrySetting: stateValues.telemetrySetting || "unset",
showRooIgnoredFiles: stateValues.showRooIgnoredFiles ?? true,
maxReadFileLine: stateValues.maxReadFileLine ?? -1,
maxConcurrentFileReads: experiments.isEnabled(
stateValues.experiments ?? experimentDefault,
EXPERIMENT_IDS.CONCURRENT_FILE_READS,
)
? (stateValues.maxConcurrentFileReads ?? 15)
: 1,
maxConcurrentFileReads: stateValues.maxConcurrentFileReads ?? 5,
historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false,
cloudUserInfo,
cloudIsAuthenticated,
Expand Down
28 changes: 0 additions & 28 deletions src/shared/__tests__/experiments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: false,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
Expand All @@ -39,7 +38,6 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: true,
marketplace: false,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
Expand All @@ -50,34 +48,11 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: false,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})

it("returns false when CONCURRENT_FILE_READS experiment is not enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: false,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.CONCURRENT_FILE_READS)).toBe(false)
})

it("returns true when CONCURRENT_FILE_READS experiment is enabled", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: false,
concurrentFileReads: true,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.CONCURRENT_FILE_READS)).toBe(true)
})
})
describe("MARKETPLACE", () => {
it("is configured correctly", () => {
Expand All @@ -93,7 +68,6 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: false,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
Expand All @@ -104,7 +78,6 @@ describe("experiments", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
marketplace: true,
concurrentFileReads: false,
disableCompletionCommand: false,
multiFileApplyDiff: false,
}
Expand All @@ -114,7 +87,6 @@ describe("experiments", () => {
it("returns false when MARKETPLACE experiment is not present", () => {
const experiments: Record<ExperimentId, boolean> = {
powerSteering: false,
concurrentFileReads: false,
// marketplace missing
} as any
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.MARKETPLACE)).toBe(false)
Expand Down
2 changes: 0 additions & 2 deletions src/shared/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { AssertEqual, Equals, Keys, Values, ExperimentId, Experiments } fro

export const EXPERIMENT_IDS = {
MARKETPLACE: "marketplace",
CONCURRENT_FILE_READS: "concurrentFileReads",
MULTI_FILE_APPLY_DIFF: "multiFileApplyDiff",
DISABLE_COMPLETION_COMMAND: "disableCompletionCommand",
POWER_STEERING: "powerSteering",
Expand All @@ -18,7 +17,6 @@ interface ExperimentConfig {

export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
MARKETPLACE: { enabled: false },
CONCURRENT_FILE_READS: { enabled: false },
MULTI_FILE_APPLY_DIFF: { enabled: false },
DISABLE_COMPLETION_COMMAND: { enabled: false },
POWER_STEERING: { enabled: false },
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
maxWorkspaceFiles: number
showRooIgnoredFiles?: boolean
maxReadFileLine?: number
maxConcurrentFileReads?: number
setCachedStateField: SetCachedStateField<
| "autoCondenseContext"
| "autoCondenseContextPercent"
Expand All @@ -70,6 +71,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
| "maxWorkspaceFiles"
| "showRooIgnoredFiles"
| "maxReadFileLine"
| "maxConcurrentFileReads"
>
}

Expand All @@ -84,6 +86,7 @@ export const ContextManagementSettings = ({
showRooIgnoredFiles,
setCachedStateField,
maxReadFileLine,
maxConcurrentFileReads,
className,
...props
}: ContextManagementSettingsProps) => {
Expand Down Expand Up @@ -136,6 +139,26 @@ export const ContextManagementSettings = ({
</div>
</div>

<div>
<span className="block font-medium mb-1">
{t("settings:contextManagement.maxConcurrentFileReads.label")}
</span>
<div className="flex items-center gap-2">
<Slider
min={1}
max={100}
step={1}
value={[Math.max(1, maxConcurrentFileReads ?? 5)]}
onValueChange={([value]) => setCachedStateField("maxConcurrentFileReads", value)}
data-testid="max-concurrent-file-reads-slider"
/>
<span className="w-10 text-sm">{Math.max(1, maxConcurrentFileReads ?? 5)}</span>
</div>
<div className="text-vscode-descriptionForeground text-sm mt-1 mb-3">
{t("settings:contextManagement.maxConcurrentFileReads.description")}
</div>
</div>

<div>
<VSCodeCheckbox
checked={showRooIgnoredFiles}
Expand All @@ -145,7 +168,7 @@ export const ContextManagementSettings = ({
{t("settings:contextManagement.rooignore.label")}
</label>
</VSCodeCheckbox>
<div className="text-vscode-descriptionForeground text-sm mt-1">
<div className="text-vscode-descriptionForeground text-sm mt-1 mb-3">
{t("settings:contextManagement.rooignore.description")}
</div>
</div>
Expand Down Expand Up @@ -186,8 +209,7 @@ export const ContextManagementSettings = ({
</div>
</div>
</Section>

<Section>
<Section className="pt-2">
<VSCodeCheckbox
checked={autoCondenseContext}
onChange={(e: any) => setCachedStateField("autoCondenseContext", e.target.checked)}
Expand Down
20 changes: 1 addition & 19 deletions webview-ui/src/components/settings/ExperimentalSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import { SectionHeader } from "./SectionHeader"
import { Section } from "./Section"
import { ExperimentalFeature } from "./ExperimentalFeature"
import { CodeIndexSettings } from "./CodeIndexSettings"
import { ConcurrentFileReadsExperiment } from "./ConcurrentFileReadsExperiment"

type ExperimentalSettingsProps = HTMLAttributes<HTMLDivElement> & {
experiments: Experiments
setExperimentEnabled: SetExperimentEnabled
maxConcurrentFileReads?: number
setCachedStateField: SetCachedStateField<"codebaseIndexConfig" | "maxConcurrentFileReads">
setCachedStateField: SetCachedStateField<"codebaseIndexConfig">
// CodeIndexSettings props
codebaseIndexModels: CodebaseIndexModels | undefined
codebaseIndexConfig: CodebaseIndexConfig | undefined
Expand All @@ -32,7 +30,6 @@ type ExperimentalSettingsProps = HTMLAttributes<HTMLDivElement> & {
export const ExperimentalSettings = ({
experiments,
setExperimentEnabled,
maxConcurrentFileReads,
setCachedStateField,
codebaseIndexModels,
codebaseIndexConfig,
Expand All @@ -57,21 +54,6 @@ export const ExperimentalSettings = ({
{Object.entries(experimentConfigsMap)
.filter((config) => config[0] !== "DIFF_STRATEGY" && config[0] !== "MULTI_SEARCH_AND_REPLACE")
.map((config) => {
if (config[0] === "CONCURRENT_FILE_READS") {
return (
<ConcurrentFileReadsExperiment
key={config[0]}
enabled={experiments[EXPERIMENT_IDS.CONCURRENT_FILE_READS] ?? false}
onEnabledChange={(enabled) =>
setExperimentEnabled(EXPERIMENT_IDS.CONCURRENT_FILE_READS, enabled)
}
maxConcurrentFileReads={maxConcurrentFileReads ?? 15}
onMaxConcurrentFileReadsChange={(value) =>
setCachedStateField("maxConcurrentFileReads", value)
}
/>
)
}
if (config[0] === "MULTI_FILE_APPLY_DIFF") {
return (
<ExperimentalFeature
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
vscode.postMessage({ type: "maxWorkspaceFiles", value: maxWorkspaceFiles ?? 200 })
vscode.postMessage({ type: "showRooIgnoredFiles", bool: showRooIgnoredFiles })
vscode.postMessage({ type: "maxReadFileLine", value: maxReadFileLine ?? -1 })
vscode.postMessage({ type: "maxConcurrentFileReads", value: cachedState.maxConcurrentFileReads ?? 15 })
vscode.postMessage({ type: "maxConcurrentFileReads", value: cachedState.maxConcurrentFileReads ?? 5 })
vscode.postMessage({ type: "currentApiConfigName", text: currentApiConfigName })
vscode.postMessage({ type: "updateExperimental", values: experiments })
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: alwaysAllowModeSwitch })
Expand Down Expand Up @@ -627,6 +627,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
maxWorkspaceFiles={maxWorkspaceFiles ?? 200}
showRooIgnoredFiles={showRooIgnoredFiles}
maxReadFileLine={maxReadFileLine}
maxConcurrentFileReads={maxConcurrentFileReads}
setCachedStateField={setCachedStateField}
/>
)}
Expand Down Expand Up @@ -656,7 +657,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
<ExperimentalSettings
setExperimentEnabled={setExperimentEnabled}
experiments={experiments}
maxConcurrentFileReads={maxConcurrentFileReads}
setCachedStateField={setCachedStateField}
codebaseIndexModels={codebaseIndexModels}
codebaseIndexConfig={codebaseIndexConfig}
Expand Down
Loading
Loading