Commit da8b535
committed
docs(browser): document the screenshot auto-attach escape hatch
`browser_execute` attaches every `Page.captureScreenshot` result to the next
assistant turn, which is the right default — it saves a `read` call almost
every time. But there was no way to capture pixels the agent does not need to
look at: bulk capture, or an artifact that only gets written to disk. A bulk
task attaches every frame to context with no opt-out.
The tap subscribes to `onCallResult`, which fires only from `_call`'s resolve
path — the command-response channel. CDP events route through a separate
listener list, so pixels delivered as `Page.screencastFrame` are structurally
invisible to it. That makes the escape hatch real CDP rather than an invented
parameter, so what the agent learns transfers to any client.
Verified against Chrome 150.0.7871.187 (--headless=new):
- static, already-loaded, idle page: startScreencast delivers a frame in 7ms
with no navigation, scroll, or re-layout nudge
- screencast frames produce zero attachments; captureScreenshot still attaches
- setDeviceMetricsOverride({ width: 1200, height: 630 }) yields a PNG whose
header reads exactly 1200x630
Two protocol details found while testing that are deliberately left out of the
skill text, recorded here instead:
- ack is not needed for navigation-paced capture (3 navigations produced 3
frames unacked). It is required for continuous capture: on an animating
page, 3s yielded 3 frames unacked vs 178 acked, so Chrome stalls after a
couple of unacked frames.
- `sessionId` on the frame event is not a frame counter despite the protocol
describing it as "Frame number" — it is constant within a cast and
increments per startScreencast.1 parent bf190ce commit da8b535
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
152 | 167 | | |
153 | 168 | | |
154 | 169 | | |
| |||
0 commit comments