[codex] Add current OpenRouter image models#97505
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 7:01 AM ET / 11:01 UTC. Summary PR surface: Source +390, Tests +363, Docs +32. Total +785 across 11 files. Reproducibility: yes. for the source-level feature gap: current main exposes only three static OpenRouter image model shortcuts, while the official OpenRouter Images model endpoint includes the requested IDs. This is feature validation rather than a broken-behavior repro, and I did not run a paid generation call. Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Rebase onto current main, preserve the current image capability helper path, and land the provider-local curated Do we have a high-confidence way to reproduce the issue? Yes for the source-level feature gap: current main exposes only three static OpenRouter image model shortcuts, while the official OpenRouter Images model endpoint includes the requested IDs. This is feature validation rather than a broken-behavior repro, and I did not run a paid generation call. Is this the best way to solve the issue? Yes, with conditions: a provider-local curated table and AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8f2986290d00. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +390, Tests +363, Docs +32. Total +785 across 11 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Updated in The PR body now uses @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated in This also threads Evidence in the PR body now includes provider/runtime/tool tests, formatter check, docs list, @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated the PR body evidence with the requested runtime proof:
No paid live OpenRouter generation request was made; this proof exercises the compiled provider endpoint/body/response path without billing or exposing credentials. |
|
Addressed the OpenRouter edit-limit review in Changes:
Proof:
No live/paid provider call was used for this update. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Follow-up for the fresh Root cause: the new model-specific list summary used Fix pushed in Evidence:
|
|
@clawsweeper re-review Current head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Current-head review note: I checked this PR at head On the current head, the author-supplied runtime proof is also backed by passing checks, including The remaining maintainer decision looks narrower now: whether the no-paid compiled-provider fixture proof is sufficient for this provider/catalog routing change, since no paid live OpenRouter image generation was run. |
|
@clawsweeper re-review After-fix proof for the OpenRouter image-model update:
Proof gap: this environment does not have |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: [codex] Add current OpenRouter image models This is item 1/1 in the current shard. Shard 1/4. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
What Problem This Solves
Related #91504.
OpenRouter image generation currently exposes only a small static shortcut list, so users asking for broader OpenRouter image model support do not see current image-output models in OpenClaw's provider metadata or generated model catalog. Current OpenRouter image models are also documented under OpenRouter's dedicated Images API, so exposing them through the old chat-completions path would advertise models that can fail at runtime.
Why This Change Was Made
OpenRouter's public
https://openrouter.ai/api/v1/images/modelsresponse currently advertises additional image models beyond the existing OpenClaw list, including:google/gemini-3.1-flash-imagegoogle/gemini-3-pro-imagegoogle/gemini-2.5-flash-imageopenai/gpt-5-imageopenai/gpt-5-image-minimicrosoft/mai-image-2.5This PR adds those current model ids to the curated OpenRouter image-generation provider list, routes them through OpenRouter's dedicated
/imagesendpoint, and parses the Images APIdata[].b64_jsonresponse shape. Existing preview/default chat-image model refs remain accepted on the chat-completions path so already configured users are not migrated unexpectedly.OpenRouter
/imagessupported parameters are model-specific, so this PR also gates the new models before submission:/imagesmodels request one output at a time.aspectRatio/resolutionrequests instead of silently dropping them./imagesmodels can use the shared tool cap of 10 when supported.This intentionally remains a curated-list update, not dynamic catalog discovery; the broader catalog policy can still be considered separately.
User Impact
Users can now discover and configure more current OpenRouter image models for the
image_generatetool without relying on undocumented override strings. The linked issue'smicrosoft/mai-image-2.5example is included. Unsupported model-specific count, geometry, or reference-image requests fail locally with clear errors instead of being sent to OpenRouter and rejected later.Existing OpenRouter image configs continue to work because the previous preview ids remain in the list and the default is unchanged.
Evidence
POST /api/v1/imagesand returns image data throughdata[].b64_json: https://openrouter.ai/docs/guides/overview/multimodal/image-generationhttps://openrouter.ai/api/v1/images/modelsendpoint on 2026-06-28 and confirmed the six added ids are present. Live capability proof showed model-specificn,aspect_ratio,resolution, andinput_referencessupport, including Microsoftn.max=1, Microsoft noresolution, OpenAI noaspect_ratio/resolution, and Gemini/Microsoft/OpenAI different reference limits./Users/AdityaWork/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node scripts/build-all.mjs cliStartup./Users/AdityaWork/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node openclaw.mjs capability image providers --json | jq '.[] | select(.id == "openrouter") | {id, defaultModel, models, generate: .capabilities.generate, edit: .capabilities.edit, geometry: .capabilities.geometry}'showed OpenRouter exposing all six added ids,defaultModel: google/gemini-3.1-flash-image-preview,generate.maxCount: 4,edit.maxInputImages: 10, aspect ratios including1:4,1:8,4:1,8:1, and resolutions1K,2K,4K.provider.generateImage({ model: "google/gemini-3.1-flash-image", count: 1, aspectRatio: "1:4", resolution: "1K" })posted to/api/v1/imageswith authorization redacted, body{ model: "google/gemini-3.1-flash-image", n: 1, aspect_ratio: "1:4", resolution: "1K" }, parsed an Images API-style{ data: [{ b64_json, media_type: "image/png" }] }response, and returned oneimage/pngasset (image-1.png, 68 bytes). This exercises the compiled provider endpoint/body/response path without making a paid live OpenRouter generation request.node scripts/run-vitest.mjs extensions/openrouter/image-generation-provider.test.ts src/image-generation/runtime.test.ts src/agents/tools/image-generate-tool.test.tsnode node_modules/oxfmt/bin/oxfmt --check --threads=1 extensions/openrouter/image-generation-provider.ts extensions/openrouter/image-generation-provider.test.ts docs/providers/openrouter.md docs/tools/image-generation.md src/image-generation/types.ts src/image-generation/runtime-types.ts src/image-generation/runtime.ts src/agents/tools/image-generate-tool.tsgit diff --checkcorepack pnpm docs:list.agents/skills/autoreview/scripts/autoreview --mode local --codex-bin /tmp/codex-fast-wrapper-> clean, no accepted/actionable findings after per-model caps, docs alignment, runtimeresolutionInferredplumbing, and legacy chat-image reference guard.