Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 22, 2025

What this PR does

  • Splits the native edit_file tool into provider-specific variants (e.g. edit_file_roo, edit_file_anthropic, edit_file_grok, edit_file_gemini, edit_file_codex).
  • Updates analytics so tool usage is tracked per edit_file_* variant.

Why

  • Different providers have slightly different native tool semantics; variant names make the active tool path explicit and avoid ambiguity.
  • Improves observability by distinguishing which edit tool variant was used.

User impact

Models prefer using edit_file over tool names such as apply_diff, this will make it easier for the model to decide what tool to use when editing a file.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 22, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 22, 2025

Oroocle Clock   Follow along on Roo Cloud

Re-review complete. All previously flagged items appear resolved, and no new issues found in the latest commit.

  • Fix double-counting of tool usage for edit_file_anthropic (remove extra recordToolUsage call)
  • Fix failing assertion in roo.spec.ts versionedSettings test (expected editToolVariant should match the updated fixture)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 22, 2025
@hannesrudolph hannesrudolph force-pushed the refactor/edit-file-provider-variants branch from 93324b3 to 665ff96 Compare December 22, 2025 02:01
@hannesrudolph hannesrudolph force-pushed the refactor/edit-file-provider-variants branch 2 times, most recently from d6531e2 to d6072dd Compare December 23, 2025 05:24
@hannesrudolph hannesrudolph force-pushed the refactor/edit-file-provider-variants branch from a560d87 to 6a7cccd Compare December 23, 2025 22:50
- Rename apply_diff.ts -> edit_file_roo.ts
- Rename apply_patch.ts -> edit_file_codex.ts
- Rename edit_file.ts -> edit_file_gemini.ts
- Rename search_replace.ts -> edit_file_grok.ts
- Add edit_file_anthropic.ts
- Remove search_and_replace.ts
- Update related imports and tool filtering logic
- Add old_string, new_string, patch to EDIT_OPERATION_PARAMS
- Support file_path parameter used by edit_file_grok/gemini variants
- Add codex patch parsing to extract and validate embedded file paths
- multiApplyDiffTool.spec.ts: import from EditFileRooTool instead of ApplyDiffTool
- searchAndReplaceTool.spec.ts: import from EditFileAnthropicTool, use edit_file_anthropic tool name, use edits/old_text/new_text params
@hannesrudolph hannesrudolph force-pushed the refactor/edit-file-provider-variants branch from 6a7cccd to 7432fa3 Compare December 23, 2025 23:26
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 24, 2025
…Variant

- Change EditFileGeminiTool to use 'edit_file_gemini' as tool name for proper
  analytics tracking instead of generic 'edit_file'
- Fix EditFileAnthropicTool handleError to use 'edit_file_anthropic' instead
  of 'search and replace'
- Remove duplicate recordToolUsage call from EditFileAnthropicTool (already
  recorded by presentAssistantMessage)
- Standardize editToolVariant to 'gemini' for Minimax, xAI/Grok, and ZAI models
- Add missing editToolVariant to ZAI model configs
- Update tests to use correct tool variant names
hannesrudolph and others added 2 commits December 23, 2025 18:26
- Remove expectation for recordToolUsage call (metrics are recorded by presentAssistantMessage)
- Fix handleError assertion to use 'edit_file_anthropic' instead of 'search and replace'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

3 participants