Feat/browser agent progress emission#21218
Conversation
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 significantly enhances the browser agent's feedback mechanism by transitioning from simple string-based progress updates to a structured Highlights
Changelog
Activity
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. 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
|
|
@jacob314 @gsquared94 can you please review this pr and let me know if any changes needed? |
There was a problem hiding this comment.
Code Review
This pull request introduces structured SubagentProgress emission for the browser agent, which is a significant enhancement for providing rich UI feedback. However, it introduces a critical security vulnerability where sensitive tool arguments (e.g., passwords used in a fill tool call) are emitted in plain text within the progress updates, risking exposure in logs or user interfaces. Additionally, a high-severity issue was identified where tool errors (other than cancellations) do not update the tool's status, leaving it in a misleading 'running' state in the UI, which needs to be addressed for accurate progress display.
|
@kunal-10-cloud please address the gemini review findings. Also can you add a screencast of this working? Thanks. |
|
/gemini review |
sure just give me a few moments |
There was a problem hiding this comment.
Code Review
This pull request introduces structured "SubagentProgress" emission for the browser agent, significantly improving UI rendering with richer feedback. While the PR aims to sanitize sensitive data in tool arguments and includes unit tests, it has several security weaknesses. The redaction logic in sanitizeToolArgs is incomplete, missing common variants of sensitive keys like api_key, and sensitive information is leaked through tool descriptions and unvalidated error messages. The PR also handles various activity event types, manages state transitions, and ensures final state emission.
…nd mark all running tools on global errors
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured SubagentProgress emission for the browser agent, enhancing user experience with richer feedback, and implements sanitization for sensitive data in tool arguments and error messages. However, a security vulnerability exists where sensitive information could still be leaked through LLM thoughts and incomplete error message sanitization. To fully address this, the redaction logic must be consistently applied across all event types, including LLM thoughts, and the error message sanitizer needs to be updated to cover all sensitive key patterns. Specifically, the current regular expressions for redacting credentials in error messages are too restrictive, and error messages in the top-level catch block are not being sanitized before being passed to the LLM.
… catch block errors
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured progress reporting for the browser agent, which is a significant improvement for UI feedback. The implementation includes comprehensive state management for agent activities and, importantly, adds sanitization for sensitive data like API keys and passwords in tool arguments and error messages. A security audit confirms that the new sanitization logic is a significant security improvement, and no high or critical severity vulnerabilities were identified in the provided patches, though regex-based redaction has inherent limitations. However, a critical type issue in the error handling path for llmContent could lead to runtime errors and potential prompt injection risks, and a high-severity bug in the error message sanitization regex might cause over-redaction of information. Addressing these will enhance the feature's robustness and security.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…in sanitizeErrorMessage
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured progress emission for the browser agent, significantly enhancing UI rendering, user feedback, and observability. It also adds crucial sanitization for sensitive data in tool arguments, thoughts, and error messages. However, the sanitization logic for redacting sensitive information (like API keys and passwords) from these progress updates is incomplete. Specifically, a high-severity issue was identified where a sensitive key pattern (pwd) was missed in the error message sanitization. Furthermore, tool call descriptions and display names are not sanitized, and the tool argument sanitization only checks keys, not values. These gaps could lead to accidental leakage of secrets in the UI or logs.
…scriptions, displayNames, and error messages
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured SubagentProgress emission for the browser agent, aiming to provide a richer UI experience by handling various activity events and implementing data sanitization. However, a critical race condition was identified in how concurrent tool calls are handled, which could lead to incorrect UI states. Additionally, a potential information disclosure vulnerability exists where API keys containing spaces in unquoted values might not be fully redacted due to a limitation in the regular expression used for sanitization, potentially exposing sensitive information. Furthermore, the key normalization logic for security sanitization may be insufficient, potentially leading to sensitive data leakage if bypassed. Addressing these issues is important for the feature's stability and security.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured progress emission for the browser agent, which is a great improvement for UI feedback and observability. The implementation includes robust handling of different activity events and comprehensive data sanitization to prevent leaks of sensitive information. My review focuses on improving the reliability of state management for concurrent tool calls, specifically by relying on callId exclusively for identification to prevent potential race conditions. The provided comments align with best practices and are kept as is.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement by implementing structured progress emission for the browser agent, which will greatly enhance the user experience. The changes are well-structured, covering various activity types and ensuring proper state management. The addition of comprehensive data sanitization is a crucial security measure. However, I've identified a critical vulnerability in the sanitization logic that could lead to incomplete redaction of secrets. My review includes a detailed comment with a suggested fix for this issue. Overall, the implementation is solid, and the new tests are thorough.
Note: Security Review did not run due to the size of the PR.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces structured progress emission for the browser agent, enhancing UI feedback with comprehensive state management and extensive tests. However, a critical security vulnerability has been identified in the new data sanitization logic. Specifically, a bug in the regex construction for redacting unquoted values, caused by the incorrect use of single backslashes for the whitespace character class in a template literal, could lead to incomplete redaction of secrets and sensitive data leaks. This requires high-priority correction by using double backslashes to ensure the regex engine receives the correct character class.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the browser agent's progress reporting by switching from raw string updates to structured SubagentProgress emissions. This change enables a much richer and more informative UI in the terminal. A major part of this work is the implementation of robust data sanitization logic to redact sensitive information like API keys, passwords, and tokens from thoughts, tool arguments, and error messages, which is a critical security enhancement. The new state management logic correctly handles the lifecycle of tool calls, including concurrent executions, by leveraging callId. The changes are comprehensive and supported by an extensive new suite of unit tests that cover numerous sanitization edge cases. The overall implementation is of high quality.
Hi @gsquared94 @sehoon38 , I have addressed the Gemini bot's recommendations as well as added the screencast in the PR description as requested. Please review it once and let me know if any changes are required |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
Implemented structured [SubagentProgress] emission for the browser agent, replacing raw string updates. This enables rich UI rendering with progress spinners, status icons, and formatted tool arguments in the terminal.
Details
Related Issues
Closes #21088
How to Validate
npm test -w @google/gemini-cli-core -- src/agents/browser/Run a browser task in the CLI and verify the UI shows spinners and tool icons during execution.
Attaching screencast as POC:
Screen.Recording.2026-03-08.at.4.48.37.AM.mov
Pre-Merge Checklist