#2147

Bug: compact snapshots drop visible status/StaticText with interactive:false (0.36.0)

Openrezzminatoropened 12d ago

Summary

In agent-browser 0.36.0, agent_browser_snapshot with compact:true and explicit interactive:false drops visible, nonempty status text. The same page with compact:false, interactive:false retains it.

Reproduced in 3/3 fresh browser sessions against a synthetic loopback page through agent-browser mcp --tools all. Both snapshot calls succeed; the compact result silently loses content.

Reproduction

Serve an HTML page containing:

<h1>Synthetic audit fixture</h1>
<p id="status" role="status" aria-live="polite">Saved successfully</p>
<p id="plain">Visible plaintext status: saved successfully</p>
<button id="target" type="button">Target</button>
<p id="click-status">not clicked</p>

Open it with agent_browser_open, using a fresh session, then call agent_browser_snapshot twice on that same session:

{"session":"compact-repro","interactive":false,"compact":false}
{"session":"compact-repro","interactive":false,"compact":true}

Relevant observed output with compact:false:

- heading "Synthetic audit fixture" [level=1, ref=e1]
- status
  - StaticText "Saved successfully"
- paragraph
  - StaticText "Visible plaintext status: saved successfully"
- button "Target" [ref=e2]
- paragraph
  - StaticText "not clicked"

Observed output with compact:true:

- heading "Synthetic audit fixture" [level=1, ref=e1]
- paragraph
  - StaticText "Visible plaintext status: saved successfully"
- button "Target" [ref=e2]

Expected behavior

The MCP schema describes compact as removing empty structural elements. Nonempty status/plain text and its necessary ancestors should survive when interactive:false. Content retention should not depend on punctuation in the text.

Source diagnosis

Source inspected at v0.36.0, commit eb05921bad874cd2a1b4fa5d1149f1ed26576cae:

This is separate from MCP's default interactive:true: the failing comparison explicitly disables interactive filtering in both calls.

Impact and workaround

An agent can mistake omitted confirmation/status text for an absent UI result. Using interactive:false, compact:false preserves the evidence in this reproduction.

Suggested regression coverage: a nonempty status/StaticText subtree, text with and without colon-space, and an empty structural container that should still be removed.

Tested installed version: 0.36.0 on Linux, Chrome engine. Not tested against upstream HEAD; no patch applied.

Activity

0

No activity yet.