feat: rename search_and_replace tool to edit with new parameter structure#11296
Open
hannesrudolph wants to merge 5 commits intomainfrom
Open
feat: rename search_and_replace tool to edit with new parameter structure#11296hannesrudolph wants to merge 5 commits intomainfrom
hannesrudolph wants to merge 5 commits intomainfrom
Conversation
Contributor
All previously flagged issues have been resolved. No new issues found in the latest commits (orphaned file deletion, XML false-positive fix, test stabilization for CI).
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
01335c6 to
0a1377c
Compare
…ture - Add new 'edit' tool with file_path, old_string, new_string, replace_all params - Keep search_and_replace as backward-compatible alias via TOOL_ALIASES - Create EditTool execution handler with replace_all and uniqueness checking - Update NativeToolCallParser for both edit and search_and_replace names - Update presentAssistantMessage routing for both tool names - Add alias resolution to isToolAllowedForMode for customTools validation - Reduce SearchAndReplaceTool.ts to re-export wrapper from EditTool - Add 16 new EditTool tests, update searchAndReplaceTool tests - MiniMax includedTools: ['search_and_replace'] continues to work via alias
52ad6f3 to
285a161
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the
search_and_replacetool toeditwith a new flat parameter structure (file_path,old_string,new_string,replace_all), replacing the old batch operations array. Keepssearch_and_replaceas a backward-compatible alias so models like MiniMax that reference it inincludedToolscontinue to work without changes.Changes
edittool definition (src/core/prompts/tools/native-tools/edit.ts) withfile_path,old_string,new_string,replace_allparametersEditToolexecution handler (src/core/tools/EditTool.ts) withreplace_allsupport and uniqueness checkingsearch_and_replace: "edit"toTOOL_ALIASES— models withincludedTools: ["search_and_replace"](e.g., MiniMax) get theedittool renamed assearch_and_replaceNativeToolCallParser.tshandles both"edit"and"search_and_replace"tool names with the new parameter structurepresentAssistantMessage.tsroutes both tool names toEditToolisToolAllowedForModenow resolves aliases when checking customTools, ensuringsearch_and_replaceinincludedToolscorrectly maps toeditSearchAndReplaceTool.tsreduced to a 2-line re-export fromEditTool"edit"totoolNames,"replace_all"totoolParamNames, updatedNativeToolArgsTest Results
src/suite: 341 passed (29 pre-existing failures from missing@ai-sdk/amazon-bedrock— unrelated)packages/types: 170/170 passingImportant
Renames
search_and_replacetool toeditwith new parameters, addsEditToolclass, and maintains backward compatibility with aliasing.search_and_replacetool toeditwith parametersfile_path,old_string,new_string,replace_all.search_and_replaceas alias for backward compatibility.EditToolclass inEditTool.tswith support forreplace_alland uniqueness checking.NativeToolCallParser.tsto handle both tool names with new parameters.presentAssistantMessage.tsto route both tool names toEditTool.validateToolUse.tsto resolve tool aliases.EditToolcovering various scenarios.searchAndReplaceTool.spec.ts.tool.tsto includeeditintoolNamesandtoolParamNames.HistoryPreview.spec.tsxfor test consistency.This description was created by
for 52ad6f3. You can customize this summary. It will automatically update as commits are pushed.