Reopening #11653, which was closed due to inactivity without a fix.
Description
When OpenCode runs in ACP mode (opencode acp), the session/request_permission call for edit tool operations does not include a content: [{ type: "diff" }] block in the toolCall payload.
The ACP SDK's RequestPermissionRequest accepts toolCall.content?: Array<ToolCallContent>, where a { type: "diff", path, oldText, newText } entry signals to the client that a diff view should be shown before the user approves. Without it, ACP clients that check for this block fall back to a plain approval prompt with no diff.
Observed behavior
When using OpenCode via ACP in CodeCompanion, the permission prompt is shown but no diff view is presented. Other ACP agents (e.g. claude-agent-acp) correctly include the diff content block and trigger the diff UI in the client.
Expected behavior
The permission request for edit operations should include the diff content block, allowing ACP clients to present a diff view alongside the approval prompt.
Relevant files
packages/opencode/src/acp/permission.ts
packages/opencode/src/tool/edit.ts
packages/opencode/src/tool/write.ts
Reopening #11653, which was closed due to inactivity without a fix.
Description
When OpenCode runs in ACP mode (
opencode acp), thesession/request_permissioncall foredittool operations does not include acontent: [{ type: "diff" }]block in thetoolCallpayload.The ACP SDK's
RequestPermissionRequestacceptstoolCall.content?: Array<ToolCallContent>, where a{ type: "diff", path, oldText, newText }entry signals to the client that a diff view should be shown before the user approves. Without it, ACP clients that check for this block fall back to a plain approval prompt with no diff.Observed behavior
When using OpenCode via ACP in CodeCompanion, the permission prompt is shown but no diff view is presented. Other ACP agents (e.g.
claude-agent-acp) correctly include the diff content block and trigger the diff UI in the client.Expected behavior
The permission request for
editoperations should include the diff content block, allowing ACP clients to present a diff view alongside the approval prompt.Relevant files
packages/opencode/src/acp/permission.tspackages/opencode/src/tool/edit.tspackages/opencode/src/tool/write.ts