Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Oct 28, 2025

Summary

This PR addresses Issue #8891 by completely removing the search_and_replace tool from the codebase.

Changes Made

Core Implementation

  • Deleted src/core/tools/searchAndReplaceTool.ts - the main implementation file
  • Removed tool execution handling from presentAssistantMessage.ts
  • Removed tool from type definitions in packages/types/src/tool.ts

Type System & Interfaces

  • Removed SearchAndReplaceToolUse interface from src/shared/tools.ts
  • Removed tool from TOOL_GROUPS and TOOL_DISPLAY_NAMES
  • Removed from ExtensionMessage.ts tool types

Prompt System

  • Deleted tool description file src/core/prompts/tools/search-and-replace.ts
  • Removed references from prompt index and mapping
  • Removed from system rules and response formatting guidance

UI & Localization

  • Removed case handling from ChatRow.tsx component
  • Removed all localization strings from 18 language files
  • Cleaned up experimental feature flags

Tests

  • Removed references from mode restriction tests
  • Updated 13 snapshot files to reflect prompt changes
  • Note: E2E tests were already marked as skipped

Testing

  • ✅ TypeScript compilation passes
  • ✅ All tests pass with updated snapshots
  • ✅ Linting passes

Impact

This is a breaking change that removes a feature. The search_and_replace tool will no longer be available to users. Other editing tools (apply_diff, write_to_file, insert_content) remain available for file modifications.

Closes #8891


Important

Remove search_and_replace tool from codebase, affecting core implementation, type system, UI, and tests.

  • Core Implementation:
    • Deleted searchAndReplaceTool.ts.
    • Removed tool handling from presentAssistantMessage.ts.
    • Removed tool from tool.ts type definitions.
  • Type System & Interfaces:
    • Removed SearchAndReplaceToolUse interface from tools.ts.
    • Removed tool from TOOL_GROUPS and TOOL_DISPLAY_NAMES.
    • Removed from ExtensionMessage.ts tool types.
  • Prompt System:
    • Deleted search-and-replace.ts description file.
    • Removed references from prompt index and mapping.
    • Removed from system rules and response formatting guidance.
  • UI & Localization:
    • Removed case handling from ChatRow.tsx.
    • Removed localization strings from 18 language files.
    • Cleaned up experimental feature flags.
  • Tests:
    • Removed references from mode restriction tests.
    • Updated 13 snapshot files to reflect prompt changes.
    • Deleted search-and-replace.test.ts file.
  • Misc:
    • Removed tool references from XML rule files.

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

- Deleted src/core/tools/searchAndReplaceTool.ts
- Removed import and case handling from presentAssistantMessage.ts
- Removed from toolNames array in packages/types/src/tool.ts
- Removed SearchAndReplaceToolUse interface from src/shared/tools.ts
- Deleted src/core/prompts/tools/search-and-replace.ts
- Removed from tool description map in prompts/tools/index.ts
- Removed from prompts rules and responses
- Removed from test files
- Snapshot files will be regenerated on test run

Fixes #8891
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 28, 2025 19:22
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 28, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Oct 28, 2025

PR Review Update

I've reviewed the latest changes and confirmed that all previously identified issues have been successfully resolved.

All Issues Resolved ✅

  • Incomplete removal of search_and_replace properties in ClineSayTool interface - Successfully removed all 6 orphaned properties (search, replace, useRegex, ignoreCase, startLine, endLine) from src/shared/ExtensionMessage.ts in commit 2017d37

Recent Improvements

✅ Removed obsolete E2E test file apps/vscode-e2e/src/suite/tools/search-and-replace.test.ts
✅ Removed orphaned properties from ClineSayTool interface
✅ Removed references from .roo/rules-issue-fixer/1_Workflow.xml
✅ Removed references from .roo/rules-merge-resolver/2_best_practices.xml
✅ Removed references from .roo/rules-merge-resolver/3_tool_usage.xml
✅ Cleaned up UI filtering in webview-ui/src/components/chat/ChatView.tsx

What Was Done Well (from previous reviews)

✅ Core implementation file deleted (src/core/tools/searchAndReplaceTool.ts)
✅ Tool execution handling removed from presentAssistantMessage.ts
✅ Tool removed from type definitions in packages/types/src/tool.ts
✅ Tool description file deleted and references removed from prompt system
✅ UI handling removed from ChatRow.tsx
✅ All localization strings removed from 18 language files
✅ Test files updated appropriately
✅ Snapshot files regenerated

Verification Complete

  • No remaining runtime references to search_and_replace tool
  • Remaining mentions are only historical (CHANGELOG.md) or unrelated (apply_diff documentation)
  • All changes are consistent with the goal of completely removing the tool

This PR has successfully accomplished its goal of completely removing the search_and_replace tool from the codebase.


Follow Along on Roo Code Cloud

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found beyond what was already noted in the review summary.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 28, 2025
@hannesrudolph
Copy link
Collaborator

@roomote run PR Fixeer mode on this PR

@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Oct 28, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Oct 28, 2025

ACK: Starting PR Fixer mode on this PR. Plan:

  1. Check out branch fix/remove-search-and-replace-tool
  2. Scan repo for any remaining references to search_and_replace/search-and-replace
  3. Build and run tests locally, fix breakages
  4. Push fixes to the PR branch and monitor CI
    I will post a summary after the checks pass.

@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Oct 28, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. The recent changes successfully cleaned up additional references to search_and_replace in rule files and UI code. However, there is still one outstanding issue that needs to be addressed before this PR can be approved (see the updated checklist in my top-level comment).

@roomote
Copy link
Contributor Author

roomote bot commented Oct 28, 2025

PR Fixer summary:

Changes applied on branch fix/remove-search-and-replace-tool:

Repository scan results:

Local verification:

  • Webview UI tests: pass (93 passed, 6 skipped)
  • Lint and type checks passed during commit

CI status:

  • All checks reported as passing: compile, analyze, CodeQL, translations, knip, integration tests, platform unit tests (ubuntu and windows)

Commit pushed:

This PR is now consistent with removal of the search_and_replace tool and ready for review and merge.

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Oct 30, 2025
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 30, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All previously identified issues have been resolved. The PR successfully completes the removal of the search_and_replace tool from the codebase.

@hannesrudolph
Copy link
Collaborator

Is roomote’s feedback valid?

They were. Fixed.

@mrubens mrubens merged commit 81d5f63 into main Oct 31, 2025
9 checks passed
@mrubens mrubens deleted the fix/remove-search-and-replace-tool branch October 31, 2025 02:51
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Oct 31, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 31, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Oct 31, 2025