fix: comply with MCP IDE companion spec for diff tools#3
Open
erikson84 wants to merge 4 commits into
Open
Conversation
Author
|
Fix diff handling to match MCP spec + preserve user edits What changed:
Why: The agent was getting confused because:
Result: Diff accepting now works better - agent waits for proper notifications and user edits are preserved! BTW, thank you very much for your plugin! It's the best I found so far for integrating Gemini CLI with Neovim, with a little help from sidekick.nvim. |
- openDiff: Return empty content on success instead of text message - closeDiff: Return file content (from scratch buffer) in TextContent - accept_diff: Use scratch buffer content to preserve user edits These changes ensure proper async notification flow and prevent the agent from receiving stale file state when re-proposing changes.
added 3 commits
May 18, 2026 09:29
- Implement stateful LRU (Least Recently Used) manager in Lua - Use millisecond timestamps for accurate file ordering - Truncate selected text to 16KB to prevent RPC overhead - Add robust handling for file renames and deletions - Document TERM_PROGRAM workaround for CLI detection
- add filereadable check before loading buffers in ensure_buffer - refine trailing newline handling in accept_diff and close_diff - simplify accept_diff by delegating buffer updates to RPC - refactor BufFilePost autocmd callback for brevity
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.
These changes ensure proper async notification flow and prevent the agent from receiving stale file state when re-proposing changes.