Skip to content

[codex] add code mode io.write helper#22287

Draft
lt-oai wants to merge 1 commit into
codex/file-broker-p0-2-broker-corefrom
codex/file-broker-p0-3-io-write
Draft

[codex] add code mode io.write helper#22287
lt-oai wants to merge 1 commit into
codex/file-broker-p0-2-broker-corefrom
codex/file-broker-p0-3-io-write

Conversation

@lt-oai
Copy link
Copy Markdown
Contributor

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

What

  • Adds a Code Mode io.write(value, "env://current/<relative-path>") helper.
  • Routes writes through the Code Mode host so V8 stays filesystem-free.
  • Supports text, byte arrays, MCP text blocks, and base64 blob/resource blocks.

Why

  • Provides the harness-level write primitive needed for file handling workflows.
  • Lets connector/tool outputs be materialized into the current environment without making each connector own filesystem writes.

How

  • Adds an IoWrite runtime event and turn message.
  • Implements core-side destination resolution, cwd escape checks, parent directory creation, and file writes.
  • Documents the helper in the Code Mode tool description.

Validation

  • cargo test -p codex-code-mode --lib -- --nocapture
  • cargo test -p codex-core --test all code_mode_io_write_writes_text_to_current_env -- --nocapture

Expose a host-mediated io.write primitive in Code Mode that writes serializable text or bytes to env://current paths via the core harness.

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