Skip to content

feat(gemini): add nano banana 2.1 image gen model - #200468

Merged
obviyus merged 3 commits into
openclaw:mainfrom
markmcd:nano-banana-2.1
Nov 19, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
markmcd:nano-banana-2.1

Conversation

@markmcd

@markmcd markmcd commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

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.

User Impact

Users using Google image generation now default to google/gemini-nano-banana-2.1 with support for up to 14 reference images, panoramic aspect ratios (1:4, 4:1, 1:8, 8:1), and 1K/2K/4K output resolutions, while chat model discovery continues to exclude it with a clear suppression notice.

Why This Change Was Made

  • Registers gemini-nano-banana-2.1 as the default model in the google image-generation provider metadata (DEFAULT_GOOGLE_IMAGE_MODEL), retaining gemini-3.1-flash-image and gemini-3-pro-image as supported models.
  • Declares model-specific edit and geometry capabilities (maxInputImagesByModel of 14 and aspectRatiosByModel adding 1:4, 4:1, 1:8, 8:1) so image_generate and openclaw infer image pass through the model's full parameter set without altering limits for older models.
  • Marks nano-banana as a non-text marker and adds a google/gemini-nano-banana-2.1 chat-catalog suppression so it is not treated as a chat model.
  • Updates Google provider, model config, and openclaw infer docs to reflect the new default and capabilities.

Evidence

  • Live generation test: 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 - worked
  • node 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 (including gemini-nano-banana-2.1 non-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.

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: google size: S labels Nov 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds 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.

  • Before: The shared runtime rejects more than five references and does not advertise 1:8 for this model.
  • After: The runtime permits 14 references and forwards 1:8 using model-specific metadata.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The production change is focused and source-consistent, but supplied behavior evidence is insufficient and the default choice awaits an owner.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Users cannot use the new model's larger reference-image allowance and panoramic geometry through OpenClaw's current shared image runtime.
Reason: The capability update has clear value and preserves existing owners, while changing the established provider default requires an owner decision.

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
Reviewed head: 85dfe79a70014c4d31c92d2871ecbe32ac7b9c72
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Nano Banana 2.1 replace stable Flash for users relying on Google's implicit image default?
  • Recommendation: Keep Flash as the default: Offer Nano Banana 2.1 with its own capability keys while preserving existing automatic selection.
  • Why: The capability addition is useful independently, but the default switch changes existing automatic selections and has no recorded owner approval.

Before merge

  • Add real behavior proof - The body names the shipped infer image command and reports success for an explicit-model generation, but provides no terminal output, image artifact, or logs establishing the result; that scenario also omits the changed reference limits, panoramic handling, implicit default, and upgrade behavior. Supply terminal captures or live output with IPs, API keys, phone numbers, and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Low-value test extensions/google/image-generation-provider.test.ts: Remove or replace the added panoramic-model case: it directly calls the unchanged provider with one reference and a mocked response, bypassing the changed runtime metadata, so its explicit-model request assertions can pass on the base.
  • Missing end-to-end proof: Provide redacted CLI output showing the new model's 14-reference panoramic edit and default selection, plus fresh-install and latest-stable upgrade results preserving explicit image-model settings; no base-versus-head regression result is supplied.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Google image default changes intended behavior with a stated reason (349f787: Refresh served provider catalogs and replace preview Flash with stable Flash; the current PR explains its proposed replacement as the newest image model.)
  • Shared image metadata and capability limits keeps the original intent (47e174b: Centralize registration and runtime metadata to prevent model and capability drift; this PR extends that same owner and preserves older-model limits.)
  • Image-model exclusion from chat catalogs keeps the original intent (0749211: Suppress non-chat Google surfaces when hydrating new catalog models; the added suppression follows the existing separation.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 751e6c5 adds extensions/google/generation-provider-metadata.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 751e6c540f9a; files: extensions/google/generation-provider-metadata.ts)

PR surface

Source +27, Tests +39, Docs 0. Total +66 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 29 2 +27
Tests 3 45 6 +39
Docs 3 7 7 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 81 15 +66

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A bounded image-provider capability update with useful editing improvements and no demonstrated urgent regression.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: A bounded image-provider capability update with useful editing improvements and no demonstrated urgent regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 2:15 AM ET / 07:15 UTC.

@obviyus
obviyus merged commit bcb47e8 into openclaw:main Nov 19, 2026
105 checks passed
@obviyus

obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Landed in bcb47e8. Thanks @markmcd!

  • What changed: Google image generation now defaults to 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. Older Google image models keep their current limits.
  • Maintainer changes: updated the default-model rows in docs/tools/image-generation.md, and removed the panoramic provider test. That test called the provider directly, so it also passed without this change.
  • Proof (real Gemini API, base vs head):
    • Default model: gemini-3.1-flash-image on base, gemini-nano-banana-2.1 on head.
    • Edit with 14 reference images at 1:8: rejected on base (max 5). On head it returned 352×2928, with all 14 reference colors in order.
    • Generate at 1:8: 9:16 on base with no warning, 1:8 on head.
    • Real agent turn using image_generate: the same switch, on both the model and the aspect ratio.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…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]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…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)
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: google gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants