Add image support to ACP agent message handling#196
Open
Glavin001 wants to merge 2 commits intorivet-dev:mainfrom
Open
Add image support to ACP agent message handling#196Glavin001 wants to merge 2 commits intorivet-dev:mainfrom
Glavin001 wants to merge 2 commits intorivet-dev:mainfrom
Conversation
Enable sending images to Claude Code via the Sandbox Agent. The claude-code-acp adapter already supports images in ACP prompt content blocks, but the Sandbox Agent was not advertising the capability and the OpenCode compatibility layer was silently dropping image content from session update notifications. Changes: - Set `images: true` in Claude agent capabilities (support.rs) - Handle ACP image content blocks in translate_session_update, converting them to OpenCode-compatible file parts with data-URI or external URLs - Update coverage matrix docs to show Claude images as supported (✓) https://claude.ai/code/session_01Bjpf7tV6JPiVun7isaModz
…matrix Audit of claude-code-acp adapter revealed two matrix inaccuracies: - Error Events: was `-` (native but not converted), should be `✓`. JSON-RPC errors from Claude Code (RequestError.internalError, auth errors) are already translated to `session.error` SSE events by the opencode-adapter (line 3829-3840). - File Attachments: was `-` (native but not converted), should be blank. Claude Code does not support file attachments natively at all -- claude-code-acp explicitly ignores blob resources with "Ignore blob resources (unsupported)" comment. Also set error_events: true in support.rs AgentCapabilities for Claude. https://claude.ai/code/session_01Bjpf7tV6JPiVun7isaModz
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.
Summary
This PR adds support for handling image content in ACP (Agent Communication Protocol) agent messages. Previously, the opencode adapter only handled text and thought chunks; now it properly processes image chunks by converting them to file parts with appropriate MIME types and URLs.
Key Changes
imagecontent type in agent message chunks, extracting base64 data, MIME type, and optional URImime_extension()helper function to map MIME types to file extensions (png, jpg, gif, webp, svg)Implementation Details
agent_message_chunk/agent_thought_chunkhandlerhttps://claude.ai/code/session_01Bjpf7tV6JPiVun7isaModz