Skip to content

# feat: add Gemini 3.1 Pro (low/high reasoning) model support#21257

Open
GhadiSaab wants to merge 13 commits intoopenclaw:mainfrom
GhadiSaab:main
Open

# feat: add Gemini 3.1 Pro (low/high reasoning) model support#21257
GhadiSaab wants to merge 13 commits intoopenclaw:mainfrom
GhadiSaab:main

Conversation

@GhadiSaab
Copy link

@GhadiSaab GhadiSaab commented Feb 19, 2026

Summary

This PR implements Gemini 3.1 model support for:

  • google (Google API provider)
  • google-antigravity

The goal is to make Gemini 3.1 usable through OpenClaw’s existing model selection, catalog, and fallback paths for those two providers.

What this adds

  • Gemini 3.1 forward-compat resolution for google and google-antigravity
  • Gemini 3.1 catalog synthesis so models appear even when upstream discovery still exposes Gemini 3 templates
  • Gemini 3.1 model listing synthesis in models list
  • Google-provider normalization alignment: Gemini 3.1 aliases follow the same preview-ID normalization pattern used by existing Google models

Provider Scope

Implemented in this PR:

  • google
  • google-antigravity

Not implemented in this PR:

  • google-gemini-cli Gemini 3.1

Reason: current upstream Cloud Code Assist responses for Gemini 3.1 are not reliably available in this environment (404 Requested entity was not found). This PR stays focused on the providers that are validated and working.

Change Type

  • Feature
  • Bug fix
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • Gateway / orchestration
  • Integrations
  • UI / DX (model catalog/list visibility)
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • API / contracts
  • CI/CD / infra

Linked Issue/PR

User-visible behavior

  • google now accepts and resolves Gemini 3.1 IDs through forward-compat behavior.
  • google-antigravity resolves Gemini 3.1 aliases to runtime-safe low/high IDs.
  • Gemini 3.1 entries now appear in model catalog/listing for these providers when templates exist.

Verification

Tests run

  • pnpm exec vitest run --config vitest.unit.config.ts src/agents/model-forward-compat.test.ts src/agents/model-catalog.test.ts src/commands/models.list.test.ts
    • Passed: 3 files, 36 tests
  • pnpm exec vitest run --config vitest.e2e.config.ts src/agents/models-config.normalizes-gemini-3-ids-preview-google-providers.e2e.test.ts
    • Passed: 1 file, 1 test
  • pnpm exec vitest run --config vitest.e2e.config.ts src/agents/pi-embedded-runner.applygoogleturnorderingfix.e2e.test.ts
    • Passed: 1 file, 2 tests
  • pnpm exec vitest run --config vitest.unit.config.ts src/media-understanding/providers/google/video.test.ts src/providers/google-shared.preserves-parameters-type-is-missing.test.ts
    • Passed: 2 files, 11 tests

Smoke check

  • pnpm openclaw models list --provider google --all --json
    • Confirmed Gemini 3.1 entries are listed for google.

Not verified

  • Live inference against Google API with production credentials (credentials not configured in this environment).
  • google-gemini-cli Gemini 3.1 live calls (out of scope for this PR).

Compatibility / Migration

  • Backward compatible: Yes
  • Config/env changes required: No
  • Migration required: No

GhadiSaab and others added 2 commits February 19, 2026 21:58
Add gemini-3.1-pro-low-preview and gemini-3.1-pro-high-preview to the
model catalog so they are recognized across google, google-gemini-cli,
google-antigravity, opencode, openrouter, and venice providers.

Closes openclaw#21176

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add Gemini 3.1 Pro (low/high reasoning) model support
@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: S labels Feb 19, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

GhadiSaab and others added 3 commits February 20, 2026 08:08
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Split the 120-char one-liner provider check into multiple lines
to fix oxfmt format check failure in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
oxlint's prefer-set-has rule requires using Set.has() instead of
Array.includes() for membership checks on constant collections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Skeptomenos
Copy link

Hey there! Thanks for adding support for Gemini 3.1.

Would it be possible to also add the gemini-3.1-pro-preview-customtools endpoint to the catalog in this PR?

According to the official Google documentation, this specific variant is explicitly optimized for agentic workflows that rely on bash and custom tools, which makes it particularly relevant for OpenClaw's architecture.

It would be amazing to have native support for this endpoint out of the box! Thanks for your hard work on this.

@GhadiSaab
Copy link
Author

Hey there! Thanks for adding support for Gemini 3.1.

Would it be possible to also add the gemini-3.1-pro-preview-customtools endpoint to the catalog in this PR?

According to the official Google documentation, this specific variant is explicitly optimized for agentic workflows that rely on bash and custom tools, which makes it particularly relevant for OpenClaw's architecture.

It would be amazing to have native support for this endpoint out of the box! Thanks for your hard work on this.

Hey, this is a great idea, I hadn't thought of it! I implemented the changes.

@fil512
Copy link

fil512 commented Feb 20, 2026

Eagerly awaiting this merge 😓

@GhadiSaab
Copy link
Author

Eagerly awaiting this merge 😓

trust me, me too, literally coding it in class😭

@tahaygun
Copy link

tahaygun commented Feb 20, 2026

So this should work for antigravity provider too right?

@GhadiSaab
Copy link
Author

So this should work for antigravity provider too right?

yes it should. you can test it locally

@tahaygun
Copy link

So this should work for antigravity provider too right?

yes it should. you can test it locally

image

I couldn't see it in the options when i run configure.

@lllandy
Copy link

lllandy commented Feb 20, 2026

So this should work for antigravity provider too right?

yes it should. you can test it locally

image I couldn't see it in the options when i run `configure`.

Same issue here, I checked out the code and built an image with it. I am running openclaw in docker, but with the code change I still can't see the 3.1 model listed during setup or result of 'models list', hence couldn't load the model successfully when running. Probably need to make more changes to



src/agents/model-catalog.ts
src/commands/models/list.registry.ts

to have it fixed fully.
Thanks for the contribution tho :)

@GhadiSaab
Copy link
Author

So this should work for antigravity provider too right?

yes it should. you can test it locally

image I couldn't see it in the options when i run `configure`.

Same issue here, I checked out the code and built an image with it. I am running openclaw in docker, but with the code change I still can't see the 3.1 model listed during setup or result of 'models list', hence couldn't load the model successfully when running. Probably need to make more changes to



src/agents/model-catalog.ts
src/commands/models/list.registry.ts

to have it fixed fully. Thanks for the contribution tho :)

yes i have seen it, i am currently working on a fix

@GhadiSaab
Copy link
Author

Hey there! Thanks for adding support for Gemini 3.1.

Would it be possible to also add the gemini-3.1-pro-preview-customtools endpoint to the catalog in this PR?

According to the official Google documentation, this specific variant is explicitly optimized for agentic workflows that rely on bash and custom tools, which makes it particularly relevant for OpenClaw's architecture.

It would be amazing to have native support for this endpoint out of the box! Thanks for your hard work on this.

hey, i just checked, i think thru googles api it would be possible but thru antigravity and gemini cli not since the model is not there. ill try to implement it only for the api but i cant promise anything yet

@openclaw-barnacle openclaw-barnacle bot added commands Command implementations size: L and removed size: S labels Feb 20, 2026
@GhadiSaab
Copy link
Author

So this should work for antigravity provider too right?

yes it should. you can test it locally

image I couldn't see it in the options when i run `configure`.

hey, test it now it should be working :)

@openclaw-barnacle openclaw-barnacle bot added scripts Repository scripts docker Docker and sandbox tooling labels Feb 20, 2026
@openclaw-barnacle openclaw-barnacle bot removed the scripts Repository scripts label Feb 20, 2026
@openclaw-barnacle openclaw-barnacle bot removed the docker Docker and sandbox tooling label Feb 20, 2026
@openclaw-barnacle openclaw-barnacle bot added the channel: whatsapp-web Channel integration: whatsapp-web label Feb 20, 2026
@openclaw-barnacle openclaw-barnacle bot added the channel: msteams Channel integration: msteams label Feb 20, 2026
@tahaygun
Copy link

tahaygun commented Feb 20, 2026

