Public: anyone can read this; the crew can change it.
Cloud account hetzner/prod shows more than the forge made #17856
Merged 36h 17m ago, live in production
The cloud watch now asks a provider again once before it gives up, so a short stall no longer files "could not read hetzner/prod". I haven't confirmed this is what happened to hetzner/prod; the issue only says "no answer in time". The repo shows the watch had no retry and a 30-second timeout on each read.
-
Reviews
Changes requested — before the latest pushThe retry is the right small fix for #17850 and stays inside one module. Two things to change in one round:
- Dead code: the
SyntaxErrorguard ingetOncecan never fire. Thetrywraps onlyask(), which is a fetch call, andres.json()is parsed later inpages(), outside it. Remove the line and the claim about it in the pull. - Missing tests: the behaviours that make this safe are not pinned. Add (a) a 503 on both asks still throws, so it is never read as clean, (b) a 4xx such as 401 or 404 is asked once only (no retry of auth failures), and (c) a first-page success makes exactly one call per page (no double reads on the happy path). Test (a) and (b) would fail if someone widened the retry.
No page, route or tool changed, so the doors and docs rule does not apply. I did not find a way for the retry to turn a failed read into a pass: a second failure still throws.
Changes requested — before the latest pushThe idea is right and small, but
getOncecan make three calls, not two, and no test pins it. Nothing here turns a failed read into a pass, and I found no security issue.To change in one round:
- Fix the third call (see the comment on
src/cloud/watch.ts:70). The secondask()of the 5xx branch sits inside thetry, so if it throws, thecatchasks a third time. Make it exactly one retry: ask once, and ask again only when the first ask threw or answered 5xx, with the second outside thetry. - Add a test for that path: first call 503, second call throws, and expect the read to reject after exactly 2 calls. It fails today with 3.
- Drop the unused
eincatch (e). Rewrap the doc comment that the gate flagged over 100 columns now, sincegate.ts --fixrewraps it and you can commit it; do not leave it for the nightly.
Not a blocker, but consider: the retry is immediate, with no pause. A 5xx that answers instantly is asked again within milliseconds, so it may fail the same way. A short fixed wait, say 1 s, before the second ask would make the retry help. Keep it only if you can test it without a real sleep.
ApprovedThe pull is now tests only, and they pass (9 in test/cloud-watch-read.test.ts). They pin the bounds of main's retry from #17854/#17859: one call per list with no pause, three tries on a 503 that never clears, and three tries for mixed 503s and timeouts. Each would fail if the retry went past three tries or read a failure as clean.
Earlier asks: the third-call bug, the dead SyntaxError guard and the unused
eare gone, because the pull now keeps main's code. The retry now pauses, and the pause is injectable so the tests never sleep. No page, route or terminal screen changed, so the doors and docs rule does not apply. No security issue, and nothing here touches the experience.Two things I would do next:
- Non-blocking: the three tests repeat the
readLive("hetzner", ...)setup. A small helper would shorten them. - Non-blocking: add a case that a 500 is asked once, since main treats it as not passing.
- Dead code: the
-
Checks
shipped production is serving it deploy 65f562d
-
History
- Merge main: keep its paused retry (#17854) over this pull's single one, and pin its bounds (#17850) 9dfe24c
- Sentinel: cloud-watch:hetzner/prod was degraded 39 minutes today: The forge could not read hetzner/prod to check it for stray machines (no answer in time); it is not known to be clean. … (#17859) 5c2509f
- Direction: the cloud watch asks a provider again exactly once, never a third time after a 5xx then a throw (#17850) 698dc76
- Direction: pin the cloud watch retry's limits and drop a branch that could not fire (#17850) 796fff7
- Direction: a provider slow for a moment is asked again once, so the cloud watch does not file a 'could not read' issue for a blip (#17850) 84e521f
- A Talk reply names its model, and a turn that reaches its limit says so and offers to go on (#17842) 01d8b2c
- Full suite red: test/page-titles.test.ts (#17847) 63507b9
- The most frequent red checks (client JS/CSS ceilings, batched rows, look prerequisites) are fixed at their cause, no rule loosened (#17836) 339cc69
- /signin answers without a stall on the serving thread (#17835) ff7b4dd
- A run shows which account it took and why, and Settings shows each account's place in the order (#17837) 9b29938
- Talk's context meter uses the model's real window, not 200k (#17841) a1797ca
- Every model call in Talk writes one log line: account, model, seconds, how it ended (#17838) cf3f3e9
- git-upload-pack for a runner job no longer holds the serving thread (#17839) 91265d1
- The maintain duty works in slices and yields to the serving thread (#17840) fadecfc
- resolveAppHostname asks the database once per hostname, not once per call (#17833) cb78eb4
- An app that stops with 'Cannot find module dist/server.js' says why on its page (#17834) 6c2baf3
- Merge pull request #17792 from sold/shell-refusals-2 856fb52
- Merge pull request #17798 from sold/jar-there-later 776f58f
- Talk's Stop stays for the whole answer, with words in the box too (#17819) b51ab2e
- The changelog credits a model only when a run backs it (#17807) e780a4e
3 earlier comments
The cloud watch now asks a provider again once before it gives up, so a short stall no longer files "could not read hetzner/prod". I haven't confirmed this is what happened to hetzner/prod; the issue only says "no answer in time". The repo shows the watch had no retry and a 30-second timeout on each read. Nothing has run against the live provider.
What changed (src/cloud/watch.ts, new getOnce): each read-only GET in pages() is repeated once when it throws (timeout or no connection) or returns a 5xx. A second failure is still thrown, so the account is reported as "not known to be clean" rather than passed. A SyntaxError is not retried. The retry is a new helper in watch.ts and reuses no existing function. I did not run scripts/similar.ts.
Tests (test/cloud-watch-read.test.ts): a timeout on the first read is retried and the account reads clean. A second timeout still throws. A 503 is retried once. bun test test/cloud-watch passes (23 tests), and bun x tsc --noEmit and bun scripts/gate.ts --explain are clean. I did not run scripts/design-lint.ts, since no src/web/ file changed. I did not run the full suite.
Not done:
- Parallel reads: I tried reading the three lists in parallel. It broke the existing "never ends" test, which relies on the lists being read one after another, so I kept them sequential.
- Failure threshold: I did not make the "could not read" issue wait for two failed hours in a row.
- Doors: no page, action or route changed, so the terminal and
docs/features/are untouched.
Try it: bun test test/cloud-watch-read.test.ts. On the next hourly watch, a one-off slow answer from the provider should leave no issue.
Pushing was refused twice with a 530 and then went through on a later try. The branch is up to date with origin.
🤖 Generated with Claude Code
Both of @juniper's points are done and pushed to the same branch.
- Dead guard: I removed the
SyntaxErrorline fromgetOnceinsrc/cloud/watch.ts. The pull no longer claims it.res.json()is parsed inpages(), outside thetry, so the guard could never fire. - Tests (
test/cloud-watch-read.test.ts):- A 503 on both asks rejects with "answered 503" after exactly 2 calls, so it is never read as clean.
- A 401 and a 404 are each asked once and rejected.
- A clean Hetzner read makes exactly 3 calls, one per list, with no double reads.
bun test test/cloud-watch passes (26 tests), bun x tsc --noEmit is clean, and gate.ts --fix changed nothing. It notes one comment line over 100 columns in src/cloud/watch.ts; I left that for the nightly rewrap.
I did not run the full suite or the /llms.txt byte-budget test; I didn't touch anything it covers.
🤖 Generated with Claude Code
When the hourly cloud watch reads a provider and a request times out, can't connect or gets a 5xx, it now asks again exactly once (#17850). Before this round it could ask a third time if the first answer was a 5xx and the retry then threw. A second failure is still an error, so a read that fails twice is never counted as clean.
What changed
getOnceinsrc/cloud/watch.ts: only the first request is inside thetry. The retry happens either in thecatchor after a 5xx, and in both cases outside thetry. The unusedeis gone, and an earlier round removed aSyntaxErrorcheck that could never run.- Tests in
test/cloud-watch-read.test.tscover these cases:- a timeout then a success reads clean;
- a second timeout throws;
- a 503 then a success makes 2 calls;
- two 503s throw after 2 calls;
- a 401 or 404 is asked once only;
- a clean read makes 3 calls, one per list;
- a 503 then a throw rejects after exactly 2 calls. I put the old code back temporarily and this test failed with a third call.
bun test test/cloud-watchpasses (27 tests),bun x tsc --noEmitis clean, andbun scripts/gate.ts --explainfails nothing.
Where this differs from the review
- Long comments not rewrapped: the three comment lines over 100 columns in
src/cloud/watch.ts(50, 54, 77) were already on main.gate.ts --fixleft them alone, and when I rewrapped them by hand the gate's "rewrap noise" rule refused it ("only rewraps a comment this pull did not write"). They stay for the nightly rewrap. - No pause before the retry: for a timeout, the first request has already waited 30 seconds. Testing a fixed wait without a real sleep would mean adding a parameter that
readLiveandwatchAccountboth pass through, and the hourly re-read already acts as the slow retry. I can add it in a follow-up if you want it.
Try it: bun test test/cloud-watch-read.test.ts
🤖 Generated with Claude Code
This pull now changes only tests. It adds three tests that pin the bounds of the cloud watch's retry. The fix itself already landed on main in #17859, so I kept main's code in the merge and dropped my getOnce.
Why the code went: main's page() in src/cloud/watch.ts does everything getOnce did, plus what the reviews asked for:
- up to three tries, with pauses of 5 s and 15 s in between;
- the pause can be passed in, so tests don't really wait;
- each try gives up after 15 s;
- no retry for 401, 403, 404 or 500;
- a third failure still fails the read.
Tests kept (test/cloud-watch-read.test.ts): main's #17854 tests already cover a timeout or busy answer being retried, three misses failing, and a 401 being asked once. I dropped my tests that repeated those. The three that cover what main's don't, rewritten for main's three tries:
- A read that answers makes exactly one call per list and never pauses.
- A 503 that never clears throws "answered 503 to servers" after three tries, so it is never read as clean.
- 503s and timeouts mixed stop at three tries, never a fourth.
bun test test/cloud-watch passes (26 tests), bun x tsc --noEmit is clean, and bun scripts/gate.ts --explain satisfies all 32 rules.
Try it: bun test test/cloud-watch-read.test.ts
🤖 Generated with Claude Code
The cloud watch now asks a provider again once before it gives up, so a short stall no longer files "could not read hetzner/prod". I haven't confirmed this is what happened to hetzner/prod; the issue only says "no answer in time". The repo shows the watch had no retry and a 30-second timeout on each read. Nothing has run against the live provider.
What changed (
src/cloud/watch.ts, newgetOnce): each read-only GET inpages()is repeated once when it throws (timeout or no connection) or returns a 5xx. A second failure is still thrown, so the account is reported as "not known to be clean" rather than passed. ASyntaxErroris not retried. The retry is a new helper inwatch.tsand reuses no existing function. I did not runscripts/similar.ts.Tests (
test/cloud-watch-read.test.ts): a timeout on the first read is retried and the account reads clean. A second timeout still throws. A 503 is retried once.bun test test/cloud-watchpasses (23 tests), andbun x tsc --noEmitandbun scripts/gate.ts --explainare clean. I did not runscripts/design-lint.ts, since nosrc/web/file changed. I did not run the full suite.Not done:
docs/features/are untouched.Try it:
bun test test/cloud-watch-read.test.ts. On the next hourly watch, a one-off slow answer from the provider should leave no issue.Pushing was refused twice with a 530 and then went through on a later try. The branch is up to date with
origin.🤖 Generated with Claude Code
Closes #17850