Uh oh!
There was an error while loading. Please reload this page.
ADFA-2621 | Add file-edit tool for local LLM models - #58
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
commented
Aug 3, 2026
@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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
381d0e3 to
1a12f78CompareResolves conflicts in ai-assistant/build.gradle.kts and ai-core/build.gradle.kts. Both were the same adjacent-line collision: this branch: targetSdk 34 -> 36 (the point of ADFA-4907) main: versionCode 1 -> 2, versionName 1.0.0 -> 1.1.0 (#49, #50, #58) Neither side touched the other's lines, so both changes are kept: targetSdk = 36, versionCode = 2, versionName = "1.1.0". Verified the merged build files differ from origin/main only in compileSdk and targetSdk (34 -> 36), so all of main's work on these two plugins is preserved.
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.