mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
refactor(experiments): improve type safety for experiment configuration
Change ExperimentId type to be value-based rather than key-based Make experiment record types more strict with proper typing Pass full experiment config object instead of single boolean flag Update type definitions and usages across codebase
This commit is contained in:
@@ -61,7 +61,7 @@ import { OpenRouterHandler } from "../api/providers/openrouter"
|
||||
import { McpHub } from "../services/mcp/McpHub"
|
||||
import crypto from "crypto"
|
||||
import { insertGroups } from "./diff/insert-groups"
|
||||
import { EXPERIMENT_IDS } from "../shared/experiments"
|
||||
import { EXPERIMENT_IDS, experiments as Experiments } from "../shared/experiments"
|
||||
|
||||
const cwd =
|
||||
vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution
|
||||
@@ -117,7 +117,7 @@ export class Cline {
|
||||
task?: string | undefined,
|
||||
images?: string[] | undefined,
|
||||
historyItem?: HistoryItem | undefined,
|
||||
experimentalDiffStrategy: boolean = false,
|
||||
experiments?: Record<string, boolean>,
|
||||
) {
|
||||
if (!task && !images && !historyItem) {
|
||||
throw new Error("Either historyItem or task/images must be provided")
|
||||
@@ -139,7 +139,7 @@ export class Cline {
|
||||
}
|
||||
|
||||
// Initialize diffStrategy based on current state
|
||||
this.updateDiffStrategy(experimentalDiffStrategy)
|
||||
this.updateDiffStrategy(Experiments.isEnabled(experiments ?? {}, EXPERIMENT_IDS.DIFF_STRATEGY))
|
||||
|
||||
if (task || images) {
|
||||
this.startTask(task, images)
|
||||
|
||||
Reference in New Issue
Block a user