Skip to content

fix(google): use stable Gemini image model#93388

Open
vortexopenclaw wants to merge 1 commit into
openclaw:mainfrom
vortexopenclaw:fix/google-stable-image-model
Open

fix(google): use stable Gemini image model#93388
vortexopenclaw wants to merge 1 commit into
openclaw:mainfrom
vortexopenclaw:fix/google-stable-image-model

Conversation

@vortexopenclaw

@vortexopenclaw vortexopenclaw commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Google's preview Gemini image IDs and legacy Imagen 4 IDs are being retired, but OpenClaw still advertised preview/retired IDs across the Google/OpenRouter image-generation defaults and compatibility migration paths. This keeps stable Flash as the default while preserving explicit Pro selections by mapping Pro preview configs and provider catalogs to the stable Pro image IDs.

Summary

  • switch Google and OpenRouter image-generation provider defaults to gemini-3.1-flash-image
  • preserve stable Pro image models in Google/OpenRouter provider catalogs and lightweight metadata
  • migrate Flash preview/Imagen refs to stable Flash, while migrating Pro preview refs to stable Pro
  • update image-generation docs, provider/tool tests, and doctor migration coverage

Real behavior proof

  • Behavior addressed: OpenClaw's real image provider/model selection surface should no longer advertise retired Google Gemini preview image IDs or legacy Imagen 4 IDs as defaults, and should not silently collapse explicit Pro image selections to Flash.
  • Real environment tested: Local OpenClaw source checkout on macOS at PR commit c4ba453f55, using the real source runner and local OpenClaw setup.
  • Exact steps or command run after this patch: CI=true node scripts/run-node.mjs infer image providers --json
  • Evidence after fix: Copied live output from the real provider listing command showed Google and OpenRouter now expose stable Flash defaults plus stable Pro catalog entries:
{
  "id": "google",
  "label": "Google",
  "defaultModel": "gemini-3.1-flash-image",
  "models": [
    "gemini-3.1-flash-image",
    "gemini-3-pro-image"
  ]
}
{
  "id": "openrouter",
  "label": "OpenRouter",
  "defaultModel": "google/gemini-3.1-flash-image",
  "models": [
    "google/gemini-3.1-flash-image",
    "google/gemini-3-pro-image",
    "openai/gpt-5.4-image-2"
  ]
}
  • Observed result after fix: The runtime provider list reports stable Flash defaults while preserving distinct stable Pro image model entries for Google and OpenRouter. The retired gemini-3.1-flash-image-preview, gemini-3-pro-image-preview, and Imagen 4 IDs are not advertised in the runtime provider list.
  • What was not tested: I did not submit a paid live image generation request to Google/OpenRouter from this PR branch. The provider request paths are covered by the targeted runtime/provider/tool tests listed below.
  • Proof limitations or environment constraints: The first node scripts/run-node.mjs infer image providers --json attempt failed before execution because stale dist triggered a noninteractive pnpm install prompt. Rerunning with CI=true allowed the source runner to rebuild and complete the real provider-list command.
  • Before evidence: Before this PR, Google/OpenRouter image defaults were preview IDs. In the first PR revision, Flash defaults were stable but explicit Pro preview refs were incorrectly migrated to Flash and Pro catalog entries were removed. This revision preserves Pro as stable Pro.

Verification

  • node scripts/run-vitest.mjs src/commands/doctor/shared/legacy-config-migrate.test.ts extensions/google/image-generation-provider.test.ts extensions/openrouter/image-generation-provider.test.ts src/image-generation/runtime.test.ts --reporter=verbose
  • node scripts/run-vitest.mjs src/agents/tools/image-generate-tool.test.ts src/media-generation/runtime-shared.test.ts src/config/plugin-auto-enable.core.test.ts src/plugins/channel-plugin-ids.test.ts --reporter=verbose
  • node_modules/.bin/oxfmt --check docs/cli/infer.md docs/gateway/config-agents.md docs/help/testing-live.md docs/providers/google.md docs/providers/openrouter.md docs/tools/image-generation.md extensions/google/image-generation-provider.ts extensions/google/image-generation-provider.test.ts extensions/google/index.ts extensions/openrouter/image-generation-provider.ts extensions/openrouter/image-generation-provider.test.ts src/commands/doctor/shared/legacy-config-migrations.runtime.models.ts src/commands/doctor/shared/legacy-config-migrate.test.ts src/agents/tools/image-generate-tool.test.ts
  • git diff --check
  • CI=true node scripts/run-node.mjs infer image providers --json

@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 9, 2026, 2:59 PM ET / 18:59 UTC.

Summary
The PR changes Google and OpenRouter image-generation defaults, catalogs, docs, tests, and doctor migrations from preview or Imagen IDs to stable Gemini image model IDs.

PR surface: Source +22, Tests +38, Docs +1. Total +61 across 26 files.

Reproducibility: yes. for source-level review. PR head maps the legacy nano-banana-pro migration to Flash and sends all OpenRouter image requests, including newly advertised stable Gemini IDs, to /chat/completions.

Review metrics: 1 noteworthy metric.

  • Provider default and migration surfaces: 2 provider defaults changed; 1 retired-model migration family added; 1 legacy skill migration changed. These changes affect both fresh provider selection and doctor upgrade behavior for existing image-generation configs.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-legacy-config.migrations.test.ts, migration/backfill/repair: src/commands/doctor/shared/legacy-config-migrations.runtime.models.ts, unknown-data-model-change: src/commands/doctor/shared/legacy-config-migrate.test.ts, unknown-data-model-change: src/commands/doctor/shared/legacy-config-migrations.runtime.models.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Map skills.entries.nano-banana-pro to stable Pro and update the matching legacy migration test.
  • [P2] Fix or remove the OpenRouter stable-ID default/catalog changes so current OpenRouter Gemini models do not use the chat-completions path.
  • [P2] After repair, rerun the focused doctor/provider/tool checks and include redacted request-path proof for any OpenRouter Images API routing.

Risk before merge

  • [P1] Existing legacy skills.entries.nano-banana-pro configs would be migrated from Pro intent to stable Flash, silently changing the selected image tier during upgrade.
  • [P1] OpenRouter users could see the newly advertised stable OpenRouter Gemini default fail at runtime or parse the wrong response because the provider still sends it to /chat/completions instead of /images.
  • [P1] The OpenRouter portion partially overlaps [codex] Add current OpenRouter image models #97505, so whichever branch lands second needs a focused rebase and review.

Maintainer options:

  1. Repair Migration And OpenRouter Routing (recommended)
    Before merge, preserve nano-banana-pro as stable Pro and make stable OpenRouter Gemini IDs use the Images API route and response shape.
  2. Narrow OpenRouter Out
    Keep this PR focused on Google stable IDs and doctor migration, leaving OpenRouter current-model routing to [codex] Add current OpenRouter image models #97505.
  3. Accept Compatibility Risk
    Maintainers could intentionally accept the Pro-to-Flash migration and OpenRouter chat-route behavior, but that would be a user-visible provider compatibility decision.

Next step before merge

  • [P2] The remaining blockers are concrete source repairs: preserve legacy Pro migration intent and align or remove the OpenRouter stable-ID routing change before merge.

Security
Cleared: No concrete security or supply-chain regression was found; the diff does not add dependencies, workflows, lockfiles, package metadata, or broader secret access.

Review findings

  • [P1] Preserve nano-banana Pro during migration — src/commands/doctor/shared/legacy-config-core-normalizers.ts:882
  • [P1] Route stable OpenRouter image IDs through Images API — extensions/openrouter/image-generation-provider.ts:30
Review details

Best possible solution:

Keep the stable Google Flash default and stable Pro catalog entries, preserve legacy Pro selections as stable Pro, and either route stable OpenRouter Gemini IDs through /images or deliberately leave that OpenRouter surface to the dedicated OpenRouter PR before merge.

Do we have a high-confidence way to reproduce the issue?

Yes for source-level review. PR head maps the legacy nano-banana-pro migration to Flash and sends all OpenRouter image requests, including newly advertised stable Gemini IDs, to /chat/completions.

Is this the best way to solve the issue?

No as currently implemented. The provider default and doctor migration layers are appropriate, but the patch must preserve Pro intent and align OpenRouter stable IDs with the Images API route or defer that surface.

