Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jul 11, 2025

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

  • Modified architect mode's custom instructions to replace the specific mention of read_file or search_files with the more generic "using provided tools"
  • Updated all related test snapshots to reflect this change

Motivation

Previously, architect mode would suggest specific tools (read_file or search_files) for information gathering, which limited its ability to adapt when better tools like codebase_search were available. This change allows architect mode to:

  1. Leverage semantic search: When codebase_search is available (i.e., when the codebase is indexed), architect mode can now choose to use it for more intelligent context discovery
  2. Adapt to available capabilities: The mode can now dynamically select the most appropriate tool based on what's available in the current environment
  3. Future-proof tool selection: As new discovery tools are added, architect mode will automatically be able to consider them without requiring instruction updates

Technical Details

The change is minimal but impactful:

  • Before: "1. Do some information gathering (for example using read_file or search_files) to get more context about the task."
  • After: "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

  • All existing tests pass
  • Test snapshots have been updated to reflect the new instructions
  • The change maintains backward compatibility while enabling more intelligent behavior

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.ts and test snapshots.

  • Behavior:
    • Updated architect mode in modes.ts to use generic tool instructions instead of specific tools like read_file or search_files.
    • Allows dynamic selection of tools based on availability, such as codebase_search.
  • Testing:
    • Updated test snapshots in architect-mode-prompt.snap, mcp-server-creation-disabled.snap, and mcp-server-creation-enabled.snap to reflect new instructions.
    • Ensures backward compatibility while enabling dynamic tool selection.
  • Impact:
    • Enhances context discovery by leveraging available tools dynamically.
    • Future-proofs architect mode for new tool additions without instruction updates.

This description was created by Ellipsis for c50d955. You can customize this summary. It will automatically update as commits are pushed.

…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.
Copilot AI review requested due to automatic review settings July 11, 2025 20:04
@hannesrudolph hannesrudolph requested review from cte, jr and mrubens as code owners July 11, 2025 20:04
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Jul 11, 2025
Copy link
Contributor

Copilot AI left a 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_files mentions 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.

@delve-auditor
Copy link

delve-auditor bot commented Jul 11, 2025

No security or compliance issues detected. Reviewed everything up to c50d955.

Security Overview
  • 🔎 Scanned files: 13 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► src/shared/modes.ts
    Update information gathering instructions
► src/core/prompts/tests/snapshots/*
    Update system prompt snapshots with new tool reference text

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jul 11, 2025
@hannesrudolph
Copy link
Collaborator Author

The integration test failure appears to be unrelated to this PR's changes. The failing test is:

1) Roo Code use_mcp_tool Tool
     Should request MCP filesystem read_file tool and complete successfully:
     Error: Timeout after 45s

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.

@mrubens mrubens merged commit 39b8307 into main Jul 12, 2025
11 checks passed
@mrubens mrubens deleted the feat/architect-dynamic-tool-selection branch July 12, 2025 02:47
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants