Skip to content

Commit 7c36b58

Browse files
committed
feat: change default value of useAgentRules to true
- Updated default value in package.json from false to true - Updated implementation to load AGENTS.md when useAgentRules is undefined - Updated test expectations to match new default behavior - Updated fallback values in Task.ts and generateSystemPrompt.ts This enables AGENTS.md loading by default as requested by @mrubens
1 parent 8456f02 commit 7c36b58

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ describe("addCustomInstructions", () => {
554554
expect(result).not.toContain("Agent rules from AGENTS.md file")
555555
})
556556

557-
it("should not load AGENTS.md by default when useAgentRules is undefined", async () => {
557+
it("should load AGENTS.md by default when useAgentRules is undefined", async () => {
558558
// Simulate no .roo/rules-test-mode directory
559559
statMock.mockRejectedValueOnce({ code: "ENOENT" })
560560

@@ -574,8 +574,9 @@ describe("addCustomInstructions", () => {
574574
{}, // No useAgentRules specified
575575
)
576576

577-
expect(result).not.toContain("# Agent Rules Standard (AGENTS.md):")
578-
expect(result).not.toContain("Agent rules from AGENTS.md file")
577+
expect(result).toContain("# Agent Rules Standard (AGENTS.md):")
578+
expect(result).toContain("Agent rules from AGENTS.md file")
579+
expect(readFileMock).toHaveBeenCalledWith(expect.stringContaining("AGENTS.md"), "utf-8")
579580
})
580581

581582
it("should handle missing AGENTS.md gracefully", async () => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ export async function addCustomInstructions(
318318
rules.push(options.rooIgnoreInstructions)
319319
}
320320

321-
// Add AGENTS.md content if enabled (default: false)
322-
if (options.useAgentRules === true) {
321+
// Add AGENTS.md content if enabled (default: true)
322+
if (options.useAgentRules !== false) {
323323
const agentRulesContent = await loadAgentRulesFile(cwd)
324324
if (agentRulesContent && agentRulesContent.trim()) {
325325
rules.push(agentRulesContent.trim())

src/core/task/Task.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,8 +1663,7 @@ export class Task extends EventEmitter<ClineEvents> {
16631663
{
16641664
maxConcurrentFileReads,
16651665
todoListEnabled: apiConfiguration?.todoListEnabled,
1666-
useAgentRules:
1667-
vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? false,
1666+
useAgentRules: vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ?? true,
16681667
},
16691668
)
16701669
})()

src/core/webview/generateSystemPrompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
8686
useAgentRules:
8787
provider.context.globalState.get("useAgentRules") ??
8888
vscode.workspace.getConfiguration("roo-cline").get<boolean>("useAgentRules") ??
89-
false,
89+
true,
9090
},
9191
)
9292

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
},
390390
"roo-cline.useAgentRules": {
391391
"type": "boolean",
392-
"default": false,
392+
"default": true,
393393
"description": "%settings.useAgentRules.description%"
394394
}
395395
}

0 commit comments

Comments
 (0)