Full review comments:

  • [P1] Preserve nano-banana Pro during migration — src/commands/doctor/shared/legacy-config-core-normalizers.ts:882
    This legacy skill path still maps the Pro-named nano-banana-pro config to stable Flash. Current main preserves Pro intent with google/gemini-3-pro-image-preview, and the PR's generic retired-model mapper would upgrade that to google/gemini-3-pro-image; leaving this line as Flash silently downgrades existing configs during doctor migration.
    Confidence: 0.97
  • [P1] Route stable OpenRouter image IDs through Images API — extensions/openrouter/image-generation-provider.ts:30
    This remains from the previous re-review finding: the provider advertises stable OpenRouter Gemini IDs but still posts every image request to /chat/completions. OpenRouter's current image docs and live catalog put these IDs on the dedicated Images API response shape, so the new OpenRouter default can fail at runtime or parse the wrong payload.
    Confidence: 0.9
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8656c3b357f6.

Label changes

Label justifications:

  • P1: The PR targets real provider model retirement, but the current patch can still break existing upgrade and OpenRouter image-generation workflows.
  • merge-risk: 🚨 compatibility: The diff changes shipped defaults and doctor migrations that existing configs may consume during upgrade.
  • merge-risk: 🚨 auth-provider: The diff changes Google/OpenRouter credential-backed image model choices and OpenRouter request routing behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body and post-rebase comment include copied live output from the provider-listing CLI showing the changed default/catalog surface; the remaining blockers are source correctness issues, not absent proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and post-rebase comment include copied live output from the provider-listing CLI showing the changed default/catalog surface; the remaining blockers are source correctness issues, not absent proof.
Evidence reviewed

PR surface:

Source +22, Tests +38, Docs +1. Total +61 across 26 files.

View PR surface stats
Area Files Added Removed Net
Source 6 41 19 +22
Tests 14 139 101 +38
Docs 6 39 38 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 26 219 158 +61

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/commands/doctor/shared/legacy-config-migrate.test.ts src/commands/doctor-legacy-config.migrations.test.ts extensions/google/image-generation-provider.test.ts extensions/openrouter/image-generation-provider.test.ts src/image-generation/runtime.test.ts --reporter=verbose.
  • [P1] node scripts/run-vitest.mjs src/agents/tools/image-generate-tool.test.ts src/media-generation/runtime-shared.test.ts src/config/plugin-auto-enable.core.test.ts src/plugins/channel-plugin-ids.test.ts --reporter=verbose.
  • [P1] node_modules/.bin/oxfmt --check <touched docs/extensions/src files>.
  • [P1] git diff --check.
  • [P1] CI=true node scripts/run-node.mjs infer image providers --json.

What I checked:

Likely related people:

  • steipete: Current blame points the central Google/OpenRouter provider and doctor normalizer lines in this shallow checkout to a recent main commit, and GitHub history shows substantial adjacent image-generation runtime, docs, and provider-capability work. (role: recent area contributor and committer; confidence: high; commits: aaf5af2fbc87, d503ec52d895, 0135a0a7803f; files: extensions/google/image-generation-provider.ts, extensions/openrouter/image-generation-provider.ts, src/commands/doctor/shared/legacy-config-core-normalizers.ts)
  • notamicrodose: Authored the merged OpenRouter image-generation provider PR that introduced the provider surface and original static shortcut list this PR changes. (role: feature introducer; confidence: high; commits: 0f026addaab2; files: extensions/openrouter/image-generation-provider.ts, extensions/openrouter/image-generation-provider.test.ts, docs/providers/openrouter.md)
  • mahopan: Authored the prior repair for the legacy nano-banana-pro doctor migration path, including required Google provider fields during migration. (role: adjacent migration repair contributor; confidence: medium; commits: 2f238b5d7d41; files: src/commands/doctor-legacy-config.migrations.test.ts, src/commands/doctor-legacy-config.ts)
  • davenicoll: Recent image-generation history changed provider-specific edit routing and model-specific limits, adjacent to the OpenRouter endpoint-routing issue here. (role: recent adjacent provider routing contributor; confidence: medium; commits: 6e79ca3cbc7d; files: src/image-generation/runtime.ts, src/agents/tools/image-generate-tool.ts)
  • vincentkoc: Recent current-main history touches explicit image model defaults and defaultless image model refs, adjacent to the fallback/default behavior changed by this PR. (role: recent adjacent defaults contributor; confidence: medium; commits: 7128fa8832d7, 5e4a160f548a; files: src/agents/tools/image-generate-tool.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-06-22T19:22:54.561Z sha c4ba453 :: needs changes before merge. :: [P1] Preserve nano-banana Pro during migration
  • reviewed 2026-07-01T03:50:43.464Z sha c4ba453 :: needs changes before merge. :: [P1] Preserve nano-banana Pro during migration
  • reviewed 2026-07-09T18:52:20.195Z sha bb5b7bd :: found issues before merge. :: [P1] Preserve nano-banana Pro during migration | [P1] Route stable OpenRouter image IDs through Images API

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: google extensions: openrouter size: M triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jun 15, 2026
@vortexopenclaw

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated at c4ba453f55 to address the review findings:

  • Flash preview and Imagen 4 refs still migrate to stable gemini-3.1-flash-image.
  • Pro preview refs now migrate to stable gemini-3-pro-image / openrouter/google/gemini-3-pro-image instead of being collapsed to Flash.
  • Google and OpenRouter provider catalogs/docs/tests now keep distinct stable Pro image entries.
  • PR body proof was refreshed with real infer image providers --json output showing stable Flash defaults plus stable Pro model entries.

@clawsweeper

clawsweeper Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Google's preview Gemini image IDs and legacy Imagen 4 IDs are being
retired, but OpenClaw still advertised preview/retired IDs across the
Google/OpenRouter image-generation defaults and compatibility
migration paths. This keeps stable Flash as the default while
preserving explicit Pro selections by mapping Pro preview configs and
provider catalogs to the stable Pro image IDs.

- switch Google and OpenRouter image-generation provider defaults to
  gemini-3.1-flash-image
- preserve stable Pro image models in Google/OpenRouter provider
  catalogs and lightweight metadata
- migrate Flash preview/Imagen refs to stable Flash, while migrating
  Pro preview refs to stable Pro
- update image-generation docs, provider/tool tests, and doctor
  migration coverage

Rebased onto latest main to resolve merge conflicts.
@vortexopenclaw
vortexopenclaw force-pushed the fix/google-stable-image-model branch from c4ba453 to bb5b7bd Compare July 9, 2026 18:46
@vortexopenclaw

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (8656c3b357) to resolve the merge conflicts; branch is mergeable again.

Real behavior proof (post-rebase)

  • Commands run at bb5b7bd4a6 on this branch, local source checkout on macOS.
node scripts/run-vitest.mjs src/commands/doctor/shared/legacy-config-migrate.test.ts extensions/google/image-generation-provider.test.ts extensions/openrouter/image-generation-provider.test.ts src/image-generation/runtime.test.ts --reporter=verbose
# Test Files  2 passed (2) / Tests 139 passed (139)   [migrate + runtime]
# Test Files  2 passed (2) / Tests  26 passed (26)    [google + openrouter providers]

node scripts/run-vitest.mjs src/agents/tools/image-generate-tool.test.ts src/media-generation/runtime-shared.test.ts src/config/plugin-auto-enable.core.test.ts src/plugins/channel-plugin-ids.test.ts --reporter=verbose
# Test Files 1 passed (1) / Tests 156 passed (156)

node_modules/.bin/oxfmt --check <changed docs/extensions/src files>
# all matched files use the correct format (after running oxfmt once, non-check, on docs/tools/image-generation.md to re-align a table)

git diff --check
git diff --cached --check
# no output (clean)

CI=true node scripts/run-node.mjs infer image providers --json

Output confirms Google/OpenRouter still expose stable Flash defaults plus the stable Pro entry, no retired preview/Imagen IDs:

google gemini-3.1-flash-image ['gemini-3.1-flash-image', 'gemini-3-pro-image']
openrouter google/gemini-3.1-flash-image ['google/gemini-3.1-flash-image', 'google/gemini-3-pro-image', 'openai/gpt-5.4-image-2']

No functional changes from the prior revision - this is purely a rebase to resolve the reported merge conflict, reapplying the same model-id fixes onto current main.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(google): use stable Gemini image model 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: google extensions: openrouter gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant