Repository navigation
fix: resolve image capabilities consistently for Codex catalogs and launchers (#252) - #261
Conversation
…aunchers The HTTP Codex catalog advertised image input only when the upstream /v1/models entry carried capabilities: ["image"], and the launcher hardcoded ["text"] into every isolated model_catalog.json. Codex strips image content client-side when its local catalog says a model accepts text only, so image input was blocked even against a vision-capable upstream. Resolve input modalities in one place - an explicit local override, then recognized upstream metadata, then a conservative text-only fallback - and serve the same resolved value from the HTTP catalog and from the isolated catalogs both launcher modes write. Capabilities are never inferred from a model name. - Add typed per-model overrides: [models."<served-model-id>"] input_modalities, validated at startup so unknown names, empty lists, duplicates, and image-only lists are rejected with the offending file and line. - Model the Codex catalog and the upstream model listing as typed Rust structs instead of untyped JSON, and report an undecodable upstream payload as 502 rather than serving it as an empty catalog. - Resolve the Codex model and its modalities from a single gateway catalog snapshot before writing an isolated home, retrying a warming gateway and failing with an actionable error when the catalog cannot be fetched or omits the selected model. prepare_codex_home now requires the resolved modalities and is no longer public. A gateway behind OIDC now requires --api-key for `agentic harness codex`, since /v1/models is a protected route, and existing persistent Codex session homes must be regenerated to pick up the resolved metadata. Closes vllm-project#252 Claude-Session: https://claude.ai/code/session_018UDt2mDv5avtph2oiHUHpn Signed-off-by: Zheng Lu <[email protected]>
|
AI-assisted validation report from LOGO127 for exact head I built your unmodified branch and ran the real pinned
These are transport checks with synthetic responses, not captured cassettes or evidence of model image understanding. Local environment: Linux, Python 3.12, Pillow 11.3.0, Node 22.22.2 (the project's CI uses Node 24). This does not independently certify your entire test suite. I have paused my parallel #252 candidate and will not open a competing implementation. I am preparing complementary coverage for #253; the explicit HTTP/WebSocket, namespace/custom-tool, continuation/compaction matrix and the pinned live vision-model/vLLM check remain unfinished. If you are already working on that follow-up, please let me know so we can coordinate instead of duplicating it. |
|
AI-assisted follow-up from LOGO127: I found a separate existing-CI compatibility issue while aligning the local runtime with Node 24. With Node 24.20.0, Python 3.12, PyYAML 6.0.3, and the pinned codex-cli 0.149.1:
The new launcher discovers the gateway catalog, but I tested a small isolated fixture-only fix: add an optional This seems worth folding into #261 so the existing Codex E2E remains runnable. I have the three-file patch locally if useful, and have not opened a competing implementation. Separately, all three previously reported synthetic image CLI cases also pass under Node 24; these still do not establish live vision-model understanding. |
|
Hi @LOGO127, Thank you for the thorough validation report and for taking the time to test exact head Here is the update on both points: 1. Replay Server
|
|
Thanks @Zheng-Lu -- the requested three-file replay catalog fix is now available as a signed commit:
It is one commit on main The catalog is deliberately text-only for the existing smoke: optional Fresh checks on the exact committed tree: all 14 replay tests pass on Windows Python 3.12/PyYAML 6.0.3 and Python 3.13.6; all applicable three-file hooks pass. The Node 24 / pinned Codex CLI red-to-green smoke reported above remains historical Linux evidence; I have not rerun that Linux smoke or a full Rust/live-model suite today. AI assistance: Codex assisted with investigation, implementation and verification. The commit contains LOGO127's contributor sign-off. Please preserve the original author/sign-off when folding it in; I can follow up on integration feedback. |
franciscojavierarceo
left a comment
There was a problem hiding this comment.
checked the capability precedence, catalog parsing, and both launcher paths; no new findings from the source review. we should fold in the replay-server /v1/models fix already shared by LOGO127 and rerun scripts/codex-smoke.sh before merging, since the current launcher now requires that discovery request. i haven't rerun the pinned Codex smoke locally.
|
Hi @Zheng-Lu, a small validation follow-up to close the loop on the replay catalog patch: I have now tested your current The three-file patch applies cleanly. On WSL Linux, the 14 replay-server tests pass, and Reproduction after applying the patch: run No additional patch or competing PR is needed from me for this slice. The original signed commit is ready to fold in whenever it fits your integration. Happy to address any integration failure; thank you for coordinating this work. Validation was performed with Codex assistance. |
Signed-off-by: luozijian <[email protected]>
|
Thanks @franciscojavierarceo and @LOGO127! I have folded in @LOGO127's signed commit (
The PR is updated and ready for merge! |
|
Thanks for incorporating the patch and preserving the authorship and sign-off, @Zheng-Lu! I verified that the replay-server changes are present in |
…age-capabilities Signed-off-by: Zheng Lu <[email protected]> # Conflicts: # CHANGELOG.md # crates/agentic-server/src/lib.rs # crates/agentic-server/src/server.rs
Refreshed now |
|
Before enabling image modality in the client harnesses, we need to validate image input through the gateway with a vision-capable model. The catalog and launcher tests verify capability propagation, but the smoke test remains text-only. Please add real-image cassette recordings against OpenAI and the gateway, with replay tests covering:
We should compare API behavior and structure, rather than identical model-generated text. Once this coverage passes, we can enable image modality in the harnesses. This requirement concerns image input/vision; image generation is a separate capability. |
Thanks for review @maralbahari! I agree with the two-step merge strategy. To keep responsibilities separated, I have already opened the dedicated verification PR as a draft: #263 ( The reason #263 was stacked on #261 is because the Codex CLI strips image attachments client-side if its local catalog declares text-only, so the end-to-end However, as you pointed out, the gateway-level validation does not depend on the client harness. I will decouple #263 so it targets Does it sound good to you? |
sure. #263 is testing codex client, if you want to land #263 first it should fix and verify compatibility of openai image generation in Responses API based on https://developers.openai.com/api/docs/guides/image-generation and https://developers.openai.com/api/reference/resources/responses/methods/create first with cassettes recording. Then in #261 PR verify client. eventually if the compatibility with openai is preserved correctly for client changes would just simply be allowing the input modality in codex catalogs and launcher. |
|
@maralbahari Thanks for reply. I have un-stacked PR #263 so it is now a pure Gateway/Responses-API PR, completely decoupled from the client CLI changes. It is now ready for your review: #263 Here is what i did in PR #263:
Once you are happy with PR #263 and it merges, I will rebase this PR (#261) to add the client-side enablement and verification. |
|
the replay catalog fix is included, and the capability, launcher, model-handler, and replay tests pass locally. this branch still conflicts with |
Signed-off-by: Francisco Javier Arceo <[email protected]>
franciscojavierarceo
left a comment
There was a problem hiding this comment.
the branch is updated with main, and the pinned Codex 0.149.1 smoke now verifies exact image bytes upstream through both launcher modes, with a text-only negative control. the full server suite, launcher tests, Clippy, and pre-commit pass locally; independent review found no remaining blockers. hosted CI is still running.
Summary
Fixes #252 (parent #251). Codex previously received a text-only isolated model catalog from the launcher even when the gateway advertised image support, causing the client to remove image attachments. Resolve input modalities once and use the gateway catalog for both
agentic harness codexandagentic run codex.Resolution uses an explicit
[models."served-model-id"] input_modalities = ["text", "image"]override, then recognized upstream metadata, then a conservative text-only fallback. Explicit text-only overrides win; model names never imply capabilities. Typed configuration rejects unknown, duplicate, empty, and image-only modality lists.supports_image_detail_originalremains false.Model selection and modalities come from one bounded, authenticated catalog snapshot using the installed Codex client version. Catalog discovery preserves readiness deadlines and fails clearly for incompatible catalogs. Private catalog resolution is separated from process lifecycle management; existing tool settings are preserved.
Merge current main, including the Responses image-preservation changes. Extend the existing CI smoke with actual pinned Codex 0.149.1: attach the committed PNG through both launcher modes and require byte-for-byte equality in the upstream capture. A text-only control must send no image. Replay uses an existing recorded gateway/vLLM response; it verifies client/catalog/transport behavior, not fresh vision inference. No cassette contents were fabricated or modified.
Test Plan
agentic-servertest suite: 439 distinct tests passed, no failures or ignored tests.scripts/codex-smoke.sh: HELLO baseline, attached-image, integrated-image, and text-only control passed using Codex 0.149.1 and rebuilt binaries.scripts/tests/agentic-launchers-test.shpassed.