Public: anyone can read this; the crew can change it.
A game command whose answer never comes says so #17661
Merged 12h 13m ago, live in production
Part of #17610. A command the box never answered said "sent to the box" for ever. Now it says "No answer came back; it may have run." after two minutes (two hours for a long job).
-
Reviews
Changes requested — before the latest pushThe words, the TUI line, the docs and the test are right, and a late answer replacing the words is a good choice. One thing breaks the case the issue is about.
FIX FIRST: a person watching the console or shell page is never told live.
answersOfis only called fromonSync(src/games/notify.ts), which fires when the box syncs. A command goes unanswered because the box is not syncing, so no sync arrives.commandOfturns the command into 'No answer came back' once 2 minutes pass, but the open page keeps showing 'sent to the box' until the box happens to sync, or until a reload. This affectsgameShellStreamandgameServiceStreamin src/web/pages/games.ts. The page is stuck on the same words as before the change, on exactly the case it was meant to fix. The terminal screen only re-reads on redraw, so it has the same gap.Fix: let each stream check on a timer as well as on sync. A slow interval of about 15 s, cleared when the stream closes, calling the same
answers()and emitting the samelinesevent, is enough. Add a test that opens the stream (or callsanswers()with an injectednow) with no sync after the deadline and expects the NO_ANSWER event. The current test callsanswers()by hand, so it would not catch this.answersOfwould need to takenow, because it callscommandOf(db, id)with the real clock.Smaller: with JavaScript off, the page shows the words only after a reload. That is fine, but the docs sentence should say 'on the next look' so it does not promise live.
ApprovedApproved. I could not retrieve my earlier round's comments from the API, so I judged the diff since b8046a6 and the pull as a whole.
The change does what the issue asks, on every door:
- A command handed out and unanswered now reads "No answer came back; it may have run." after 2 minutes for console, player and shell commands, and 2 hours for jobs.
- It is never re-sent, and a late answer replaces the words.
- The web page, the SSE stream and the TUI all use the shared
commandSays, so their wording cannot drift. - With JavaScript off, the page renders through
commandOf, so it shows the words on the next load. watchBoxlooks every 15 s and its timer ends with the stream. The test checks that the timer count returns to its starting value after the reader is cancelled.game-lookis now timed in job-slices through the real stream.- Tests cover the settled, unsent and late-answer cases, and both streams with no sync at all.
- docs/features/games.md carries the how-to, and README is untouched.
- Narrowing
onSyncto private leaves one way to watch a box.
Two things I would do next. Neither blocks this:
- Non-blocking:
answersOfcallsrecentCommandson every look. That is cheap at 15 s per open page, but if many pages open on one box, share one look per box. - Non-blocking: add a
reviewblock to the pull description with steps like go/games/<box>/<service>, look at a command with no answer, expect the "No answer came back" words with no JavaScript.
Look pages: the nearest page is the game service console (
src/web/pages/games.ts). -
Checks
shipped production is serving it deploy c4333e8
-
History
- job-slices times an open game page's look (#17610) 57da9e2
- Merge main into sold/game-answer 3dcac6a
- Merge pull request #17673 from sold/game-proxywrite 270c1f1
- The game agent's proxy console answers again, and an answered sync is not called failed (#17610) 2fccc33
- The memory line says what is held: RSS and its anonymous part, and the allocator's churn as a rate, never "committed 126 GiB" (#17667) 59691dc
- Adopting data from before the migration table parses each migration once, not once per earlier one (#17671) 85b9aa9
- Every transaction on a forge's connection takes the write lock first, with the busy retry (#17643) b9554e8
- scripts/boot-profile.ts: boot a copy of a forge's data under the CPU profiler and say what held the thread (#17660) 05bf470
- The newest snapshot is read alone: the backup watch, drill, probe and standby parse one manifest, not fourteen (#17659) c10544f
- Game pages: an operator on a phone finds the five things they came for (#17664) 2d0f5f0
- The cost ledger's chain is walked in a worker: a boot no longer holds the loop 0.5-1 s for it (#17638) 7ce8163
- Merge pull request #17665 from sold/game-restore 07ec5c4
- An open page says no answer came for a box that stopped syncing too (#17610) f5fefb3
- A snapshot's files are cut off the serving thread: an unchanged hosted forge's stream pass holds the loop 0 ms, not 0.8 s (#17622) 574b021
- Merge main into sold/game-restore dffb002
- A game box's snapshot comes back as a game box, not a forge on its worlds (#17625) 275aa3a
- A machine says what it boots: a forge, a game box or services (#17662) f1cc743
- A search that finds nothing is sent to the crew on Enter (#17648) bd828f9
- A pull that lands while its check runs keeps the check, and a red it ends with is main's, said on the home's first line (#17632) f270a47
- Merge pull request #17649 from sold/game-token 6e291aa
<!-- look-pages b8046a6a0cea --> Look pages for b8046a6, from the gate:
look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Part of #17610. A command the box never answered said "sent to the box" for ever. Now it says "No answer came back; it may have run." after two minutes (two hours for a long job). It is not sent again, since running one twice is worse, and a late answer replaces the words. The page, its live stream and the terminal use one wording.
No agent change. This is the part of #17626 that #17612 did not already do.
Tests (the builder's): 11 files pass singly, tsc and the gate clean. Not run: the full suite.
No door: the same commands; only their words change. Try: on a game server's page, a command the box never answered says so after two minutes.
🤖 Generated with Claude Code