Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
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

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

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