hey, test it now it should be working :)

works like charm, thanks a lot!

@openclaw-barnacle openclaw-barnacle bot removed the channel: whatsapp-web Channel integration: whatsapp-web label Feb 21, 2026
@gianpaj
Copy link

gianpaj commented Feb 21, 2026

duplicate of this #21543

or should #21543 be closed?

@GhadiSaab
Copy link
Author

duplicate of this #21543

or should #21543 be closed?

i didnt really understand, but this PR is the one i worked on to add support for gemini 3.1. I beleive it can be merged at this point. i have been using my integration of gemini 3.1 since yesterday and can say it works well. test it locally. i would like for this pr to be merged if possible

@Glucksberg
Copy link
Contributor

This could be relevant to what you're working on.

Several other PRs seem to address the same problem:

Both PRs add Gemini 3.1 model support to OpenClaw providers — PR#21263 targets google-vertex, PR#21257 targets google and google-antigravity.

Both approaches have merit — might be worth coordinating.

If any of these links don't look right, let me know and I'll correct them.

@MondoBoricua
Copy link

I can confirm this PR addresses the root cause of the 404 errors with google-antigravity + Gemini 3.1 Pro.

Root cause: The Antigravity Cloud Code Assist API requires the thinking-tier suffix (-low/-high) in the model ID for all Gemini 3 Pro variants. Without it, the API returns 404: Requested entity was not found.

I verified this by comparing how opencode-antigravity-auth plugin (v1.6.0) handles the same model — it appends -low as default tier before sending to the API, and it works. OpenClaw's current forward-compat resolution returns bare gemini-3.1-pro which the API rejects.

This PR correctly adds gemini-3.1-pro-low and gemini-3.1-pro-high as the google-antigravity model IDs, matching the existing pattern for gemini-3-pro-low/gemini-3-pro-high.

Tested manually by patching the compiled dist files with the equivalent changes — Gemini 3.1 Pro works correctly via Antigravity after the fix.

See #24071 for detailed root cause analysis.

@Mellowambience
Copy link
Contributor

good catch @MondoBoricua — the opencode-antigravity-auth comparison is exactly the right reference point. the -low default append is what makes the difference.

for context, PR #21181 takes a slightly different approach to the same problem — worth a quick look to see if either implementation has edge cases the other misses before merging. happy to test against both if that helps the reviewers.

@GhadiSaab
Copy link
Author

This could be relevant to what you're working on.

Several other PRs seem to address the same problem:

Both PRs add Gemini 3.1 model support to OpenClaw providers — PR#21263 targets google-vertex, PR#21257 targets google and google-antigravity.

Both approaches have merit — might be worth coordinating.

If any of these links don't look right, let me know and I'll correct them.

hello, thanks for the clarifications. When do you think this and the other PRs can be merged ?

@Mellowambience
Copy link
Contributor

thanks @MondoBoricua for the detailed confirmation — the root cause analysis lines up exactly with what i found. the -low/-high suffix requirement for antigravity is the core fix here and this PR has it covered for both google and google-antigravity providers.

@GhadiSaab on merge timeline — that's up to the maintainers, but from my end this PR is ready. MondoBoricua's manual verification removes the last open question. re: coordination with #21181 and #21263#21181 is mine and covers the forward-compat alias for google-gemini-cli, which is a different provider scope. #21263 covers google-vertex. these aren't redundant — they target different provider paths. if maintainers want to consolidate, i'm open to it, but each PR is independently valid and non-overlapping.

pinging for review: the PRs can likely be merged in parallel without conflict.

@openclaw-barnacle
Copy link

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 Mar 1, 2026
@Mellowambience
Copy link
Contributor

not stale — gemini 3.1 pro support is still needed and the implementation is solid. root cause confirmed via manual testing by @MondoBoricua (antigravity api requires -low/-high suffix). non-overlapping with #21181 and #21263. waiting on maintainer review.

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

Labels

agents Agent runtime and tooling channel: msteams Channel integration: msteams commands Command implementations size: L stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gemini-3.1-pro-preview to google-gemini-cli provider model catalog

9 participants