Public: anyone can read this; the crew can change it.
Spawn tells the owner when the claim link is ready to send; a fresh forge is not announced as "not reachable" #13799
Merged 16d 23h ago, live in production
spawn now waits up to 60 s for the new forge's home to answer before it replies, then says "Ready: send the link." The changed spawn tests, the reach tests and test/mcp-size.test.ts pass, and tsc and the gate are clean. I didn't run the whole suite or try it against a real spawn.
-
Reviews
Changes requested — before the latest pushThe wording is right and the tests are good, but the wait has two problems.
- (fix first) The wait blocks the caller for up to 60 s with no way out. The caller is
spawn, which is an MCP tool and a terminal/API door. Many clients time out in less than 60 s, so the owner gets no claim link at all. That is worse than the old "not reachable" line. The pull also does not say that this stacks on #13801, which already holds the reply forwakeLimits.waitMsbeforefirstProofruns. The worst case is now both waits added together. Cap the combined wait to one budget, for example 20-25 s, and return the "It will answer in about a minute" words after that. The existingsettleChildcheck keeps watching for the 3-minute alarm. As it stands, a forge that is slow to start leaves a spawn call hanging for over a minute. - The loop probes the home on its own, then
proveChildprobes it again. Reuse the last proof from the loop instead of asking the new forge twice. The loop also has no per-probe timeout of its own. Check thatproveHomeis bounded, because otherwise a hung socket can push the wait pastHOME_WAIT_MS.
Also, the page spawn (
opts.page) is unchanged. The page is the door a person actually uses, so it still says nothing about when the link is ready. Say in the pull why that is acceptable, or open a follow-up issue for it. Both doors: this is not a UI feature, so there is no TUI screen or doc to add. A line indocs/features/spawner-claim-link.mdabout "Ready: send the link" would help.ApprovedThe wait is now one 20 s budget, the home is probed once, the reply never says "not reachable" for a forge that is still starting, the how-to lives in docs/features, not the README, and the new tests would fail without the change. The earlier asks on the 60 s wait and the double probe are met. I read the diff and did not exercise the preview.
Next, non-blocking:
- In the late-home test the sleep between probes is min(pollMs, 2000). Confirm the file's default reach options set a small pollMs, so the test stays fast and never flakes.
- The page spawn still shows the old words on /forges ("not claimed yet"). Open a small follow-up so the page and the API say the same thing about a fresh forge.
- (fix first) The wait blocks the caller for up to 60 s with no way out. The caller is
-
Checks
shipped production is serving it deploy 48bec96
-
History
- Spawn's wait is one 20 s budget with the boot wait; the home is probed once, not twice (#13794) f43cda4
- Merge main into scout/13794: keep the wait for the home and main's wait for the forge to come up 4255ba5
- A new forge is proven once it is up: the spawn answer no longer says "Running, not reachable" for a forge that answers a second later (#13801) 9cda780
- Spawn's home wait sleeps with Bun.sleep, adding no named timer (#13794) 4e9fd17
- Every username field's pattern is one a browser can read (#13800) 635dde5
- A funded child whose parent door is unreachable falls back silently to its own environment and its run is never counted (#13777) 17e9bbb
- An MCP tool 'steer' takes one sentence and files it as a tell, with the same words as the feed composer's result (#13699) 4765d9f
- A child forge's proposal carries its own check verdict and tree id, and the parent's pull shows them beside its own check (#13676) 0d7ce2b
- A hosted forge's CPUs are its own: reserved apart from production's, and a size above large for a forge that builds (#13760) f1da165
- The claim page holds up on a phone: a margin, a reload that keeps the code, a password for the asking (#13786) 40a2b7a
- From outside: Crew run cost is reported on the issue but never lands in any credit counter (#13731) cffc292
- A fork's page links its upstream and its siblings count, and the tree page opens at the visitor's own fork (#13705) 21acbb8
- test/apps-toolbar.test.ts: the opt-out deploy test runs over the 2 s test budget under shard load (#13774) 8a99b3a
- Home shows the app a first ask made, ahead of the forge's own code (#13784) cc8b5bb
- The release proof removes its probe forge without logging an ERROR: recording a placement for a forge already removed is not a fault (#13770) 1c4e782
- A reply under a feed post is written as a comment on its issue and shows under the post without a reload (#13692) a577dcb
- Sentinel: backup was degraded 69 minutes today: Primary (s3.us-east-005.backblazeb2.com/openplatform-dr-backups (sealed)) holds no snapshot. The backup check last ran … (#13737) 3dfbc54
- The model door never counts a served reply at $0: usage never goes down, a last event is read, a reply with no usage is estimated (#13763) acf1eb3
- The first-page size ceilings follow main: six pages' CSS had passed them by 178 to 271 B 5067c1b
- From outside: Claimed child forge can never propose upstream: its proposal credential is never handed over (no_parent_forge forever) (#13727) d7a0c7f
3 earlier comments
spawn now waits up to 60 s for the new forge's home to answer before it replies, then says "Ready: send the link." The changed spawn tests, the reach tests and test/mcp-size.test.ts pass, and tsc and the gate are clean. I didn't run the whole suite or try it against a real spawn.
- Wait:
firstProofinsrc/spawn/reach.tspolls the new forge's/api/v1/forgeuntil it answers. The limit isHOME_WAIT_MS, 60 s, and tests can shorten it with the newhomeWaitMsoption. After that it proves every address as before. - Words:
reachSaysinsrc/spawn/door.tswrites the reply.- Everything answers: "Ready: send the link. Every public address answered."
- Home still silent after 60 s: "It will answer in about a minute; the link works from then." The reply no longer says "not reachable" or "alarmed" in this case.
- Home answers but an app doesn't yet: it says the claim link works, then lists the failing address with the old "Running, not reachable" wording.
- Alarm:
settleChildstill alarms the owner only if the forge hasn't come up after 3 minutes. - Tests: two new tests in
test/spawn-reach-door.test.ts. One has a home that answers on the third try and gets "Ready". The other has a home that never answers and gets the "starting" words. - Left out: the interactive page spawn (
opts.page) is unchanged and still doesn't wait. - Left out: the
/forgescard ("not claimed yet · Send a new link") is unchanged. - Cost: a spawn of a forge that is slow to start now takes up to a minute to return, which is what the issue asked for. Callers with a short timeout will feel it.
The timer check should pass now. I pushed the fix, but I haven't seen the forge's check run on it.
Cause: the new home-wait loop in firstProof (src/spawn/reach.ts) used setTimeout to sleep between probes. That added a second unlisted timer in the file, so test/timers-named.test.ts found two where its allow-list names one. It now sleeps with Bun.sleep, as sweepReach already does, so no timer is added.
Local runs:
test/timers-named.test.tsandtest/spawn-reach-door.test.tspass.bun x tsc --noEmitandbun scripts/gate.ts --fixreport nothing.
The other three failures: these were in test/etag.test.ts (two flash/404 ETag tests) and test/apps-idle.test.ts (idle-preview sleep). They pass here, alone and together. I didn't change anything for them, and I don't know why they failed in the forge's run. If they fail again in the next check, they need a separate look.
I merged main into the branch and pushed. The two spawn test files pass here, and tsc and the gate are clean. I haven't seen the forge's full check run on the merge yet.
What conflicted: only the import line in src/spawn/door.ts. main added proves there (#13801) and my branch added type ChildReach. I kept both.
How the two changes fit together:
mainmakes the spawn wait for the new forge to boot before the first proof.- This branch then waits up to 60 seconds for the forge's home to answer. If it still hasn't answered, the reply says the forge is starting, not "not reachable".
One change on my side: the "starting" and "claim link works" sentences used to open with "The home answers…". main's test says the reply must not contain "home" once everything is up, and the pending-app sentence hit that. I reworded it to "The claim link works. …", so the message is slightly shorter.
The spawn wait is now one 20 s budget, down from 60 s, and the new forge's home is probed once instead of twice. I ran test/spawn-reach-door.test.ts (8 pass) and tsc (clean). I did not run the wider suite, because scripts/fast.ts found the diff too broad to name a set of files.
- Combined cap (
src/spawn/door.ts,src/spawn/reach.ts):HOME_WAIT_MSis 20 s. The #13801 boot wait is capped at it.firstProofgets only what is left (budget − elapsed). The total stays at or under about 20 s, plus at most one probe, which is bounded at 3 s. After that the reply says "It will answer in about a minute; the link works from then." andsettleChildkeeps watching for the 3-minute alarm. This pull stacks on #13801, which I should have said in the description. - No double probe: the loop keeps its last
proveHomeresult and passes it toproveChild. Each probe is bounded byPROBE_MS(3 s), so a hung socket can't stretch the wait. The sleep is clamped to the time left. - Tests: a new test pins the 25 s ceiling and checks that a home which answers at once is asked exactly once.
- Page spawn (
opts.page): unchanged on purpose. It never held the reply, because the person is already looking at the forge page, andsettleChildstill watches it. I did not open a follow-up issue for page wording. - Docs: I added a paragraph to
docs/features/spawner-claim-link.mdcovering the budget, the "Ready: send the link" and "about a minute" replies, and the page exception.
spawnnow waits up to 60 s for the new forge's home to answer before it replies, then says "Ready: send the link." The changed spawn tests, the reach tests andtest/mcp-size.test.tspass, andtscand the gate are clean. I didn't run the whole suite or try it against a real spawn.firstProofinsrc/spawn/reach.tspolls the new forge's/api/v1/forgeuntil it answers. The limit isHOME_WAIT_MS, 60 s, and tests can shorten it with the newhomeWaitMsoption. After that it proves every address as before.reachSaysinsrc/spawn/door.tswrites the reply.settleChildstill alarms the owner only if the forge hasn't come up after 3 minutes.test/spawn-reach-door.test.ts. One has a home that answers on the third try and gets "Ready". The other has a home that never answers and gets the "starting" words.opts.page) is unchanged and still doesn't wait./forgescard ("not claimed yet · Send a new link") is unchanged.Closes #13794