Skip to content

SED-4581 Modernize Node.js Agent#612

Draft
jeromecomte wants to merge 21 commits intomasterfrom
SED-4581-modernize-node-js-agent
Draft

SED-4581 Modernize Node.js Agent#612
jeromecomte wants to merge 21 commits intomasterfrom
SED-4581-modernize-node-js-agent

Conversation

@jeromecomte
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 significantly modernizes the Node.js agent, focusing on improved stability, resource management, and extensibility. The core change involves isolating keyword executions into dedicated child processes, preventing issues from one keyword affecting others. It also introduces a more sophisticated session management system and a richer output mechanism for keywords, alongside better project workspace handling and structured logging.

Highlights

  • Keyword Execution Isolation: The Node.js agent now executes keywords in isolated forked processes, preventing issues in one keyword from affecting others and improving overall stability.
  • Enhanced Session Management: A new Session class has been introduced, implementing Symbol.dispose for robust resource cleanup, ensuring that all session-bound resources are properly released.
  • Modernized OutputBuilder: The OutputBuilder has been refactored into a class, gaining new capabilities for incremental payload building, advanced error handling, and detailed measurement tracking with MeasureStatus.
  • NPM Project Workspace Management: The agent now dynamically manages NPM project workspaces, including caching and idle-time cleanup, to optimize resource usage and ensure clean environments for keyword execution.
  • Structured Logging: Logging across the Node.js agent has been migrated to winston, providing structured and configurable output for better observability and debugging.
  • Testing Framework Update: The testing framework has been updated from assert to Jest, improving testability, maintainability, and providing a richer testing experience.
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.

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

@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 significantly refactors the Node.js agent, introducing a forked agent process for keyword execution, a new Session class with resource disposal, and an enhanced OutputBuilder for improved error handling, attachments, and measurement capabilities. The Controller and FileManager classes were converted to use structured logging via winston and updated for better file management. A caching mechanism for resource references was also added in Java. Review comments highlight several areas for improvement, including considering dependency injection for the AutomationPackageResourceUploader to centralize caching, consistently using the new logger utility instead of console.log throughout the agent-fork, refining process.exit codes for graceful shutdowns, adopting strict equality (===), optimizing attachment logic in debug mode, and replacing synchronous file operations (fs.cpSync, fs.rmSync) with asynchronous alternatives for better performance. A potential bug was noted in FileManager.getFolderName for filenames with multiple dots, and a dependency management concern was raised regarding the logger's availability.

Copy link
Contributor

@david-stephan david-stephan left a comment

Choose a reason for hiding this comment

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

Mainly requesting clarifications rather than changes

david-stephan
david-stephan previously approved these changes Mar 20, 2026
Copy link
Contributor

@david-stephan david-stephan left a comment

Choose a reason for hiding this comment

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

@jeromecomte approving with a remaining minor comment for the test omitting the output.send()

david-stephan
david-stephan previously approved these changes Mar 20, 2026
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