Skip to content

chrome-devtools_fill fails to clear existing input values and loses targeting focus in sequential calls #881

@luanweslley77

Description

@luanweslley77

Description of the bug

The chrome-devtools_fill tool exhibits inconsistent behavior when interacting with multiple form inputs in sequence. Specifically:

  1. Failure to Clear: It does not clear existing text in an before typing the new value. In environments like PHP where form fields persist after a failed submission (sticky forms), the new value is appended to the old one.
  2. Targeting/Focus Issue: In sequential calls (e.g., filling Email then Password), the tool occasionally directs the second input's value into the first input field, leading to data corruption (e.g., emailpassword inside the email field).

Reproduction

Steps to reproduce the behavior:

  1. Access a page with a form containing at least two inputs (Email and Password).
  2. Ensure the first input already has a value (e.g., "user@test.com").
  3. Call chrome-devtools_fill for the first input with a new value.
  4. Call chrome-devtools_fill for the second input with a different value.
  5. Observe that the first input now contains both its original value and the second input's value concatenated.

Expectation

  1. chrome-devtools_fill should strictly clear the target element's value before performing any input.
  2. The tool must ensure the target element (identified by UID) has focus and is the sole recipient of the value payload, regardless of previous tool calls in the same session.

MCP configuration

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"chrome-devtools": {
"type": "local",
"command": ["npx", "-y", "chrome-devtools-mcp@latest"]
}
}
}

Chrome DevTools MCP version

0.15.1

Chrome version

144.0.7559.109

Coding agent version

OpenCode 1.1.49

Model version

gemini-3-flash-preview

Chat log

No response

Node version

v22.22.0

Operating system

Linux

Extra checklist

  • I want to provide a PR to fix this bug

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions