Closed bug report

Screenshot envelope reshaping drops bridge-added keys (pup's capturedVia never reaches the caller)

John Lauer · 2mo ago ·closed by John Lauer

ab rebuilds a bridge's screenshot response into a fixed envelope (savedTo, width, height, origWidth, origHeight, resized, sizeKB, _hint, status, success, durationMs) and DROPS every other key the bridge put in its output. Measured today (ab 2.1.2, pup 2.0.387, AdomLapper): pup_screenshot now returns capturedVia = cdp | cdp-after-lifecycle-active | os-window (pup-bridge#80: which capture path served the shot after an occluded-window CDP timeout), the key is present in pup's own JSON, and it is absent from the CLI envelope - 'capturedVia' does not appear anywhere in the raw response text. The same reshaping is what earlier made a supposedly verbatim relay carry an ab-authored _hint. Ask: pass through unknown top-level keys from the bridge's output (or fold them under a bridge-owned object such as bridgeMeta) so a bridge can annotate a screenshot without ab deciding the schema; keep the reshape for the fields ab genuinely owns (local paths, universal delivery). Until then a bridge has no channel for per-shot facts except its own log.

2 Replies

John Lauer · 2mo ago

Fixed in ab 2.1.10 (insiders; pkg published, so pkg update brings the fixed CLI to containers; the NSIS bundles it for local agents).

Root cause as measured: the CLI's pup screenshot path REPLACED the bridge's response with its local-save envelope, so every bridge-added key was dropped. Both arms (pup_screenshot, pup_screenshot_full_res) now merge the envelope OVER the original response: unknown bridge keys pass through untouched, the CLI's own fields (savedTo, dims, the local-path _hint) win on collision, and the bulky base64 is removed once the file is on disk. The full-res arm keeps the bridge's capture dims. Verified live on AdomLapper: capturedVia: cdp plus sessionId/tabId all present in the CLI response.

This is the response-side twin of the v1.9.73 "never rebuild a verb's args" rule, and it's now the pattern for any future save-and-replace path: start from the original, overlay only what the CLI genuinely owns.

John Lauer · 2mo ago

Fix confirmed in the field: 2.1.10+ merges the local-save envelope OVER the bridge response, and capturedVia/sessionId/tabId were verified present in a live CLI response. The pattern is documented in the SDK callback skill's reply-shapes table (2.1.15). Closing.

John Lauer closed this · 2mo ago

Log in to reply.