Open bug report

adom-cli hydrogen screenshot panel: 'Screenshot captured but not saved: Failed to fetch' every time

John Lauer · 3d ago

Hydrogen 1.0.658 (Windows, the office PC), adom-cli in the workspace, 2026-10-19 all afternoon and evening.

adom-cli hydrogen screenshot panel --name "Capacitive Encoder" (a webview tab serving http://localhost:8890/) fails every time with:

error: Screenshot captured but not saved: Failed to fetch

It says the capture happened, then the save fails. An AI thread working in that Hydrogen could not look at its own dashboard all day, and fell back to reading the page's console log. It then started installing a headless browser just to see its own UI. The same message also showed up for the thread's earlier screenshot attempts after the 1.0.645 relaunch.

Expected: the screenshot saves (or the error names which fetch failed: the save endpoint, the workspace path, a port that moved after a relaunch). Related memory from another thread: panel screenshots fail with "Failed to fetch" after Hydrogen restarts onto new ports while the workspace still has the old ones.

2 Replies

John Lauer · 2d ago

Found it, fixed in d352ce93 (next build after 1.0.659).

The capture really did work every time. The save failed before it was even tried: to turn the screenshot into a file, Hydrogen ran fetch() on the image's data: URL, and Hydrogen's own content security policy refuses that. Its connect-src * looks wide open, but in CSP * only covers network addresses and never data: URLs. So every panel screenshot ended with "Screenshot captured but not saved: Failed to fetch", in every session, not just after a relaunch. (The orbital loader hit the same rule on 2026-10-19.)

  • The image is now decoded locally (src/lib/utils/dataUrl.ts), which needs no network permission. The Adom menu's screenshot upload had the same call and is fixed too.
  • If the save request itself ever fails, the error now names the URL it tried, instead of a bare "Failed to fetch".

Gate entry panel-screenshot-saves: adom-cli hydrogen screenshot panel --name <tab> answers a filePath and the PNG exists. I will close this when the build passes it.

John Lauer · 2d ago

Still happening on 2026-10-20 on the same PC, after the WSL container ran out of memory and restarted.

  • adom-cli hydrogen screenshot workspace --reason ... returns Screenshot captured but not saved: Failed to fetch.
  • A second route fails now too. The control API's POST /screenshot {"target":"8960/?view=rig","b64":true,"silent":true} returns {"ok":false,"error":"Page.captureScreenshot returned no data"}. The tab is visible and rendering at about 30 fps: I counted requestAnimationFrame calls through eval-in. The same call worked earlier the same day, before the restart.

With both routes down, an AI thread cannot look at its own webview, and falls back to sampling canvas pixels through eval-in.

Log in to reply.