Skip to content

[codex] add sep2356 file input encoder#22289

Draft
lt-oai wants to merge 1 commit into
codex/file-broker-p0-4-env-file-refsfrom
codex/file-broker-p0-5-sep2356-data-uri
Draft

[codex] add sep2356 file input encoder#22289
lt-oai wants to merge 1 commit into
codex/file-broker-p0-4-env-file-refsfrom
codex/file-broker-p0-5-sep2356-data-uri

Conversation

@lt-oai
Copy link
Copy Markdown
Contributor

@lt-oai lt-oai commented May 12, 2026

What

  • Adds a broker-side SEP-2356 data URI encoder for local paths and env://current file refs.
  • Covers RFC 2397 name= percent encoding, MIME selection, base64 encoding, and cwd escape rejection.

Why

  • Prepares the broker for MCP SEP-2356 file-input compatibility while the upstream Rust MCP type does not yet expose Tool.inputFiles.
  • Keeps the compatibility shape close to the existing file broker so future wiring can reuse the same path resolution checks.

How

  • Encodes files as data:<media-type>;name=<filename>;base64,<data>.
  • Reuses the broker's local/env file-ref resolver.
  • Leaves the encoder intentionally unwired until the MCP SDK exposes the accepted inputFiles descriptor field.

Validation

  • cargo test -p codex-core mcp_openai_file -- --nocapture

Add a broker-side SEP-2356 data URI encoder for local and env://current file refs, with tests for RFC 2397 name encoding and environment escape rejection.

Co-authored-by: Codex <noreply@openai.com>
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.

1 participant