Skip to content

Commit 7ec2568

Browse files
committed
Remove search_and_replace experiment and related references
1 parent a044883 commit 7ec2568

File tree

12 files changed

+465
-70
lines changed

12 files changed

+465
-70
lines changed

evals/packages/types/src/roo-code-defaults.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const rooCodeDefaults: RooCodeSettings = {
5656
diffEnabled: true,
5757
fuzzyMatchThreshold: 1.0,
5858
experiments: {
59-
search_and_replace: false,
6059
insert_content: false,
6160
powerSteering: false,
6261
},

evals/packages/types/src/roo-code.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export type CustomSupportPrompts = z.infer<typeof customSupportPromptsSchema>
271271
* ExperimentId
272272
*/
273273

274-
export const experimentIds = ["search_and_replace", "insert_content", "powerSteering"] as const
274+
export const experimentIds = ["insert_content", "powerSteering"] as const
275275

276276
export const experimentIdsSchema = z.enum(experimentIds)
277277

@@ -282,7 +282,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
282282
*/
283283

284284
const experimentsSchema = z.object({
285-
search_and_replace: z.boolean(),
286285
insert_content: z.boolean(),
287286
powerSteering: z.boolean(),
288287
})

src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Lines changed: 458 additions & 13 deletions
Large diffs are not rendered by default.

src/core/prompts/__tests__/system.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ describe("SYSTEM_PROMPT", () => {
171171
beforeEach(() => {
172172
// Reset experiments before each test to ensure they're disabled by default
173173
experiments = {
174-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: false,
175174
[EXPERIMENT_IDS.INSERT_BLOCK]: false,
176175
}
177176
})
@@ -482,7 +481,6 @@ describe("SYSTEM_PROMPT", () => {
482481
it("should disable experimental tools by default", async () => {
483482
// Set experiments to explicitly disable experimental tools
484483
const experimentsConfig = {
485-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: false,
486484
[EXPERIMENT_IDS.INSERT_BLOCK]: false,
487485
}
488486

@@ -508,15 +506,13 @@ describe("SYSTEM_PROMPT", () => {
508506
// Check that experimental tool sections are not included
509507
const toolSections = prompt.split("\n## ").slice(1)
510508
const toolNames = toolSections.map((section) => section.split("\n")[0].trim())
511-
expect(toolNames).not.toContain("search_and_replace")
512509
expect(toolNames).not.toContain("insert_content")
513510
expect(prompt).toMatchSnapshot()
514511
})
515512

516513
it("should enable experimental tools when explicitly enabled", async () => {
517514
// Set experiments for testing experimental features
518515
const experimentsEnabled = {
519-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: true,
520516
[EXPERIMENT_IDS.INSERT_BLOCK]: true,
521517
}
522518

@@ -544,15 +540,13 @@ describe("SYSTEM_PROMPT", () => {
544540
const toolNames = toolSections.map((section) => section.split("\n")[0].trim())
545541

546542
// Verify experimental tools are included in the prompt when enabled
547-
expect(toolNames).toContain("search_and_replace")
548543
expect(toolNames).toContain("insert_content")
549544
expect(prompt).toMatchSnapshot()
550545
})
551546

552547
it("should selectively enable experimental tools", async () => {
553548
// Set experiments for testing selective enabling
554549
const experimentsSelective = {
555-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: true,
556550
[EXPERIMENT_IDS.INSERT_BLOCK]: false,
557551
}
558552

@@ -580,14 +574,12 @@ describe("SYSTEM_PROMPT", () => {
580574
const toolNames = toolSections.map((section) => section.split("\n")[0].trim())
581575

582576
// Verify only enabled experimental tools are included
583-
expect(toolNames).toContain("search_and_replace")
584577
expect(toolNames).not.toContain("insert_content")
585578
expect(prompt).toMatchSnapshot()
586579
})
587580

588581
it("should list all available editing tools in base instruction", async () => {
589582
const experiments = {
590-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: true,
591583
[EXPERIMENT_IDS.INSERT_BLOCK]: true,
592584
}
593585

@@ -615,7 +607,6 @@ describe("SYSTEM_PROMPT", () => {
615607
})
616608
it("should provide detailed instructions for each enabled tool", async () => {
617609
const experiments = {
618-
[EXPERIMENT_IDS.SEARCH_AND_REPLACE]: true,
619610
[EXPERIMENT_IDS.INSERT_BLOCK]: true,
620611
}
621612

@@ -640,7 +631,6 @@ describe("SYSTEM_PROMPT", () => {
640631
"You should always prefer using other editing tools over write_to_file when making changes to existing files since write_to_file is much slower and cannot handle large files.",
641632
)
642633
expect(prompt).toContain("The insert_content tool adds lines of text to files")
643-
expect(prompt).toContain("The search_and_replace tool finds and replaces text or regex in files")
644634
})
645635
})
646636

src/core/prompts/sections/rules.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
1919
if (experiments?.["insert_content"]) {
2020
availableTools.push("insert_content (for adding lines to existing files)")
2121
}
22-
if (experiments?.["search_and_replace"]) {
23-
availableTools.push("search_and_replace (for finding and replacing individual pieces of text)")
24-
}
22+
23+
availableTools.push("search_and_replace (for finding and replacing individual pieces of text)")
2524

2625
// Base editing instruction mentioning all available tools
2726
if (availableTools.length > 1) {
@@ -38,11 +37,9 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
3837
)
3938
}
4039

41-
if (experiments?.["search_and_replace"]) {
42-
instructions.push(
43-
"- The search_and_replace tool finds and replaces text or regex in files. This tool allows you to search for a specific regex pattern or text and replace it with another value. Be cautious when using this tool to ensure you are replacing the correct text. It can support multiple operations at once.",
44-
)
45-
}
40+
instructions.push(
41+
"- The search_and_replace tool finds and replaces text or regex in files. This tool allows you to search for a specific regex pattern or text and replace it with another value. Be cautious when using this tool to ensure you are replacing the correct text. It can support multiple operations at once.",
42+
)
4643

4744
if (availableTools.length > 1) {
4845
instructions.push(

src/exports/roo-code.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ type GlobalSettings = {
288288
fuzzyMatchThreshold?: number | undefined
289289
experiments?:
290290
| {
291-
search_and_replace: boolean
292291
insert_content: boolean
293292
powerSteering: boolean
294293
}

src/exports/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ type GlobalSettings = {
291291
fuzzyMatchThreshold?: number | undefined
292292
experiments?:
293293
| {
294-
search_and_replace: boolean
295294
insert_content: boolean
296295
powerSteering: boolean
297296
}

src/schemas/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export type CustomSupportPrompts = z.infer<typeof customSupportPromptsSchema>
277277
* ExperimentId
278278
*/
279279

280-
export const experimentIds = ["search_and_replace", "insert_content", "powerSteering"] as const
280+
export const experimentIds = ["insert_content", "powerSteering"] as const
281281

282282
export const experimentIdsSchema = z.enum(experimentIds)
283283

@@ -288,7 +288,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
288288
*/
289289

290290
const experimentsSchema = z.object({
291-
search_and_replace: z.boolean(),
292291
insert_content: z.boolean(),
293292
powerSteering: z.boolean(),
294293
})

src/shared/__tests__/experiments.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe("experiments", () => {
1414
it("returns false when experiment is not enabled", () => {
1515
const experiments: Record<ExperimentId, boolean> = {
1616
powerSteering: false,
17-
search_and_replace: false,
1817
insert_content: false,
1918
}
2019
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
@@ -23,15 +22,13 @@ describe("experiments", () => {
2322
it("returns true when experiment is enabled", () => {
2423
const experiments: Record<ExperimentId, boolean> = {
2524
powerSteering: true,
26-
search_and_replace: false,
2725
insert_content: false,
2826
}
2927
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(true)
3028
})
3129

3230
it("returns false when experiment is not present", () => {
3331
const experiments: Record<ExperimentId, boolean> = {
34-
search_and_replace: false,
3532
insert_content: false,
3633
powerSteering: false,
3734
}

src/shared/__tests__/modes.test.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -258,51 +258,26 @@ describe("isToolAllowedForMode", () => {
258258
describe("experimental tools", () => {
259259
it("disables tools when experiment is disabled", () => {
260260
const experiments = {
261-
search_and_replace: false,
262261
insert_content: false,
263262
}
264263

265-
expect(
266-
isToolAllowedForMode(
267-
"search_and_replace",
268-
"test-exp-mode",
269-
customModes,
270-
undefined,
271-
undefined,
272-
experiments,
273-
),
274-
).toBe(false)
275-
276264
expect(
277265
isToolAllowedForMode("insert_content", "test-exp-mode", customModes, undefined, undefined, experiments),
278266
).toBe(false)
279267
})
280268

281269
it("allows tools when experiment is enabled", () => {
282270
const experiments = {
283-
search_and_replace: true,
284271
insert_content: true,
285272
}
286273

287-
expect(
288-
isToolAllowedForMode(
289-
"search_and_replace",
290-
"test-exp-mode",
291-
customModes,
292-
undefined,
293-
undefined,
294-
experiments,
295-
),
296-
).toBe(true)
297-
298274
expect(
299275
isToolAllowedForMode("insert_content", "test-exp-mode", customModes, undefined, undefined, experiments),
300276
).toBe(true)
301277
})
302278

303279
it("allows non-experimental tools when experiments are disabled", () => {
304280
const experiments = {
305-
search_and_replace: false,
306281
insert_content: false,
307282
}
308283

0 commit comments

Comments
 (0)