skill
adom-cli
Public Made by Adomby adom
Adom CLI — platform binary for containers, repos, workspaces, orgs, SSH keys, Hydrogen settings, and more
Remote request storms when an AI calls adom-cli in a loop (409 reconnect probe, uncached container lookup, login poll with no deadline)
Colby caught Hydrogen Desktop hitting carbon.adom.inc/user about 4 times a second per installing machine (fixed in ah 1.0.571). We then audited every Adom client for the same class of bug. adom-cli has no constant polling, but three paths turn an AI calling the CLI in a loop into a request storm against our own servers. Audited origin/main at 33187a9 (v0.7.11); line numbers are from that commit.
1. High: "no browser session" reconnect probe, 300 ms, re-armed on every call
- Where:
src/commands/hydrogen/browser_probe.rs:106-127(wait_for_browser,RECONNECT_WAIT_MS=5000,RECONNECT_POLL_MS=300). Called frompatch_checked/post_checked/delete_checked/delete_body_checked(browser_probe.rs:186/204/221/239),notify.rs:85,reload.rs:26,screenshot.rs:102,webview.rs:536, and every workspace mutation inworkspace.rs:232-321. - Endpoint:
GET {hydrogen}/api/workspaces/editor/{owner}/{repo}/current/probe(hydrogen.adom.inc on cloud). - When: any mutation answered 409 "no browser session" (the Hydrogen tab is closed, backgrounded, or a zombie).
- Cost: about 18 requests per failing call (context lookup, the op, about 16 probes, a retry). Nothing is remembered between calls, and the hint tells the AI to retry once connected, so an agent retrying back to back makes about 3 requests a second (about 12,000 an hour). Several agents stack.
- Fix: probe 2 or 3 times about 1 s apart with backoff, and write a short-lived marker (for example
~/.cache/adom-cli/ui-down, 30 s) so the next calls fail fast without probing.
2. Medium-high: uncached Carbon container lookup on every call
- Where:
src/context.rs:16-54(ContainerContext::detect,client.getat line 54). It runs first in 14hydrogensubcommands, incarbon repos ...(repos.rs:266-405) and incontainers.rs:264when--owner/--repois omitted. - Endpoint:
GET carbon.adom.inc/containers/{slug}(or/containers/current). - Cost: one Carbon request per CLI call, for an answer that never changes in a container's lifetime. An AI making 10 calls a second sends 36,000 Carbon requests an hour from this alone.
- Fix: cache the result on disk keyed by slug, or derive owner/repo from the hostname the way
main.rs:92-117(derive_repo_url) already does.
3. Medium: adom-cli login poll has no deadline and swallows errors
- Where:
src/commands/login.rs:81-108. - Endpoint:
GET {carbon}/auth/intents/{token}/statusevery 2 s. - Problem: network and parse errors
continue(lines 85-91), and a response with nostatecounts as pending (line 93), so a deleted intent or a changed response shape loops forever. An AI that startsloginin the background and never approves it leaves a process polling at 1,800 requests an hour, indefinitely. - Fix: a hard deadline (about 10 minutes), stop on any 4xx or unknown state, back off on errors. Also set a request timeout on
AdomClient(client/mod.rs:20) and the login client (login.rs:12).
Lower
hydrogen workspace apply/teardown: each run calls the wiki per app (wsfile.rs:750dock manifest,wsfile.rs:792adom-wiki pkg installeven when already installed,wsfile.rs:2210again on teardown,wsfile.rs:35panels catalog). Skippkg installwhen the installed version matches, and cache dock manifests briefly.webview.rs:255-272:GET /api/webview-originson every workspace-URL open. Cloud and macOS Hydrogen don't serve it, so it fails every time and is never cached. Cache the negative answer per base URL.enforce_headers(wsfile.rs:1151-1192): 8 rounds, 400 ms apart. Bounded, but no backoff.
Already fine
- notify does not retry a 429; it surfaces
retryAfterSec. - The 504 diagnosis probes once.
containers list --allis capped at 100 pages.- There is no startup
/usercall, no version check and no telemetry.
Items 1 to 3 cover essentially all of the risk.