You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text-only preview snapshots capture and encode a full-frame PNG that is then discarded #24174
preview_snapshot captures a full-frame screenshot on every call, even when the caller asked for neither the inline image nor a saved file. Agents snapshot before nearly every browser interaction, almost always text-only, so this cost is paid constantly.
Diagnosis
The MCP handler strips includeImage/save before invoking the snapshot operation, so ServerBrowserPage.capture always runs Page.captureScreenshot + PNG encode, the base64 travels through the broker, and McpHttpServer base64-decodes it before dropping the bytes.
Note this changes one visible behavior: when no screenshot is captured, the result's screenshot field (and its dimensions) would be null instead of carrying dimensions of a discarded image; preview_status still reports viewport sizes. Adjacent: #21494 (text-only snapshots hanging on hidden tabs) — skipping the capture also removes that capture from text-only calls, but this does not fix hidden-tab captures when a screenshot is requested.
Steps to reproduce
Open a preview tab and call preview_snapshot with no includeImage and no save.
Count Page.captureScreenshot CDP calls (real Chromium, ServerBrowserPage.test.ts): one per text-only snapshot, though the resulting bytes are dropped.
No wall-time figure is claimed; the cost is one full-frame capture and encode per snapshot.
Linux 7.2.9 (WSL2), Node 26.12.1, Chromium via the server browser
Evidence
Page.captureScreenshot calls per text-only preview_snapshot: 1 before, 0 after (branch; 39/39 preview tests pass)
Related issues
#21494 (text-only snapshots hanging on hidden tabs): adjacent, not the same defect
Fix applied or workaround
None applied. I can open a pull request for this once triage confirms the direction. A measured branch exists (perf/preview-snapshot-skip-screenshot on my fork, fork review PR bompus#17): thread includeScreenshot (includeImage || save) through the snapshot operation, skip captureViewport when false, and make the contract's screenshot field nullable; hosts that ignore the new input field keep returning a screenshot.
Filed by
Muse Wonder Full 1.0 (Muse Code) investigated and measured; Claude Sonnet 5.5 (Claude Code) filed it, via T3 Code
Closing as a duplicate of #21494, which already makes the screenshot optional and skips Page.captureScreenshot for text-only snapshots. I should have found that PR before filing. My count (one Page.captureScreenshot per text-only snapshot) matches its diagnosis, so there's nothing to add here.
Activity
bompus commentedon Oct 23, 2026
Closing as a duplicate of #21494, which already makes the screenshot optional and skips
Page.captureScreenshotfor text-only snapshots. I should have found that PR before filing. My count (onePage.captureScreenshotper text-only snapshot) matches its diagnosis, so there's nothing to add here.