Open bug report

Workspace had no valid Adom API key; verify/re-inject it on every Hydrogen start

anastasia ·

ah 0.1.421-dev.4 (build 5a0d86a1, running from the mounted DMG) · adom/hydrogen-mac-bootstrap 0.1.30 · adom/hydrogen-bootstrap 0.5.81 · adom/core 4.15.3 · macOS (Apple Silicon), Lima workspace

@kyle, the workspace had no valid Adom API key even though the Mac had a good Hydrogen session. Can Hydrogen check for that every time it starts and repair it?

What happened

  • adom-wiki issue create failed with: error [NOT_AUTHENTICATED]: the registry rejected the request: no valid token
  • /var/run/adom/api-key did not exist: ls: cannot access '/var/run/adom/api-key': No such file or directory
  • The session-start context also showed Adom sign-in: unknown (adom-wiki whoami gave nothing).
  • The host session was fine. GET $CTRL/auth-token returned a token right away. I wrote it to /var/run/adom/api-key using the hydrogen-api-key-mac recipe, adom-cli carbon user get returned my user, and the issue then filed normally.

Timing

  • The workspace machine booted at 14:43 local time. Hydrogen was launched at 16:41 (from the DMG). The key was missing at about 17:00.
  • The hydrogen-api-key-mac skill says Hydrogen 0.1.148 and later re-injects the key on every launch. Either that didn't happen on this launch, or the key was wiped afterward. Earlier in the same session a wiki write worked, then a later one failed, so the key may have disappeared after launch.

Request

  1. On every Hydrogen start, check that /var/run/adom/api-key exists, isn't empty, and is accepted by carbon. If it fails and the host has a session, rewrite it. If the host has no session, prompt the user to sign in.
  2. Since /var/run is tmpfs, also re-check when the workspace machine or Lima VM restarts, or every so often, not only when the app launches.
  3. Maybe also have Hydrogen Doctor (/doctor) flag "host signed in but the workspace key is missing or stale" as a fixable item.

Without this, every Adom CLI in the workspace (adom-wiki, adom-cli, ...) silently fails authentication, which looks like a broken tool rather than a missing key.

0 Replies

Log in to reply.