Skip to content

fix(ai): pass media through protocol lowering - #42921

Merged
rekram1-node merged 2 commits into
v2from
media-pass-through
Aug 16, 2026
Merged

rekram1-node merged 2 commits into
v2from
media-pass-through

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • replace shared media validation with request-shape normalization
  • remove generic MIME subtype allowlists, byte ceilings, and canonical base64 checks from AI protocol lowering
  • preserve raw byte encoding and data URL extraction required by provider wire formats
  • retain route-local MIME category checks when the protocol cannot represent the input
  • route non-image Open Responses media through input_file and leave provider capability validation to the provider
  • cover large PDF tool-result replay and malformed encoded media pass-through

Verification

  • bun typecheck from packages/ai
  • bun test --timeout 30000 test/provider/gemini.test.ts test/provider/openai-responses.test.ts test/provider/anthropic-messages.test.ts test/provider/bedrock-converse.test.ts (199 passed)
  • bun test --timeout 30000 test/provider/openai-chat.test.ts -t "media|image" (5 passed)
  • git diff --check

Fixes #42914

Requested by: @rekram1-node (Aiden Cline via Slack)

@rekram1-node
rekram1-node merged commit 75a979e into v2 Aug 16, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the media-pass-through branch August 16, 2026 20:18
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant