Skip to content

feat(core): support inspector mode for worker pool#919

Merged
fi3ework merged 2 commits intomainfrom
max/2026-01-29--17-12
Jan 29, 2026
Merged

feat(core): support inspector mode for worker pool#919
fi3ework merged 2 commits intomainfrom
max/2026-01-29--17-12

Conversation

@fi3ework
Copy link
Copy Markdown
Member

Summary

  • Enhanced pluginInspect to detect --inspect flags in pool.execArgv
  • Pass pool.execArgv to pluginInspect during Rsbuild preparation
  • Improved debugging support for test workers when running in pool mode

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 29, 2026 09:12
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fi3ework, 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 introduces significant improvements to the debugging experience for worker pools within the Rsbuild core. By extending the pluginInspect functionality to recognize inspector flags passed to worker processes, it facilitates more robust and streamlined debugging of test workers, ultimately enhancing developer productivity when working with parallel execution environments.

Highlights

  • Enhanced Inspector Mode Detection: The pluginInspect function now checks for --inspect flags within pool.execArgv, in addition to the current process's inspector URL, to determine if inspection mode should be enabled.
  • Worker Pool Debugging Support: The pool.execArgv configuration is now passed to pluginInspect during the Rsbuild preparation phase, enabling better debugging capabilities for test workers operating in pool mode.
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.

Copy link
Copy Markdown
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 enhances debugging support for worker pools by allowing the inspector to be enabled for workers. The changes involve updating pluginInspect to check for --inspect flags in pool.execArgv and passing these arguments from the Rsbuild preparation step. The implementation is clean and achieves the goal. I have one minor suggestion to improve code clarity by removing an unnecessary optional chaining operator, aligning the code more closely with the existing type definitions.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the inspect/debugging support so that tests running in a worker pool can benefit from the same inspector-friendly bundler configuration as single-process runs.

Changes:

  • Extend prepareRsbuild to read normalizedConfig.pool and pass pool.execArgv into the inspect plugin.
  • Enhance pluginInspect to accept optional poolExecArgv and enable itself when either the current process is being inspected or the worker pool execArgv contains --inspect flags.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/core/rsbuild.ts Wires normalizedConfig.pool.execArgv into pluginInspect so the Rsbuild config reflects worker pool inspect flags.
packages/core/src/core/plugins/inspect.ts Updates the inspect plugin to detect inspect mode from both inspector.url() and poolExecArgv, enabling better debugging for pool-based workers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@fi3ework fi3ework force-pushed the max/2026-01-29--17-12 branch from 1bee6ec to 0bacd8f Compare January 29, 2026 10:44
@fi3ework fi3ework merged commit ba64299 into main Jan 29, 2026
9 checks passed
@fi3ework fi3ework deleted the max/2026-01-29--17-12 branch January 29, 2026 10:59
@fi3ework fi3ework mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants