Repository navigation
fix(runtime): preserve Pi tool schemas and multimodal input across Pi and Codex - #1243
Merged
Merged
Conversation
warm-wm
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What failed
An ADK tool declared an object with properties and a root-level
oneOf. The Pi extension rebuilt it as a TypeBox union, retaining the alternatives asanyOfand discarding the object type and its other constraints. A model provider rejected the entire tool list before the first tool call. Pi reported the provider error onmessage_end, so the caller saw an incomplete response instead of the HTTP 400.Changes
Register the original JSON Schema with Pi, including sibling constraints, nested references, and additional properties.
Carry inline user images through Pi’s context bridge in the original order, including image-only turns.
Surface the terminal provider error, redact the configured model key, and let announced retries finish before reporting failure. A failed partial response is never promoted to a final answer.
Sample inline animated GIF and MP4/MOV/WebM into ordered PNG frames for both Pi and Codex, including visual-only prompts. Keep static images on their original path and preserve the original file for Codex.
Keep genuine MCP image results typed on the Codex MCP transport and on the Responses shim, including the next tool round. Regular text tools retain the existing representation.
The Codex extra installs PyAV (locked to 16.1.0). Pi-only users who need video install
veadk-python[piagent]. Text, still images and animated GIFs work without this extra. The default SDK and offline Studio release omit the video decoder. The runtime guides in both languages describe sampling up to eight visual frames including the endpoints. Audio transcription is outside the visual sampling path.Verification
Combined skill, environment, MCP, and hook tests
Reinstalled the PR wheel with the downstream Harness pins. Tests used real Pi and Codex binaries, a live model, a Streamable HTTP MCP server, the Studio skill registry and environment tools, and a small Python receipt program in an isolated working directory. The Hook fixture spoke the Studio health, catalog, and invocation HTTP protocol over a local Unix socket. The environment adapter ran locally. No production deployment or public Hook endpoint was involved.
Multimodal regression and package verification
The earlier implementation preserved only the first animated GIF frame, omitted video images and flattened an MCP PNG into text on Codex. A direct provider control returned both visual codes. The following checks used an installed wheel, actual Pi and Codex processes and a live vision provider. Random reference numbers were present in the media and absent from filenames and prompts.
The full Python 3.12 regression run on this revision completed with 9717 passed, 85 skipped, 4 xfailed, 179 warnings, 6 subtests passed. The separately enabled local Codex smoke suite completed with 32 passed and 2 skipped (optional database services).
Packaging and repeated live checks
An intermediate build bundled the 39.3 MiB decoder wheel with the base SDK. Its 299,493,961-byte offline Studio zip failed the existing 256 MiB customer-update limit. The final change places the decoder in the runtime extras. Frozen base dependencies are otherwise identical. Install tests from the clean wheel confirmed that base imports without PyAV and each runtime extra installs the decoder. The final bundle is 258,550,566 bytes (246.6 MiB). The unchanged 256 MiB limit and simulated customer upgrade/startup passed. Release verification
Both runtimes again returned both visual codes in order for GIF, MP4, MOV and WebM on the clean wheel. One additional mixed PNG + extracted PDF repeat returned only the image code; the original mixed prompt gave variable results across runs. A request capture for each engine confirmed the exact PNG plus the PDF code in the text, and both returned both values when asked specifically to read the attached PDF text. This is a limitation of recognition on that prompt.