Skip to content

fix(cli): optimize app relaunch process and fix restart functionality#24667

Draft
sehoon38 wants to merge 3 commits intomainfrom
fix-relaunch-bottleneck
Draft

fix(cli): optimize app relaunch process and fix restart functionality#24667
sehoon38 wants to merge 3 commits intomainfrom
fix-relaunch-bottleneck

Conversation

@sehoon38
Copy link
Copy Markdown
Contributor

@sehoon38 sehoon38 commented Apr 4, 2026

Summary

This PR optimizes the application relaunch process to avoid a double boot-up, significantly improving the startup time. It also fixes an issue where the restart functionality stopped working by correcting the expected RELAUNCH_EXIT_CODE.

Details

  • Moved the heavy initial load bypass logic to packages/cli/index.ts so the lightweight daemon can boot up and fork before heavy modules (gemini.js) are parsed and evaluated.
  • Fixed RELAUNCH_EXIT_CODE mismatch. It was temporarily 42 but the main codebase expected 199. Setting it back to 199 fixed the app restarts.
  • Fixed a TypeScript error where variables of type any were used inside index.ts. Replaced any with unknown and performed proper type-checking.

Related Issues

None.

How to Validate

  1. Run the app, observe faster startup speed.
  2. Issue an administrative update or use a command that requires restarting the CLI app. Ensure it properly restarts instead of shutting down.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Apr 4, 2026

Hi @sehoon38, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Size Change: +3.92 kB (+0.01%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-J7Y7JDV4.js 0 B -3.15 MB (removed) 🏆
./bundle/chunk-P2QFOMES.js 0 B -14.8 MB (removed) 🏆
./bundle/core-NPKQO3CF.js 0 B -45.2 kB (removed) 🏆
./bundle/devtoolsService-Z3BED63O.js 0 B -28.4 kB (removed) 🏆
./bundle/gemini.js 4.89 kB -545 kB (-99.11%) 🏆
./bundle/interactiveCli-5KHCCG7I.js 0 B -1.64 MB (removed) 🏆
./bundle/oauth2-provider-IWCSUQJD.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-6VVAVTVN.js 3.47 kB +3.47 kB (new file) 🆕
./bundle/chunk-PIXRPALS.js 3.14 MB +3.14 MB (new file) 🆕
./bundle/chunk-XC7SGJ34.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/core-HHWJSUS3.js 45.2 kB +45.2 kB (new file) 🆕
./bundle/devtoolsService-ZBMCI6W4.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/gemini-WSJLLKUL.js 547 kB +547 kB (new file) 🆕
./bundle/interactiveCli-3PNU3ILG.js 1.64 MB +1.64 MB (new file) 🆕
./bundle/oauth2-provider-LN276II7.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-GFUOVHXW.js 1.96 MB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-ACCRGPX3.js 980 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-J7HIRLJB.js 856 B +856 B (new file) 🆕

compressed-size-action

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants