-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Enable dynamic tool selection in architect mode for context discovery #5607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…covery - Remove hardcoded suggestions for read_file/search_files in architect mode - Replace with generic 'using provided tools' to allow dynamic selection - Enables architect mode to leverage codebase_search when available - Promotes more intelligent tool selection based on available capabilities - Updates test snapshots to reflect the instruction changes This change allows architect mode to adapt to the presence of different tools, particularly benefiting from semantic search via codebase_search when indexed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors architect mode’s guidance to reference “using provided tools” generically instead of naming specific tools, and updates all related test snapshots to match.
- Replaced hardcoded
read_file/search_filesmentions with “using provided tools” in architect mode instructions. - Updated snapshot tests under
src/core/prompts/__tests__/__snapshots__to reflect the new phrasing.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/modes.ts | Architect mode prompt updated to a generic “using provided tools” instruction. |
| src/core/prompts/tests/snapshots/system-prompt/with-undefined-mcp-hub.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-mcp-hub-provided.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-different-viewport-size.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-diff-enabled-undefined.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-diff-enabled-true.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-diff-enabled-false.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/with-computer-use-support.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/system-prompt/consistent-system-prompt.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/add-custom-instructions/partial-reads-enabled.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/add-custom-instructions/mcp-server-creation-enabled.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/add-custom-instructions/mcp-server-creation-disabled.snap | Snapshot updated to use generic tool phrasing. |
| src/core/prompts/tests/snapshots/add-custom-instructions/architect-mode-prompt.snap | Snapshot updated to use generic tool phrasing. |
|
✅ No security or compliance issues detected. Reviewed everything up to c50d955. Security Overview
Detected Code Changes
Reply to this PR with |
|
The integration test failure appears to be unrelated to this PR's changes. The failing test is: This is testing MCP (Model Context Protocol) tool functionality, while this PR only modifies the architect mode's instruction text from mentioning specific tools to using generic "using provided tools" phrasing. The changes don't affect any MCP-related code or functionality. The test appears to be flaky as it timed out after 45 seconds. All other tests pass successfully. |
Description
This PR updates the architect mode to use a more dynamic approach for tool selection during context discovery, rather than hardcoding specific tool suggestions.
Changes Made
read_fileorsearch_fileswith the more generic "using provided tools"Motivation
Previously, architect mode would suggest specific tools (
read_fileorsearch_files) for information gathering, which limited its ability to adapt when better tools likecodebase_searchwere available. This change allows architect mode to:codebase_searchis available (i.e., when the codebase is indexed), architect mode can now choose to use it for more intelligent context discoveryTechnical Details
The change is minimal but impactful:
"1. Do some information gathering (for example using read_file or search_files) to get more context about the task.""1. Do some information gathering (using provided tools) to get more context about the task."This promotes a more intelligent, context-aware approach to tool selection where the AI can choose the best tool for the job rather than being nudged toward specific options.
Testing
Impact
This change enhances architect mode's ability to gather context efficiently, particularly benefiting from semantic search capabilities when available, while maintaining flexibility for environments where only basic file operations are available.
Important
This PR updates architect mode to dynamically select tools for context discovery by using generic instructions, reflected in
modes.tsand test snapshots.modes.tsto use generic tool instructions instead of specific tools likeread_fileorsearch_files.codebase_search.architect-mode-prompt.snap,mcp-server-creation-disabled.snap, andmcp-server-creation-enabled.snapto reflect new instructions.This description was created by
for c50d955. You can customize this summary. It will automatically update as commits are pushed.