fix(agent): restore input blocker on Chrome fatal error#22574
fix(agent): restore input blocker on Chrome fatal error#22574cRAN-cg wants to merge 6 commits intogoogle-gemini:mainfrom
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 resolves a critical issue where the browser's input blocker could remain permanently suspended following a fatal Chrome connection error during interactive tool execution. By restructuring the input blocker's resumption logic with a 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
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the input blocker was not restored after a fatal Chrome connection error. The change refactors mcpToolWrapper.ts to use a try...finally block, ensuring resumeInputBlocker is called on all execution paths. New test cases have been added to mcpToolWrapper.test.ts to verify this behavior, including handling of fatal errors and double-fault scenarios where the resume action also fails. The changes appear correct and address the described issue.
|
/assign |
Refactor McpToolInvocation.execute() to use try...finally so that resumeInputBlocker() is always called when the input blocker was suspended, regardless of whether the tool succeeds or throws a fatal Chrome connection error. Previously, the "Could not connect to Chrome" error path re-threw before resumeInputBlocker() could run, leaving the overlay permanently stuck with pointer-events: none. Also adds two test cases covering the fatal error path: - Chrome fatal error still resumes the input blocker - Chrome fatal error + resume failure (double fault) propagates the original error without masking Fixes google-gemini#22159
b6b44b2 to
26560be
Compare
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
Fixes #22159
The
McpToolInvocation.execute()method inmcpToolWrapper.tshad a bug whereresumeInputBlocker()was never called when a fatal Chrome connection error ("Could not connect to Chrome") was thrown mid-execution of an interactive tool (click,fill,hover, etc.). This left the input blocker overlay permanently suspended (pointer-events: none), causing the tab to appear controlled but not actually blocking user input.Changes
mcpToolWrapper.ts: Refactored theexecute()method to usetry...finally.suspendInputBlocker()is called before thetryblock (resource acquisition), andresumeInputBlocker()is called in thefinallyblock with.catch(() => {})to ensure cleanup on all code paths — success, non-fatal error, and fatal Chrome disconnection. This replaces the previous two separate resume call sites with a single one infinally.mcpToolWrapper.test.ts: Added two new test cases:finally.catch(() => {})Test plan
npm run preflight(CI will validate)