Skip to content

Gemini CLI Slow Boot Times (up to 9.77s) #25757

@spencer426

Description

@spencer426

What happened?

The Gemini CLI is experiencing consistently high startup times, taking up to 9.77 seconds to boot. During initialization, the CLI calls refreshAuth() which sets up the backend client models. In this process, the CLI synchronously awaits this.experimentsPromise (which fetches from the internal API proxy) and quotaPromise. The API proxy alone takes ~1.42 seconds to fetch its internal experiments and launch the HTTP server, and these sequential network requests significantly block the startup sequence.

What did you expect to happen?

The CLI should boot quickly, ideally taking around 4 seconds or less.

What is needed for this fix?

To resolve this issue, the sequential await calls in packages/core/src/config/config.ts (refreshAuth) must be decoupled.

  1. Remove await this.experimentsPromise; and await quotaPromise; from refreshAuth().
  2. Chain these promises asynchronously so that operations depending on them (e.g., setting request timeout, fetching admin controls, verifying pro model access) run concurrently via .then(...) and .catch(...).
  3. Update the tests in packages/core/src/config/config.test.ts and trackerTools.test.ts to accommodate the asynchronous configuration load, ensuring they wait for config.initialize() before asserting state.

Client information

Platform: Linux
Version: Gemini CLI (Development)

Login information

Internal Proxy Authentication / Google Account

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionality🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

    Type

    No fields configured for Bug.

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions