Skip to content

Comments

feat(devtools): migrate devtools package into monorepo#18936

Merged
SandyTao520 merged 13 commits intomainfrom
st/devtools-monorepo
Feb 18, 2026
Merged

feat(devtools): migrate devtools package into monorepo#18936
SandyTao520 merged 13 commits intomainfrom
st/devtools-monorepo

Conversation

@SandyTao520
Copy link
Contributor

@SandyTao520 SandyTao520 commented Feb 12, 2026

Summary

Migrates the gemini-cli-devtools package source code into the monorepo at packages/devtools/, replacing the external npm dependency with a workspace package (@google/gemini-cli-devtools).

Also fixes two DevTools UI bugs:

  • JSON view crash: RangeError: Invalid string length when serializing SSE snapshot — chunks are now dropped once response.body arrives, eliminating data duplication
  • Chunked JSON rendering: JSON mode now joins all chunks before parsing, so SSE responses split across TCP boundaries render correctly

Details

  • Adds packages/devtools/ with server (HTTP + WebSocket + SSE), React client UI, and custom build (esbuild for client + tsc for server)
  • Removes gemini-cli-devtools from root optionalDependencies
  • Renames all references from gemini-cli-devtools@google/gemini-cli-devtools (esbuild external, devtoolsService, test mock)
  • Adds react-dom to root devDependencies (needed for client build)
  • DevTools stays external in esbuild (server reads client/index.html at runtime via __dirname)

Related to #18648 #18494

How to Validate

  1. npm install && npm run build — full build succeeds
  2. npm run build --workspace=@google/gemini-cli-devtools — devtools builds independently
  3. ls packages/devtools/dist/ — should contain src/index.js, src/index.d.ts, client/main.js
  4. Run CLI with general.devtools: true in settings → DevTools starts and serves UI
  5. npm run test --workspace=@google/gemini-cli — all tests pass (including devtoolsService tests)

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

@SandyTao520 SandyTao520 requested review from a team as code owners February 12, 2026 18:35
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 12, 2026

Hi @SandyTao520, 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!

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SandyTao520, 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 integrates the DevTools functionality directly into the project's monorepo, enhancing maintainability and consistency. It refactors the DevTools into a dedicated workspace package, streamlining its build and dependency management. Crucially, it resolves existing UI issues within the DevTools, specifically improving how large JSON responses and chunked data streams are handled and displayed, leading to a more robust and reliable debugging experience.

Highlights

  • Monorepo Migration: The gemini-cli-devtools package has been migrated into the monorepo at packages/devtools/, transitioning it from an external npm dependency to an internal workspace package named @google/gemini-cli-devtools.
  • DevTools UI Bug Fixes: Addressed a RangeError: Invalid string length crash in the JSON view by preventing data duplication from SSE snapshots, and improved chunked JSON rendering to correctly display SSE responses split across TCP boundaries.
  • New DevTools Package Structure: A new packages/devtools/ directory now houses the DevTools server (HTTP, WebSocket, SSE), a React-based client UI, and a custom build process utilizing esbuild for the client and tsc for the server.
  • Dependency and Reference Updates: The root package.json and package-lock.json were updated to include react-dom as a dev dependency, remove the old gemini-cli-devtools entry, and rename all internal references to the new @google/gemini-cli-devtools workspace package.
Changelog
  • esbuild.config.js
    • Updated external dependency name from 'gemini-cli-devtools' to '@google/gemini-cli-devtools'.
  • package-lock.json
    • Added 'react-dom' as a development dependency.
    • Removed the external 'gemini-cli-devtools' entry.
    • Added a local link for the new '@google/gemini-cli-devtools' workspace package.
    • Updated 'react' and 'react-dom' versions.
  • package.json
    • Added 'react-dom' to devDependencies.
    • Removed 'gemini-cli-devtools' from optionalDependencies.
  • packages/cli/src/utils/devtoolsService.test.ts
    • Updated mocked module name from 'gemini-cli-devtools' to '@google/gemini-cli-devtools'.
  • packages/cli/src/utils/devtoolsService.ts
    • Updated the DEVTOOLS_PKG constant from 'gemini-cli-devtools' to '@google/gemini-cli-devtools'.
  • packages/devtools/GEMINI.md
    • Added comprehensive documentation for the new DevTools package, covering features, architecture, environment variables, API endpoints, and development guidelines.
  • packages/devtools/client/index.html
    • Added the base HTML file for the DevTools client user interface, including essential meta tags, title, and styling.
  • packages/devtools/client/src/App.tsx
    • Added the main React application component for the DevTools UI, featuring console and network inspectors, session management, import/export capabilities, and theme switching.
  • packages/devtools/client/src/hooks.ts
    • Added React hooks for managing and fetching DevTools data, including network and console logs, from the Server-Sent Events (SSE) endpoint.
  • packages/devtools/client/src/main.tsx
    • Added the entry point for the React client application, responsible for rendering the main App component into the DOM.
  • packages/devtools/esbuild.client.js
    • Added the esbuild configuration file for bundling the client-side React application, specifying entry points, output, and build options.
  • packages/devtools/package.json
    • Added the package definition for '@google/gemini-cli-devtools', including metadata, build scripts, dependencies, and file exports.
  • packages/devtools/src/index.ts
    • Added the DevTools server implementation, which handles HTTP requests, WebSocket connections for log ingestion, and Server-Sent Events (SSE) for real-time UI updates. Includes logic for managing network and console logs, sessions, and bug fixes for chunk handling.
  • packages/devtools/src/types.ts
    • Added TypeScript type definitions for NetworkLog, ConsoleLogPayload, and InspectorConsoleLog to ensure type safety within the DevTools package.
  • packages/devtools/tsconfig.json
    • Added TypeScript configuration for the new devtools package, defining compiler options and specifying included source files.
Activity
  • Tests were added/updated to cover the changes.
  • Validation was performed on MacOS.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Size Change: -41 B (0%)

Total Size: 24.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.5 MB -41 B (0%)
./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

compressed-size-action

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully migrates the gemini-cli-devtools package into the monorepo, which is a great step for maintainability. The migration of dependencies and paths seems correct. I've found a critical syntax error in the new devtools server that would prevent it from running, and a high-severity bug in the SSE parsing logic within the new React UI. Please see my comments for details and suggestions.

@SandyTao520 SandyTao520 added this pull request to the merge queue Feb 18, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 18, 2026
@SandyTao520 SandyTao520 added this pull request to the merge queue Feb 18, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 18, 2026
@SandyTao520 SandyTao520 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 65ad78b Feb 18, 2026
27 checks passed
@SandyTao520 SandyTao520 deleted the st/devtools-monorepo branch February 18, 2026 20:16
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