Adom Hydrogen (Linux)
Public Made by Adomby adom
The Linux platform layer for Adom Hydrogen: Ubuntu, Debian and Fedora, the workspace and the computer.
d8a45ab
name: hydrogen-wake-repair description: >- What Hydrogen on Linux does when the editor loses its connection (after sleep or otherwise): no wake heal cascade, but a watcher that clears VS Code's Cannot reconnect dialog and the backend banner. Use when Hydrogen didn't reconnect after sleep, a cannot reconnect dialog appears, or asked about /wake/status, the wake indicator or Run Wake Check.
Hydrogen Wake Repair (Linux)
On Linux there is no wake detector and no wake heal cascade. The Wake settings, the header wake indicator and the Adom menu's "Run Wake Check" are not shown. The workspace machine runs on the host kernel, so sleep and resume do not leave it in a separate state to repair; what can still go wrong is the editor's connection.
What does run
Cannot reconnect watcher (hydrogen-app/src/linux_reconnect_watch.rs).
Every 15 s it looks for VS Code's final "Cannot reconnect. Please reload the
window." dialog (never "Attempting to reconnect", which is VS Code still
trying). After two sightings, and only if code-server is serving
(/workspace/health says editor_will_load), it reloads the editor pane only,
at most once per 45 s. After three reloads in a row that did not clear it, it
backs off for 10 minutes and logs restart Hydrogen. It never acts while setup
runs or after the user stopped the workspace. Log lines start with
[reconnect-watch] in ~/.config/hydrogen-desktop/hydrogen-desktop.log.
Backend banner. The VS Code panel reads /workspace/health every 8 s; two
misses of editor_will_load show a banner over the editor. Its Reconnect button
posts /container-start on Linux (there is no heal cascade): that makes sure the
machine runs, code-server is a systemd unit inside it that restarts itself, and
the banner clears once the editor serves again.
editor_will_load is honest: it is a real HTTP GET of code-server's
/healthz (success or redirect), not a bare TCP connect, because a wedged
code-server can still accept TCP while serving nothing.
Control API endpoints
On the Hydrogen control API (port from ~/.adom/hydrogen-control-url, see hydrogen-api):
GET /wake/statusanswers{"ok":true,"wake":null,"note":"no wake events this session"}.POST /wake/simulateandPOST /wake/previewanswerok:false(the wake watcher is not registered on Linux): there is nothing to run.
If the editor stays disconnected
curl -s $(cat ~/.adom/hydrogen-control-url)/workspace/healthand readeditor_will_load.- Machine stopped: Adom menu > Start Container, or
POST /container-start. - Machine running, code-server not serving: Adom menu > Restart Container.
- Watcher gave up: restart Hydrogen.
- Full diagnosis: the Doctor (
hydrogen-doctor).
---
name: hydrogen-wake-repair
description: >-
What Hydrogen on Linux does when the editor loses its connection (after sleep
or otherwise): no wake heal cascade, but a watcher that clears VS Code's
Cannot reconnect dialog and the backend banner. Use when Hydrogen didn't
reconnect after sleep, a cannot reconnect dialog appears, or asked about
/wake/status, the wake indicator or Run Wake Check.
---
# Hydrogen Wake Repair (Linux)
On Linux there is no wake detector and no wake heal cascade. The Wake settings,
the header wake indicator and the Adom menu's "Run Wake Check" are not shown.
The workspace machine runs on the host kernel, so sleep and resume do not leave
it in a separate state to repair; what can still go wrong is the editor's
connection.
## What does run
**Cannot reconnect watcher** (`hydrogen-app/src/linux_reconnect_watch.rs`).
Every 15 s it looks for VS Code's final "Cannot reconnect. Please reload the
window." dialog (never "Attempting to reconnect", which is VS Code still
trying). After two sightings, and only if code-server is serving
(`/workspace/health` says `editor_will_load`), it reloads the editor pane only,
at most once per 45 s. After three reloads in a row that did not clear it, it
backs off for 10 minutes and logs `restart Hydrogen`. It never acts while setup
runs or after the user stopped the workspace. Log lines start with
`[reconnect-watch]` in `~/.config/hydrogen-desktop/hydrogen-desktop.log`.
**Backend banner.** The VS Code panel reads `/workspace/health` every 8 s; two
misses of `editor_will_load` show a banner over the editor. Its Reconnect button
posts `/container-start` on Linux (there is no heal cascade): that makes sure the
machine runs, code-server is a systemd unit inside it that restarts itself, and
the banner clears once the editor serves again.
`editor_will_load` is honest: it is a real HTTP GET of code-server's
`/healthz` (success or redirect), not a bare TCP connect, because a wedged
code-server can still accept TCP while serving nothing.
## Control API endpoints
On the Hydrogen control API (port from `~/.adom/hydrogen-control-url`, see `hydrogen-api`):
- `GET /wake/status` answers `{"ok":true,"wake":null,"note":"no wake events this session"}`.
- `POST /wake/simulate` and `POST /wake/preview` answer `ok:false` (the wake
watcher is not registered on Linux): there is nothing to run.
## If the editor stays disconnected
1. `curl -s $(cat ~/.adom/hydrogen-control-url)/workspace/health` and read
`editor_will_load`.
2. Machine stopped: Adom menu > Start Container, or `POST /container-start`.
3. Machine running, code-server not serving: Adom menu > Restart Container.
4. Watcher gave up: restart Hydrogen.
5. Full diagnosis: the Doctor (`hydrogen-doctor`).