fix(opencode): ACP Attach structured diff content for edit permissions#15517
fix(opencode): ACP Attach structured diff content for edit permissions#15517MaxDillon wants to merge 6 commits intoanomalyco:devfrom
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
https://agentclientprotocol.com/protocol/tool-calls#diffs Here is the diff context in the acp spec. @kommander can you take a look at this? |
|
had the same problem that is described in #11653, tested this pr locally and it seems to solve it. i tested both with my regular configurations for opencode and neovim (with codecompanion) and with this flake's minimal config. |
until at least anomalyco/opencode#15517 is merged and hopefully more of the agent client protocol is implemented (e.g. terminal content)
|
Please merge! |
|
Adding another voice here — this same issue affects agent-shell (Emacs ACP client). The permission request sends |
Issue for this PR
Closes #11653
Type of change
What does this PR do?
This addresses an issue where ACP edit permissions do not include structured diff content, preventing ACP compliant editors to show diff before asking for final edit approval.
Previously, edit permissions only sent metadata (filepath, diff) to requestPermission, and the file was written immediately after approval. No ToolCallContent of type "diff" was attached, so the client could not render a diff preview.
This PR:
This allows ACP clients (e.g. CodeCompanion) to render a proper diff preview.
Non-edit permissions are unchanged.
How did you verify your code works?
Screenshots / recordings
Dev environment configuration
Make change request
Diff visualization in CodeCompanion.nvim
Updated file after change approval
Checklist