Skip to content

fix: fall back to inline image data for internal URIs#228

Merged
benbrandt merged 2 commits into
agentclientprotocol:mainfrom
kolodziejm:fix/fallback-inline-image-data
Jun 24, 2026
Merged

fix: fall back to inline image data for internal URIs#228
benbrandt merged 2 commits into
agentclientprotocol:mainfrom
kolodziejm:fix/fallback-inline-image-data

Conversation

@kolodziejm

Copy link
Copy Markdown
Contributor

Summary

  • Fall back to inline ACP image data when an image block carries an internal or otherwise non-fetchable URI.
  • Keep existing behavior for http:, https:, and data: image URLs.
  • Add a regression test covering zed:///agent/pasted-image?... input.

Motivation

Some ACP clients attach pasted images with inline data/mimeType plus a client-internal uri. For example, Zed can send a pasted image URI such as zed:///agent/pasted-image?name=Image. The adapter currently forwards that URI to Codex as an image URL, which later becomes an OpenAI image_url value and is rejected because zed:///... is not a valid URL for the API.

Using the inline image payload for non-fetchable URI schemes preserves image input while still allowing real external URLs and already-inline data: URLs to pass through unchanged.

Validation

  • npm test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts
  • npm run typecheck

@benbrandt benbrandt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@benbrandt benbrandt merged commit 37a98b3 into agentclientprotocol:main Jun 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Regression: image_url validation fails for local file URIs (file:// protocol) in v1.0.0

2 participants