mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
## Why Code Mode needs a way to forward mixed MCP tool results while preserving their content types and order. ## What changed Add `content(block)` and `content(iterable)` so callers can forward tool output with `content(result.content)`. Text, image, and audio blocks become their corresponding output items; resource links and embedded resources are serialized as text. Invalid blocks and encrypted text are rejected, and iterators are closed when a block is rejected. Share MCP block conversion and image detail types with the protocol layer, while preserving existing `image()` and `audio()` input handling. ## Testing Add coverage for mixed content ordering, iterator behavior and cleanup, invalid blocks, image metadata, short audio clips, and output suppression after exit. Add an integration scenario verifying that MCP text and image blocks reach the model in order. GitOrigin-RevId: 83832ec6c530dd35ea1e3373680627997c6e13c1