perf(core): fix slow boot by fetching experiments and quota asynchronously#25758
perf(core): fix slow boot by fetching experiments and quota asynchronously#25758spencer426 wants to merge 9 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request dramatically improves the Gemini CLI's startup performance by converting critical network requests for experiments and user quota from synchronous blocking operations to asynchronous, non-blocking calls. This change addresses the root cause of high boot times, allowing the application to initialize more efficiently and responsively. The modifications ensure that the CLI can fetch necessary data in the background without delaying the user experience, while also updating dependencies and adapting tests to reflect the new asynchronous behavior. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the Config initialization to handle experiments, admin controls, and user quotas asynchronously. Feedback highlights that this change introduces a race condition and violates the repository's initialization guidelines. Furthermore, removing the glob version override in package.json is identified as a security regression, as it leads to the use of deprecated dependency versions with known vulnerabilities.
|
Size Change: +114 B (0%) Total Size: 33.7 MB
ℹ️ View Unchanged
|
Summary
This PR addresses the consistently high startup times of the Gemini CLI by refactoring the initialization sequence to perform network requests asynchronously.
Details
During initialization (
refreshAuth), the CLI was synchronously awaitingthis.experimentsPromiseandquotaPromise. Because the internal proxy (gemini_api_proxy) takes ~1.42s to boot and fetch experiments, these sequentialawaitcalls were directly blocking the CLI startup, compounding latency and causing 8–10s boot times.By removing the blocking
awaitstatements and chaining the dependent operations inside.then()and.catch(), these requests are now executed concurrently in the background. Tests inconfig.test.tsandtrackerTools.test.tswere updated to ensure the CLI waits for the asynchronous state viaconfig.initialize()appropriately.Related Issues
Fixes #25757
How to Validate
npm run preflight) passes successfully.Pre-Merge Checklist