Files
nexu-io-open-design/apps/web/tests/state/api-protocols.test.ts
Muhsin Mustapha c965aa7687 fix: update Google Gemini BYOK models to current API (remove shut-down 2.0 models, add 3.x) (#3821)
* fix: update Google Gemini BYOK models to current API (remove shut-down 2.0 models, add 3.x)

gemini-2.0-flash and gemini-2.0-flash-lite are now shut down by Google (404 NOT_FOUND). Replace the default model and suggested model list in the Google Gemini BYOK provider with the current live API lineup per https://ai.google.dev/gemini-api/docs/models (last updated 2026-06-01).

New default: gemini-3.5-flash (Stable, May 2026).

Full model list: gemini-3.5-flash, gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-3.1-flash-lite, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite.

* fix: update FAST_MODEL_BY_PROTOCOL.google to live gemini-3.5-flash

The SUGGESTED_MODELS list was migrated from 2.0 to 3.x in the previous
commit but FAST_MODEL_BY_PROTOCOL.google was missed, leaving the shared
fast-pick default (used by the memory extractor auto-mode and other
one-pick consumers) pointing at the shut-down gemini-2.0-flash endpoint.

Also adds a test in tests/state/api-protocols.test.ts that asserts the
Google fast default is contained in the live suggested-models list, so
the two tables cannot drift apart silently in future updates.

* fix: update daemon PROVIDER_DEFAULTS.google.model to gemini-3.5-flash

The memory extractor's PROVIDER_DEFAULTS table in memory-llm.ts still
had gemini-2.0-flash as the Google fast-pick fallback. The env-key path
and the BYOK chatProvider path both read this table when no explicit
model is set, so memory extraction against a Google key would still hit
the shut-down endpoint even after the BYOK Settings defaults were fixed.

Also fixes the stale gemini-2.0-flash assertion in
SettingsDialog.test.ts that was keeping CI red after the previous
commit updated the expected default.

Adds apps/daemon/tests/memory-google-default.test.ts: a focused
regression test that calls extractWithLLM with a Google chatProvider
carrying no model and asserts the outbound URL contains gemini-3.5-flash
so the daemon and web tables cannot drift silently in future updates.

* chore: normalize CRLF to LF on three files modified in this PR
2026-06-11 17:28:04 +00:00

12 lines
387 B
TypeScript

import { describe, expect, it } from 'vitest';
import {
FAST_MODEL_BY_PROTOCOL,
SUGGESTED_MODELS_BY_PROTOCOL,
} from '../../src/state/apiProtocols';
describe('apiProtocols table consistency', () => {
it('FAST_MODEL_BY_PROTOCOL.google is one of the live suggested models', () => {
expect(SUGGESTED_MODELS_BY_PROTOCOL.google).toContain(FAST_MODEL_BY_PROTOCOL.google);
});
});