Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 42 additions & 3 deletions src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions src/core/prompts/sections/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
} else {
availableTools.push("write_to_file (for creating new files or complete file rewrites)")
}

availableTools.push("append_to_file (for appending content to the end of files)")

if (experiments?.["insert_content"]) {
availableTools.push("insert_content (for adding lines to existing files)")
}
if (experiments?.["append_to_file"]) {
availableTools.push("append_to_file (for appending content to the end of files)")
}
if (experiments?.["search_and_replace"]) {
availableTools.push("search_and_replace (for finding and replacing individual pieces of text)")
}

// Base editing instruction mentioning all available tools
if (availableTools.length > 1) {
instructions.push(`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`)
instructions.push(
`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`,
"- The append_to_file tool adds content to the end of files, such as appending new log entries or adding new data records. This tool will always add the content at the end of the file.",
)
}

// Additional details for experimental features
Expand All @@ -35,12 +38,6 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
)
}

if (experiments?.["append_to_file"]) {
instructions.push(
"- The append_to_file tool adds content to the end of files, such as appending new log entries or adding new data records. This tool will always add the content at the end of the file.",
)
}

if (experiments?.["search_and_replace"]) {
instructions.push(
"- 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.",
Expand Down
1 change: 0 additions & 1 deletion src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ type GlobalSettings = {
search_and_replace: boolean
insert_content: boolean
powerSteering: boolean
append_to_file: boolean
}
| undefined
language?:
Expand Down
1 change: 0 additions & 1 deletion src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ type GlobalSettings = {
search_and_replace: boolean
insert_content: boolean
powerSteering: boolean
append_to_file: boolean
}
| undefined
language?:
Expand Down
3 changes: 1 addition & 2 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export type CustomSupportPrompts = z.infer<typeof customSupportPromptsSchema>
* ExperimentId
*/

export const experimentIds = ["search_and_replace", "insert_content", "powerSteering", "append_to_file"] as const
export const experimentIds = ["search_and_replace", "insert_content", "powerSteering"] as const

export const experimentIdsSchema = z.enum(experimentIds)

Expand All @@ -290,7 +290,6 @@ const experimentsSchema = z.object({
search_and_replace: z.boolean(),
insert_content: z.boolean(),
powerSteering: z.boolean(),
append_to_file: z.boolean(),
})

export type Experiments = z.infer<typeof experimentsSchema>
Expand Down
3 changes: 0 additions & 3 deletions src/shared/__tests__/experiments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe("experiments", () => {
powerSteering: false,
search_and_replace: false,
insert_content: false,
append_to_file: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(false)
})
Expand All @@ -26,7 +25,6 @@ describe("experiments", () => {
powerSteering: true,
search_and_replace: false,
insert_content: false,
append_to_file: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).toBe(true)
})
Expand All @@ -36,7 +34,6 @@ describe("experiments", () => {
search_and_replace: false,
insert_content: false,
powerSteering: false,
append_to_file: false,
}
expect(Experiments.isEnabled(experiments, EXPERIMENT_IDS.POWER_STEERING)).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 @@ -7,7 +7,6 @@ export const EXPERIMENT_IDS = {
INSERT_BLOCK: "insert_content",
SEARCH_AND_REPLACE: "search_and_replace",
POWER_STEERING: "powerSteering",
APPEND_BLOCK: "append_to_file",
} as const satisfies Record<string, ExperimentId>

type _AssertExperimentIds = AssertEqual<Equals<ExperimentId, Values<typeof EXPERIMENT_IDS>>>
Expand All @@ -22,7 +21,6 @@ export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
INSERT_BLOCK: { enabled: false },
SEARCH_AND_REPLACE: { enabled: false },
POWER_STEERING: { enabled: false },
APPEND_BLOCK: { enabled: false },
}

export const experimentDefault = Object.fromEntries(
Expand Down