Skip to content

feat(tools): add edit_file tool#6

Merged
remarkablemark merged 1 commit into
masterfrom
feat/edit_file
May 5, 2026
Merged

feat(tools): add edit_file tool#6
remarkablemark merged 1 commit into
masterfrom
feat/edit_file

Conversation

@remarkablemark
Copy link
Copy Markdown
Member

What is the motivation for this pull request?

Add the missing edit_file tool that is already referenced in the prompt and backlog so the agent can make precise file edits without falling back to full-file writes.

What is the current behavior?

The prompt advertises an edit_file tool, but the tool registry and executor do not expose one.

What is the new behavior?

The CLI now exposes an edit_file tool that replaces a single exact text match in an existing file, requires approval before execution, and is covered by unit tests for success and failure paths.

Checklist:

Implemented `edit_file` as a first-class tool with an exact single-match
replacement contract.

The registry now exposes it, the executor handles `path` + `oldText` +
`newText`, it requires approval like `write_file`, and the prompt text
now matches the actual behavior in:
- `src/utils/tools.ts`
- `src/constants/tool.ts`
- `src/constants/prompt.ts`
@remarkablemark remarkablemark self-assigned this May 5, 2026
@remarkablemark remarkablemark added the enhancement New feature or request label May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/constants/prompt.ts 100.00% <ø> (ø)
src/constants/tool.ts 100.00% <ø> (ø)
src/utils/tools.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@remarkablemark remarkablemark changed the title feat(tools): add edit_file tool feat(tools): add edit_file tool May 5, 2026
@remarkablemark remarkablemark enabled auto-merge May 5, 2026 05:32
Comment thread src/utils/tools.ts Dismissed
@remarkablemark remarkablemark merged commit 3b95916 into master May 5, 2026
15 checks passed
@remarkablemark remarkablemark deleted the feat/edit_file branch May 5, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants