Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

chore: migrate to official ThinkingLevel enum when @google/genai upgrades #28

Closed as not planned

Description

@ben-vargas

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-core upgrades to use @google/genai >= 1.34.0
  • @google/genai v1.34.0+ exports ThinkingLevel enum (confirmed it does)

Migration Steps

When the time comes:

  1. Update dependencies

    npm update @google/gemini-cli-core
  2. Update imports in src/gemini-language-model.ts:

    // Remove local enum definition
    // Add import:
    import { ThinkingLevel } from '@google/genai';
  3. Update re-export in src/index.ts:

    // Change from:
    export { ThinkingLevel } from './gemini-language-model';
    // To:
    export { ThinkingLevel } from '@google/genai';
  4. Remove type workarounds:

    • Remove ExtendedThinkingConfig type alias
    • Remove the cast as GenerateContentConfig['thinkingConfig']
  5. 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).

  6. Run tests to ensure nothing breaks

Files Affected

  • src/gemini-language-model.ts - Local enum definition + type workarounds
  • src/index.ts - Re-export source

Labels

  • enhancement
  • good first issue
  • dependencies

Activity

  1. giulio-leone commented on Jan 11, 2026

    @giulio-leone
    Contributor

    Ho implementato la migrazione richiesta in una PR: #38

    Include migrazione a ThinkingLevel ufficiale da @google/genai e override npm per evitare doppie versioni di @google/genai (type mismatch). Test + type-check + build ok.

  2. ben-vargas commented on Jan 12, 2026

    @ben-vargas
    OwnerAuthor

    Status update (Jan 2026):

    PR #38 proposed migrating to the official ThinkingLevel enum using npm overrides to force @google/gemini-cli-core to 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-core is tested against.

    Current state:

    • @google/gemini-cli-core@0.23.0 (latest) still pins @google/genai@1.30.0
    • @google/genai@1.35.0 is available with the official ThinkingLevel enum

    Will revisit when Google updates @google/gemini-cli-core to depend on @google/genai >= 1.34.0.

  3. ben-vargas commented on Aug 3, 2026

    @ben-vargas
    OwnerAuthor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions