Skip to content

Commit 2fc7bf5

Browse files
committed
fix: ensure AGENTS.md only loads when useAgentRules is explicitly true
1 parent 073e817 commit 2fc7bf5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@ export async function addCustomInstructions(
235235
globalCustomInstructions: string,
236236
cwd: string,
237237
mode: string,
238-
options: { language?: string; rooIgnoreInstructions?: string; useAgentRules?: boolean; settings?: Record<string, any> } = {},
238+
options: {
239+
language?: string
240+
rooIgnoreInstructions?: string
241+
useAgentRules?: boolean
242+
settings?: Record<string, any>
243+
} = {},
239244
): Promise<string> {
240245
const sections = []
241246

@@ -313,8 +318,8 @@ export async function addCustomInstructions(
313318
rules.push(options.rooIgnoreInstructions)
314319
}
315320

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

0 commit comments

Comments
 (0)