Skip to content

fix(models): add fallback Gemini 3.1 Pro Preview catalog entry#22337

Closed
AIflow-Labs wants to merge 1 commit intoopenclaw:mainfrom
AIflow-Labs:codex/22323-gemini-provider-catalog
Closed

fix(models): add fallback Gemini 3.1 Pro Preview catalog entry#22337
AIflow-Labs wants to merge 1 commit intoopenclaw:mainfrom
AIflow-Labs:codex/22323-gemini-provider-catalog

Conversation

@AIflow-Labs
Copy link

@AIflow-Labs AIflow-Labs commented Feb 21, 2026

What changed

  • Add a built-in fallback entry for Google provider model google/gemini-3.1-pro-preview in src/agents/model-catalog.ts when it is missing from discovered models.
  • Keep fallback behavior aligned for runtime usage: reasoning enabled, context window set to 1,000,000, and text/image input support.
  • Add tests in src/agents/model-catalog.test.ts covering:
    • model injection when missing,
    • no-duplicate behavior when already present.

Why this fixes the issue

Issue 22323 is caused by discovery missing the new Gemini 3.1 Pro Preview model, which can hide it from built-in provider selection. This fallback guarantees the catalog always contains that model and does not alter discovery semantics when a matching entry already exists.

Tests run

  • pnpm vitest run --config vitest.unit.config.ts src/agents/model-catalog.test.ts
  • pnpm test -- src/agents/model-catalog.test.ts

Edge cases

  • Existing entries for google/gemini-3.1-pro-preview are preserved and not duplicated.
  • Existing cache-reset/retry behavior and partial discovery failure handling remain unchanged.

Infra flake / blockers

  • None known.

Greptile Summary

Adds fallback catalog entry for google/gemini-3.1-pro-preview model when it's missing from SDK discovery, following the same pattern as the existing OpenAI Codex Spark fallback.

Key changes:

  • Implements applyGoogle31ProPreviewFallback() function with deduplication check
  • Configures model with reasoning: true, 1M context window, and text+image input support
  • Adds comprehensive test coverage for both insertion and deduplication scenarios
  • Updates existing test to use toContainEqual instead of strict equality for better flexibility

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows an established pattern (OpenAI Codex fallback), includes proper deduplication logic, and has comprehensive test coverage validating both insertion and non-duplication scenarios. The change is isolated, well-tested, and addresses a specific discoverability issue.
  • No files require special attention

Last reviewed commit: c903811

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: S labels Feb 21, 2026
@vincentkoc
Copy link
Member

you have been detected be spamming with unwarranted prs and issues and your issues and prs have been automatically closed. please read contributing guide Contributing.md.

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

Labels

agents Agent runtime and tooling size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants