Skip to content

[WIP] Implement edit tool for surgical file edits#128

Merged
rookdaemon merged 1 commit intomainfrom
copilot/implement-edit-tool-surgical-files
Feb 7, 2026
Merged

[WIP] Implement edit tool for surgical file edits#128
rookdaemon merged 1 commit intomainfrom
copilot/implement-edit-tool-surgical-files

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement edit tool for surgical file edits</issue_title>
<issue_description>Priority: P1 (required for Rook autonomy)

Spec:

  • Accept parameters: {path, old_string, new_string, replace_all?}
  • Read file → find old_string → replace with new_string → write back
  • Validate uniqueness of old_string to prevent ambiguous edits (unless replace_all=true)
  • Error if old_string not found or multiple matches without replace_all
  • Reference implementation: OpenClaw's edit tool

Files:

  • Create src/tools/edit.ts
  • Register in tool registry
  • Add JSON Schema definition

Tests:

  • Unit tests for unique/multiple match cases
  • Integration test with agent loop

Acceptance:

  • Tool executes via agent loop
  • Handles edge cases (file not found, ambiguous match)
  • Rook can perform surgical edits without overwriting entire files

Ref: gap-analysis-report.md P1-1</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@rookdaemon rookdaemon marked this pull request as ready for review February 7, 2026 23:02
@rookdaemon rookdaemon merged commit f116e9e into main Feb 7, 2026
0 of 3 checks passed
Copilot stopped work on behalf of rookdaemon due to an error February 7, 2026 23:02
Copilot AI requested a review from rookdaemon February 7, 2026 23:02
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.

Implement edit tool for surgical file edits

2 participants