Closed bug report

apply reads the served URL's port as 127 (the host's first octet), so every running app becomes a 'not available' placeholder

John Lauer · 1mo ago ·closed by Colby Knox

Seen on arav-rog (Hydrogen Desktop 1.0.413) with adom-cli 0.7.4 on 2026-09-14 and again with 0.7.6 on 2026-09-15, applying kcknox/ztest-bench-kicad and adom/drone-layout-dc-00.

Every app tab lands as a " (not available)" placeholder with the reason server at http://127.0.0.1:127/ stopped answering right after start, while the app is running and answering on the port it printed.

Evidence:

  • ~/.adom/launch-logs/adom-adom-lbr-1789476675.log ends with http://127.0.0.1:8785/; curl http://127.0.0.1:8785/ answers 200 at the time the placeholder is written.
  • ~/.adom/launch-logs/adom-mjpeg-stream-viewer-1789420399.log ends with http://127.0.0.1:43177/; the apply reported the same http://127.0.0.1:127/ reason.
  • ~/.adom/launches.json from the 2026-09-14 run keyed the mjpeg launch under "127" with "url": "http://127.0.0.1:43177/", so the port is read from the first digits after http:// (the 127 of 127.0.0.1) instead of after the colon.
  • The KiCad dashboard in the same bench has a separate, real reason (cannot serve on port 8931: Address already in use, a collision with a Hydrogen widget that Hydrogen is moving), so ignore that one.

Consequence: benches apply as layouts only; no app tab ever fills on Hydrogen Desktop, and Hydrogen Cloud will see the same since both call this apply.

Two smaller things from the same runs:

  • Placeholder displayNames carry the (not available) suffix; the 0.7.3 note said the file's exact displayName with no suffix. If launch-failure placeholders are meant to differ from bridge-state placeholders, say which gets the suffix.
  • After a teardown, the summary says kept (another bench uses them): adom/kicad-bridge (not in the launch registry), adom/adom-lbr (not in the launch registry) with _applied empty, so "another bench uses them" is reading stale state.

Repro: apply any bench with one app tab whose app prints http://127.0.0.1:<port>/ on start; the tab becomes a placeholder naming port 127.

2 Replies

Colby Knox · 1mo ago

Fixed in adom-cli 0.7.7 (GH v0.7.7, wiki package 4.3.7). Thank you for the launches.json clue; it pointed straight at the parser.

Root cause: local_port_of consulted $VSCODE_PROXY_URI FIRST and took the digits right after the template's prefix. On a cloud container the template is https://<host>.adom.cloud/proxy/{{port}}/, whose prefix never matches a loopback URL, so the fallback host:port parse ran and everything worked; on Hydrogen Desktop the template's prefix is a bare scheme, so http://127.0.0.1:8785/ stripped to 127.0.0.1:8785/, "127" became the port, the re-probe hit port 127, and every running app was written up as "stopped answering". Now loopback URLs (localhost, 127.0.0.1, 0.0.0.0, [::1]) are parsed host:port first; the template applies only to non-loopback URLs, never with a hostless prefix, and only when the digits end exactly where the template's suffix begins. Unit-tested against a bare-scheme template, a localhost:{{port}} template, the container proxy shape, and an over-run boundary. Re-verified live on gallia (registry keyed by the real ports, tabs filled, teardown clean).

On the two smaller points:

  • Placeholder suffixes are deliberate and mean different things: a tab the CLI creates for an app it could not bring up is <name> (not available) (it points at the app's wiki page and names the reason in the apply output); Hydrogen Cloud's own skeleton placeholders are <name> (not started) or the bare name with panelState.placeholder. Apply matches HC's forms and replaces them with the clean bench name (0.7.3), and if an app is unavailable it keeps HC's placeholder rather than adding its own. So the suffix you saw on Desktop was the launch-failure form, which in this case was itself the port-127 bug.
  • The kept (another bench uses them): caption is the Desktop's, not the CLI's: kept[] entries each carry their own reason inline (yours read "(not in the launch registry)", which was accurate). 0.7.7 adds kept_reasons beside it, [{app|tab, reason: not_registered | used_by_other_bench | removal_failed}], so the Desktop can label each entry by its reason rather than one caption for all.

The KiCad 8931 collision is, as you say, a separate thing.

John Lauer · 1mo ago

Thanks Colby, that matches what we saw: every placeholder carried "server at http://127.0.0.1:127/ stopped answering right after start" while the apps were up on their real ports. Hydrogen 1.0.418 (shipped today) fills those tabs in itself in the meantime: after apply it reads each placeholder app's newest ~/.adom/launch-logs/--*.log for the last http://127.0.0.1:/ line, probes it, and re-points the tab in place with the bench name kept. On winvm with adom-cli 0.7.6 the three KiCad-bench placeholders became live tabs 12 s after apply. Once the workspaces pick up 0.7.7 the heal simply has nothing to do. Closed is right.

Log in to reply.