ADFA-2621 | Add file-edit tool for local LLM models - #58
Open
jatezzz wants to merge 2 commits into
Open
Conversation
Approval-gated find/replace with a before/after diff: a file open in the editor is changed through the buffer (Ctrl+Z-able), a closed one via atomic temp-then-rename. ai-core now turns native model-load failures into actionable user messages instead of a bare null-handle error.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
jatezzz
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa,
hal-eisen-adfa and
itsaky-adfa
August 3, 2026 17:25
Contributor
Author
|
@claude review |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, comment @claude review on this pull request to trigger a review.
Daniel-ADFA
reviewed
Aug 3, 2026
Daniel-ADFA
reviewed
Aug 3, 2026
Daniel-ADFA
reviewed
Aug 3, 2026
Approval-gated find/replace with a before/after diff: a file open in the editor is changed through the buffer (Ctrl+Z-able), a closed one via atomic temp-then-rename. A guessed path is corrected when one candidate has no rival, and rejections name the fix, the split pair when an instruction was pasted into both args, replace_all when a bare name matched many times, so a local model recovers in one turn. Tool-call examples in the system prompts use the file the IDE actually has open, and unexpected failures log through context.logger. ai-core now turns native model-load failures into actionable user messages instead of a bare null-handle error.
jatezzz
force-pushed
the
feat/ADFA-2621-edit-file-tool
branch
from
August 3, 2026 20:36
381d0e3 to
1a12f78
Compare
Daniel-ADFA
approved these changes
Aug 4, 2026
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.
Description
What:
This PR introduces the
edit_filetool to the AI Assistant, allowing models to perform surgical find-and-replace changes on project files instead of attempting to rewrite them entirely.How:
old_stringandnew_stringarguments to locate and replace exact snippets, falling back to line-ending adaptations if needed.edit_file, emphasizing the need to copyold_stringverbatim after reading the file.Why:
Local LLMs generally lack the context window and output budget to reliably overwrite entire files using
update_file. A targeted edit approach makes local, on-device models substantially more viable for iterative coding tasks.Details
EditFileHandler,EditorBufferApplier, andAtomicFileWriterto safely manage the lifecycle of an edit.ToolApprovalManagerto supportCORRECTEDstates and strictly preventedit_filefrom ever being granted blanket "Always Allow" session approval.AgentTracefor detailed lifecycle logging of prompt, tool execution, parsing, and execution.1.1.0.document_5152462601887680330.mp4
Ticket
ADFA-2621
Observation
edit_filevalidations explicitly block writes to.git/, keystores, and build configuration files.