Skip to content

[BUG] Input blocker not restored when Chrome fatal error occurs in browser agent #22159

@Rithvickkr

Description

@Rithvickkr

Description

In McpToolInvocation.execute(), when a fatal Chrome connection error is thrown, the code re-throws immediately without calling resumeInputBlocker(). This leaves the browser agent's input blocker permanently suspended if the fatal error occurs mid-execution on an interactive tool (click, fill, etc.).

Steps to Reproduce

  1. Start a browser agent session with an interactive tool (e.g., click, fill)
  2. Trigger a Chrome connection failure mid-execution (e.g., Chrome process crashes or is killed)
  3. Observe that the input blocker remains suspended and is never restored

Expected Behavior

resumeInputBlocker() should always be called when needsBlockerSuspend is true, regardless of whether the error is fatal or not.

Actual Behavior

The fatal error path (Could not connect to Chrome) re-throws before resumeInputBlocker() is called, leaving the input blocker permanently suspended.

Code Reference

https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/agents/browser/mcpToolWrapper.ts#L159-L164

// Fatal path — re-throws before resumeInputBlocker is called
if (errorMsg.includes('Could not connect to Chrome')) {
  throw error; // ← input blocker is NEVER restored
}
// Only the non-fatal path restores it
if (this.needsBlockerSuspend) {
  await resumeInputBlocker(this.browserManager).catch(() => {});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions