Skip to content

Instruction files prompt should include non-coding tasks like code exploration #287152

@TylerLeonhardt

Description

@TylerLeonhardt

Problem

The current instruction file prompt text in computeAutomaticInstructions.ts only mentions "modifying or creating new code":

entries.push('Here is a list of instruction files that contain rules for modifying or creating new code.');
entries.push('These files are important for ensuring that the code is modified or created correctly.');
entries.push('Please make sure to follow the rules specified in these files when working with the codebase.');

This wording causes the model to skip reading instruction files (especially nested AGENTS.md files) when the user is performing non-coding tasks like:

  • Asking questions about source code
  • Code exploration and understanding
  • Documentation lookups
  • Architecture discussions

Current Behavior

When a user asks a question about the codebase (e.g., "How does feature X work?"), the system finds the relevant AGENTS.md files but the model often refuses to read them because:

  1. The prompt explicitly says these files are for "modifying or creating new code"
  2. The task at hand (code exploration) doesn't involve writing or modifying code

Expected Behavior

Instruction files should be read and applied for any task related to the codebase, not just code modification tasks. This is especially important for nested AGENTS.md files that contain context-specific guidance.

Suggested Fix

Update the prompt wording to be more inclusive:

entries.push('Here is a list of instruction files that contain rules for working with this codebase.');
entries.push('These files are important for understanding the codebase structure, conventions, and best practices.');
entries.push('Please make sure to follow the rules specified in these files when working with the codebase.');

Or alternatively:

entries.push('Here is a list of instruction files that contain rules for understanding, modifying, or creating code.');
entries.push('These files are important for any task involving this codebase, including answering questions about the code.');
entries.push('Please make sure to acquire and follow the rules specified in these files when working with the codebase.');

Location

src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts

Metadata

Metadata

Labels

chatchat-agentchat-promptsPrompt and Instruction files related issuesfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions