chore: migrate to official ThinkingLevel enum when @google/genai upgrades #28
Description
Summary
This is a tracking issue / reminder - not a bug or problem. The current implementation works correctly.
When @google/gemini-cli-core upgrades its dependency on @google/genai to a version that exports the ThinkingLevel enum (v1.34.0+), we should migrate from our locally-defined enum to the official one.
Current State
In PR #28 / commit c120533, we added thinkingConfig support for Gemini 3's thinking mode. Because @google/gemini-cli-core (all versions through 0.22.0-preview.2) depends on @google/genai v1.30.0, which does not export the ThinkingLevel enum, we defined our own:
// src/gemini-language-model.ts
export enum ThinkingLevel {
LOW = 'LOW',
MEDIUM = 'MEDIUM',
HIGH = 'HIGH',
MINIMAL = 'MINIMAL',
}This enum is re-exported from src/index.ts for users.
When to Act
Monitor these dependencies:
-
@google/gemini-cli-coreupgrades to use@google/genai>= 1.34.0 -
@google/genaiv1.34.0+ exportsThinkingLevelenum (confirmed it does)
Migration Steps
When the time comes:
-
Update dependencies
npm update @google/gemini-cli-core
-
Update imports in
src/gemini-language-model.ts:// Remove local enum definition // Add import: import { ThinkingLevel } from '@google/genai';
-
Update re-export in
src/index.ts:// Change from: export { ThinkingLevel } from './gemini-language-model'; // To: export { ThinkingLevel } from '@google/genai';
-
Remove type workarounds:
- Remove
ExtendedThinkingConfigtype alias - Remove the cast
as GenerateContentConfig['thinkingConfig']
- Remove
-
Verify enum values match - The official enum uses:
enum ThinkingLevel { THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED", LOW = "LOW", MEDIUM = "MEDIUM", HIGH = "HIGH", MINIMAL = "MINIMAL" }
Our local enum matches (minus UNSPECIFIED which we don't need).
-
Run tests to ensure nothing breaks
Files Affected
src/gemini-language-model.ts- Local enum definition + type workaroundssrc/index.ts- Re-export source
Labels
enhancementgood first issuedependencies
Activity
giulio-leone commentedon Jan 11, 2026
Ho implementato la migrazione richiesta in una PR: #38
Include migrazione a
ThinkingLevelufficiale da@google/genaie override npm per evitare doppie versioni di@google/genai(type mismatch). Test + type-check + build ok.ben-vargas commentedon Jan 12, 2026
Status update (Jan 2026):
PR #38 proposed migrating to the official
ThinkingLevelenum using npm overrides to force@google/gemini-cli-coreto use@google/genai@^1.35.0.Decided to wait for upstream alignment instead - preferring to stay in lock-step with the dependency versions that
@google/gemini-cli-coreis tested against.Current state:
@google/gemini-cli-core@0.23.0(latest) still pins@google/genai@1.30.0@google/genai@1.35.0is available with the officialThinkingLevelenumWill revisit when Google updates
@google/gemini-cli-coreto depend on@google/genai>= 1.34.0.ben-vargas commentedon Aug 3, 2026
Closing as moot: this package is deprecated and the repository is archived. Google ended Gemini CLI support for individual accounts on 2026-06-18 (transition to Antigravity CLI), so the @google/genai ThinkingLevel migration will never be needed here. See the README deprecation notice for details.