fix(build): wire bundle:browser-mcp into bundle pipeline#24424
fix(build): wire bundle:browser-mcp into bundle pipeline#24424gsquared94 merged 2 commits intogoogle-gemini:mainfrom
Conversation
The bundle:browser-mcp script (which builds packages/core/dist/bundled/ chrome-devtools-mcp.mjs) was never invoked as part of the root bundle pipeline added in google-gemini#22213. This caused the bundled chrome-devtools-mcp to be missing from published npm packages, resulting in MODULE_NOT_FOUND errors at runtime when using the browser agent. Changes: - Add bundle:browser-mcp step to root bundle script before esbuild - Make copy_bundle_assets.js fail loudly when the bundled directory is missing instead of silently skipping the copy
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 addresses a missing dependency in the build pipeline that caused runtime errors due to missing browser agent files. By explicitly including the browser-mcp bundle step and adding strict validation during asset copying, the build process is now more robust and predictable. 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 updates the bundle script in package.json to include the browser MCP bundling step for the core package. It also modifies the copy_bundle_assets script to fail explicitly if the chrome-devtools-mcp bundle is not found, providing a helpful error message. I have no feedback to provide.
The 30-second setTimeout was insufficient for CI environments where Chrome launch + DevTools MCP connection + model response takes longer. Replace with poll() that waits up to 120s for the browser agent to signal completion (success or error). Related to google-gemini#24382
7b74943 to
d0455b4
Compare
Summary
The
bundle:browser-mcpscript (added in #22213) was never wired into the rootbundlepipeline, causingchrome-devtools-mcp.mjsto be missing from published npm packages. This results in aMODULE_NOT_FOUNDcrash when the browser agent launches.Details
Root cause: The root
bundlescript runsgenerate → build devtools → esbuild → copy_bundle_assets, but never invokesnpm run bundle:browser-mcp -w @google/gemini-cli-core, which is responsible for buildingpackages/core/dist/bundled/chrome-devtools-mcp.mjs. Thecopy_bundle_assets.jsscript then silently skips the copy when the source directory doesn't exist.Fix:
npm run bundle:browser-mcp -w @google/gemini-cli-coreto the rootbundlescript, beforeesbuildandcopy_bundle_assets.copy_bundle_assets.jsto fail loudly (with an actionable error message) when the bundled directory is missing, instead of silently skipping.Related Issues
How to Validate
packages/core/dist/bundled/orbundle/bundled/):bundle/bundled/chrome-devtools-mcp.mjsexists:copy_bundle_assets:rm -rf packages/core/dist/bundled node scripts/copy_bundle_assets.js # Should exit with errorPre-Merge Checklist