Skip to content

Optimize startup sequence to avoid redundant refreshAuth calls #21310

@sehoon38

Description

@sehoon38

This issue is a subtask of #21259.

During the startup sequence of the Gemini CLI, the refreshAuth function appears to be called multiple times. This redundant execution adds unnecessary delay to the initialization process.

Proposed Solution

Investigate the startup flow to identify all call sites for refreshAuth. Refactor the initialization logic to ensure that authentication is refreshed exactly once during the critical startup path.

Tasks

  • Trace the execution path during CLI startup to identify all invocations of refreshAuth.
  • Analyze the dependencies and state requirements that cause these multiple calls.
  • Refactor the initialization sequence (e.g., in gemini.tsx, AppContainer.tsx, or config.ts) to consolidate auth refreshing.
  • Verify that the refactoring does not break subsequent auth-dependent operations (like CCPA admin controls fetching).
  • Measure and document the startup time improvements.

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalityarea/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmtworkstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions