Repository navigation
feat(gemini): add nano banana 2.1 image gen model - #200468
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesAdds Gemini Nano Banana 2.1 image capabilities, makes it Google's default image model, and excludes it from chat catalogs. Example: Edit with google/gemini-nano-banana-2.1 using 14 reference images and aspect ratio 1:8.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it adds useful model-specific capabilities through existing owners, with no definite introduced runtime defect; switching the Google image default needs an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Google plugin supplies image-model metadata to registration and the shared image runtime, which selects models, validates references and geometry, and sends generation requests through Google's existing HTTP adapter. flowchart LR
A[CLI or image tool] --> B[Shared model selection]
C[Google model metadata] --> B
B --> D[Reference and geometry validation]
C --> D
D --> E[Google image provider]
E --> F[Google API]
F --> G[Generated image]
Technical reviewBest possible solution: Add the model-specific capabilities in the existing Google metadata owner, retaining the Flash default unless the area owner approves its replacement. Do we have a high-confidence way to reproduce the issue? Source establishes the current five-reference limit and missing panoramic metadata; no product execution was performed during this read-only review. Is this the best way to solve the issue? The existing metadata maps are the smallest complete implementation for the new capabilities; replacing the default is a separate product choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8e8203f07607. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +27, Tests +39, Docs 0. Total +66 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 17, 2026, 2:15 AM ET / 07:15 UTC. |
…r-bypass test Co-authored-by: obviyus <[email protected]>
|
Landed in bcb47e8. Thanks @markmcd!
|
…w#200468) ## What Problem This Solves Google's newest image generation and editing model (`gemini-nano-banana-2.1`) was not available in OpenClaw's `google` image-generation provider. Requests for it were capped at 5 reference images, and the panoramic aspect ratios it supports were not passed through: a `1:8` request quietly came back as a 9:16 image. ## User Impact - Google image generation now defaults to `google/gemini-nano-banana-2.1`. - On that model, edits accept up to 14 reference images and the `1:4`, `4:1`, `1:8` and `8:1` aspect ratios. - `gemini-3.1-flash-image` and `gemini-3-pro-image` stay available with their current limits. Explicitly configured image models are unchanged. - Chat model discovery excludes the new model, the same as the other Gemini image models. ## Why This Change Was Made - `DEFAULT_GOOGLE_IMAGE_MODEL` is now `gemini-nano-banana-2.1`, and `gemini-3.1-flash-image` stays in the model list. - The existing `maxInputImagesByModel` (14) and `aspectRatiosByModel` capability fields declare the model's limits, so the shared image runtime validates them without a new code path. - `nano-banana` is a non-text marker, and the manifest suppresses `google/gemini-nano-banana-2.1` from chat catalogs. - The Google provider, image-generation, model-config and `openclaw infer` docs show the new default and limits. ## Evidence Real Gemini API (AI Studio key), run from source on isolated state. Base is the merge base `6542e876556a`; head is this PR. | Scenario | Base | Head | |---|---|---| | `infer image generate`, no `--model` | `gemini-3.1-flash-image`, 1408×768 | `gemini-nano-banana-2.1`, 1376×768 | | `infer image edit` on Nano Banana 2.1, 14 reference images, `--aspect-ratio 1:8` | rejected: "supports at most 5 reference images, 14 requested" | 352×2928; all 14 reference colors appear in order | | `infer image generate` on Nano Banana 2.1, `--aspect-ratio 1:8` | 768×1376 (9:16), no warning | 352×2928 (1:8) | | `infer image edit` on `gemini-3.1-flash-image`, 14 references | rejected (max 5) | still rejected (max 5): older-model limits unchanged | | Real agent turn (scratch Gateway, `google/gemini-3.5-flash`): "use image_generate, 1:8, default model" | tool used `google/gemini-3.1-flash-image`, 768×1376 | tool used `google/gemini-nano-banana-2.1`, 352×2928 | - Focused tests: `extensions/google` image-generation provider, image registration, provider models, provider catalog and manifest tests (65 passed). - The panoramic test that called the provider directly was removed. It skipped the runtime metadata this PR changes, so it also passed on base. The live runs above cover that path. **Merge danger:** two-way door. This changes metadata and a default, and writes no stored state. A revert restores the previous default. Blast radius: Google image users who rely on the implicit default get the new model. Co-authored-by: Ayaan Zaidi <[email protected]>
…94251) fix(infer): stop video runs on Ctrl+C `openclaw infer video` dropped its execution context, and with it the cancel signal, so Ctrl+C left the provider request open until the CLI was force-killed about 2 seconds later. The existing execution context is now passed through, as audio already does. Uninterrupted runs are unchanged. Evidence: built CLI with a real MP4 against a slow local video-provider fixture, twice per ref. Main needed SIGKILL after about 2,090 ms; with this change the CLI exits with 130 in under 100 ms and the HTTP request closes within 1.1 ms. Uninterrupted output and request bodies are identical. Details: openclaw#194251 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 3af1447) Release adaptation: Forward video execution signal/assertCurrent and move existing guarded fetch/process scope to shared file owner. Retain baseline audio CLI and filesystem resolution: excluded HOLD audio/path migration not imported. Only13-line cancel regression, no fixture refactor. Follow-up dispositions: 577dd00 fix: send infer audio/video --model files only to the requested model (openclaw#190287); bcb47e8 feat(google): add Nano Banana 2.1 image model as the default (openclaw#200468); 6f5d3b3 fix: local path commands pick a neighboring file when a symlinked folder is followed by `..` (openclaw#200031); 3577724 fix(auth): only the running Gateway refreshes shared OAuth sign-ins (openclaw#198214); 81daea9 fix(cli): run infer model run through the Gateway that owns state (openclaw#198141); 22b1aac fix(media): cancel interrupted attachment downloads (openclaw#194399); e43ec1e fix(infer): cancel interrupted image descriptions (openclaw#194391) Validation: Baseline canceled-video assertion fails with16controls passing; candidate17/17passes,194251-green.log. Existing audio cancellation and workspace/cleanup behavior retained. Real MP4/CLI interrupt proof remains upstream-attributed, not locally rerun. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 853a96335df6193815789ebcc02d38af11123fcf) (cherry picked from commit 2ea2570de7f13823a8174590bfddfbfabdbcd915)
## What Problem This Solves Google's newest image generation and editing model (`gemini-nano-banana-2.1`) was not available in OpenClaw's `google` image-generation provider. Requests for it were capped at 5 reference images, and the panoramic aspect ratios it supports were not passed through: a `1:8` request quietly came back as a 9:16 image. ## User Impact - Google image generation now defaults to `google/gemini-nano-banana-2.1`. - On that model, edits accept up to 14 reference images and the `1:4`, `4:1`, `1:8` and `8:1` aspect ratios. - `gemini-3.1-flash-image` and `gemini-3-pro-image` stay available with their current limits. Explicitly configured image models are unchanged. - Chat model discovery excludes the new model, the same as the other Gemini image models. ## Why This Change Was Made - `DEFAULT_GOOGLE_IMAGE_MODEL` is now `gemini-nano-banana-2.1`, and `gemini-3.1-flash-image` stays in the model list. - The existing `maxInputImagesByModel` (14) and `aspectRatiosByModel` capability fields declare the model's limits, so the shared image runtime validates them without a new code path. - `nano-banana` is a non-text marker, and the manifest suppresses `google/gemini-nano-banana-2.1` from chat catalogs. - The Google provider, image-generation, model-config and `openclaw infer` docs show the new default and limits. ## Evidence Real Gemini API (AI Studio key), run from source on isolated state. Base is the merge base `22d5c8735a84`; head is this PR. | Scenario | Base | Head | |---|---|---| | `infer image generate`, no `--model` | `gemini-3.1-flash-image`, 1408×768 | `gemini-nano-banana-2.1`, 1376×768 | | `infer image edit` on Nano Banana 2.1, 14 reference images, `--aspect-ratio 1:8` | rejected: "supports at most 5 reference images, 14 requested" | 352×2928; all 14 reference colors appear in order | | `infer image generate` on Nano Banana 2.1, `--aspect-ratio 1:8` | 768×1376 (9:16), no warning | 352×2928 (1:8) | | `infer image edit` on `gemini-3.1-flash-image`, 14 references | rejected (max 5) | still rejected (max 5): older-model limits unchanged | | Real agent turn (scratch Gateway, `google/gemini-3.5-flash`): "use image_generate, 1:8, default model" | tool used `google/gemini-3.1-flash-image`, 768×1376 | tool used `google/gemini-nano-banana-2.1`, 352×2928 | - Focused tests: `extensions/google` image-generation provider, image registration, provider models, provider catalog and manifest tests (65 passed). - The panoramic test that called the provider directly was removed. It skipped the runtime metadata this PR changes, so it also passed on base. The live runs above cover that path. **Merge danger:** two-way door. This changes metadata and a default, and writes no stored state. A revert restores the previous default. Blast radius: Google image users who rely on the implicit default get the new model. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit bcb47e8) Release adaptation: Make Nano Banana 2.1 an explicit image-only alternative with model-specific edit and aspect-ratio capabilities. Leave the previous default, old model caps, and existing configuration examples unchanged. Companion audit: PR #200468 is the source. Later Google changes cover music output and Gemini 2.5 chat routing, not this image capability; no companion required. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Google's newest image generation and editing model (
gemini-nano-banana-2.1) was not available in OpenClaw'sgoogleimage-generation provider.User Impact
Users using Google image generation now default to
google/gemini-nano-banana-2.1with support for up to 14 reference images, panoramic aspect ratios (1:4,4:1,1:8,8:1), and1K/2K/4Koutput resolutions, while chat model discovery continues to exclude it with a clear suppression notice.Why This Change Was Made
gemini-nano-banana-2.1as the default model in thegoogleimage-generation provider metadata (DEFAULT_GOOGLE_IMAGE_MODEL), retaininggemini-3.1-flash-imageandgemini-3-pro-imageas supported models.maxInputImagesByModelof14andaspectRatiosByModeladding1:4,4:1,1:8,8:1) soimage_generateandopenclaw infer imagepass through the model's full parameter set without altering limits for older models.nano-bananaas a non-text marker and adds agoogle/gemini-nano-banana-2.1chat-catalog suppression so it is not treated as a chat model.openclaw inferdocs to reflect the new default and capabilities.Evidence
pnpm openclaw infer image generate --model google/gemini-nano-banana-2.1 --prompt "A minimal flat blue square on a white background" --output ./nano-banana-test.png --json- workednode scripts/run-tsgo.mjs -p extensions/google/tsconfig.json --noEmit- passed with 0 errors.node scripts/run-vitest.mjs run extensions/google/provider-models.test.ts extensions/google/provider-catalog.test.ts- 2 test files, 44 tests passed (includinggemini-nano-banana-2.1non-chat exclusion).NODE_OPTIONS="--import tsx" ./node_modules/.bin/vitest run --pool=forks --config test/vitest/vitest.extension-providers.config.ts extensions/google/image-registration.test.ts extensions/google/image-generation-provider.test.ts extensions/google/manifest.test.ts- 3 test files, 22 tests passed.