Skip to content

Commit d3fb2b4

Browse files
committed
Ensure that all settings are passed in
1 parent 9ad49a1 commit d3fb2b4

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

src/core/prompts/__tests__/system-prompt.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,9 @@ describe("SYSTEM_PROMPT", () => {
577577

578578
it("should exclude update_todo_list tool when todoListEnabled is false", async () => {
579579
const settings = {
580+
maxConcurrentFileReads: 5,
580581
todoListEnabled: false,
582+
useAgentRules: true,
581583
}
582584

583585
const prompt = await SYSTEM_PROMPT(
@@ -607,7 +609,9 @@ describe("SYSTEM_PROMPT", () => {
607609

608610
it("should include update_todo_list tool when todoListEnabled is true", async () => {
609611
const settings = {
612+
maxConcurrentFileReads: 5,
610613
todoListEnabled: true,
614+
useAgentRules: true,
611615
}
612616

613617
const prompt = await SYSTEM_PROMPT(
@@ -636,7 +640,9 @@ describe("SYSTEM_PROMPT", () => {
636640

637641
it("should include update_todo_list tool when todoListEnabled is undefined", async () => {
638642
const settings = {
639-
// todoListEnabled not set
643+
maxConcurrentFileReads: 5,
644+
todoListEnabled: true,
645+
useAgentRules: true,
640646
}
641647

642648
const prompt = await SYSTEM_PROMPT(

src/core/prompts/sections/__tests__/custom-instructions.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ describe("addCustomInstructions", () => {
522522
"global instructions",
523523
"/fake/path",
524524
"test-mode",
525-
{ settings: { useAgentRules: true } },
525+
{ settings: { maxConcurrentFileReads: 5, todoListEnabled: true, useAgentRules: true } },
526526
)
527527

528528
expect(result).toContain("# Agent Rules Standard (AGENTS.md):")
@@ -547,7 +547,7 @@ describe("addCustomInstructions", () => {
547547
"global instructions",
548548
"/fake/path",
549549
"test-mode",
550-
{ settings: { useAgentRules: false } },
550+
{ settings: { maxConcurrentFileReads: 5, todoListEnabled: true, useAgentRules: false } },
551551
)
552552

553553
expect(result).not.toContain("# Agent Rules Standard (AGENTS.md):")
@@ -590,7 +590,7 @@ describe("addCustomInstructions", () => {
590590
"global instructions",
591591
"/fake/path",
592592
"test-mode",
593-
{ settings: { useAgentRules: true } },
593+
{ settings: { maxConcurrentFileReads: 5, todoListEnabled: true, useAgentRules: true } },
594594
)
595595

596596
expect(result).toContain("Global Instructions:\nglobal instructions")
@@ -618,7 +618,7 @@ describe("addCustomInstructions", () => {
618618
"global instructions",
619619
"/fake/path",
620620
"test-mode",
621-
{ settings: { useAgentRules: true } },
621+
{ settings: { maxConcurrentFileReads: 5, todoListEnabled: true, useAgentRules: true } },
622622
)
623623

624624
// Should contain both AGENTS.md and .roorules content

src/core/prompts/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Settings passed to system prompt generation functions
33
*/
44
export interface SystemPromptSettings {
5-
maxConcurrentFileReads?: number
6-
todoListEnabled?: boolean
7-
useAgentRules?: boolean
5+
maxConcurrentFileReads: number
6+
todoListEnabled: boolean
7+
useAgentRules: boolean
88
}

src/core/task/Task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,8 +1661,8 @@ export class Task extends EventEmitter<ClineEvents> {
16611661
rooIgnoreInstructions,
16621662
maxReadFileLine !== -1,
16631663
{
1664-
maxConcurrentFileReads,
1665-
todoListEnabled: apiConfiguration?.todoListEnabled,
1664+
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
1665+
todoListEnabled: apiConfiguration?.todoListEnabled ?? true,
16661666
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
16671667
},
16681668
)

src/core/webview/generateSystemPrompt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
8282
rooIgnoreInstructions,
8383
maxReadFileLine !== -1,
8484
{
85-
maxConcurrentFileReads,
86-
todoListEnabled: apiConfiguration?.todoListEnabled,
85+
maxConcurrentFileReads: maxConcurrentFileReads ?? 5,
86+
todoListEnabled: apiConfiguration?.todoListEnabled ?? true,
8787
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
8888
},
8989
)

0 commit comments

Comments
 (0)