Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Disables the file_edit_replace_lines tool by removing it from the available tools list.

Why

This tool frequently causes models (particularly GPT-5-Codex) to leave the repository in a broken state. Models struggle with line-based edits when:

  • Files are modified concurrently
  • Line numbers are miscalculated
  • They don't account for previous edits in the same session

Changes

  • Commented out tool creation in getToolsForModel() baseTools
  • Commented out tool name in getAvailableTools() list
  • Commented out import (no longer used)

Backwards Compatibility

Tool definition and implementation remain intact so old history messages continue to render correctly. The tool simply won't be available for new messages.

Alternatives

Models should use:

  • file_edit_replace_string - More reliable, based on exact text matching
  • file_edit_insert - Simpler for adding new content

Generated with cmux

This tool frequently causes models (particularly GPT-5-Codex) to leave
the repository in a broken state. Models struggle with line-based edits
when files are modified concurrently or when they miscalculate line numbers.

Changes:
- Commented out tool creation in getToolsForModel() baseTools
- Commented out tool name in getAvailableTools() list
- Commented out import (no longer used)

Tool definition and implementation remain intact for backwards compatibility
with old history messages. Models should use file_edit_replace_string or
file_edit_insert instead.
@ammario ammario added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit 720ec9d Oct 13, 2025
7 checks passed
@ammario ammario deleted the disable-replace-lines-tool branch October 13, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants