Public: anyone can read this; the crew can change it.

Games: heal what is safe alone and say so: retry a stuck agent or a stuck wake, with a limit (#17610) #17621

opened this

Merged 20h 18m ago, live in production

Games now start a stuck server again on their own, at most twice a service, and say so on the box screen. tsc, the gate, the new tests and the neighbouring game and terminal tests pass. I did not run the full suite or look at the page by eye.

Notes

opened this

Games now start a stuck server again on their own, at most twice a service, and say so on the box screen. tsc, the gate, the new tests and the neighbouring game and terminal tests pass. I did not run the full suite or look at the page by eye.

What the forge does alone (src/games/heal.ts, run after each agent sync, only ever start):

  • Stuck wake: a player joined the proxy, is on no server, and the one sleeping server is still asleep 90 s later. The forge starts that server. Joins older than 15 minutes are ignored. With two servers asleep it doesn't guess; it does nothing.
  • Stuck agent job: a start the agent was handed and never answered in 5 minutes is closed as failed and started again.
  • Limit: two tries per service in six hours, two minutes apart. After the second, the forge says once that it gave up and the owner should start it by hand.

What it says: each try is a row in a new game_heal table (migration 20261202200000-game-heal, pinned). It shows on the owner's box screen on the page, on the terminal's box screen, and in a healed field on the games tool's list. A silent agent (no sync for 3 minutes) is also said, with the note that the forge can't restart it. Viewers see none of it, and the lines end by saying mods, settings, worlds and roles are never changed alone.

What I chose not to do:

  • Rebooting the agent's machine from the cloud: that is outside "safe alone".
  • Offered fixes as buttons: the lines name the fix in words; there is no action to click.
  • Several sleepers: a join doesn't name the server the player wants, so the forge doesn't pick one.
  • #17612's findings are not on this base. This pull stands alone and works from the proxy's join events, the network list and the command rows.

Reused: playerEvents, networkOf, proxyOf, queueCommand, servicesOf.

Tests: test/game-heal.test.ts builds the real records and checks the grace and the limit to the second. The terminal and MCP doors are covered in tui-games.test.ts and game-diag.test.ts.

To try: as a box owner, open /games/<box> and read the Box block, or call games list and read healed.

Gate flags: the gate wanted a new terminal screen, so I gave a No door: line: heal.ts feeds the existing Games screen and docs/features/games.md, both edited here. There is also a No look: line, since the Box block gains text only.

Closes #17618

6 earlier comments
commented

Games now start a stuck server again on their own, at most twice a service, and say so on the box screen. tsc, the gate, the new tests and the neighbouring game and terminal tests pass. I did not run the full suite or look at the page by eye.

What the forge does alone (src/games/heal.ts, run after each agent sync, only ever start):

  • Stuck wake: a player joined the proxy, is on no server, and the one sleeping server is still asleep 90 s later. The forge starts that server. Joins older than 15 minutes are ignored. With two servers asleep it doesn't guess; it does nothing.
  • Stuck agent job: a start the agent was handed and never answered in 5 minutes is closed as failed and started again.
  • Limit: two tries per service in six hours, two minutes apart. After the second, the forge says once that it gave up and the owner should start it by hand.

What it says: each try is a row in a new game_heal table (migration 20261202200000-game-heal, pinned). It shows on the owner's box screen on the page, on the terminal's box screen, and in a healed field on the games tool's list. A silent agent (no sync for 3 minutes) is also said, with the note that the forge can't restart it. Viewers see none of it, and the lines end by saying mods, settings, worlds and roles are never changed alone.

What I chose not to do:

  • Rebooting the agent's machine from the cloud: that is outside "safe alone".
  • Offered fixes as buttons: the lines name the fix in words; there is no action to click.
  • Several sleepers: a join doesn't name the server the player wants, so the forge doesn't pick one.
  • #17612's findings are not on this base. This pull stands alone and works from the proxy's join events, the network list and the command rows.

Reused: playerEvents, networkOf, proxyOf, queueCommand, servicesOf.

Tests: test/game-heal.test.ts builds the real records and checks the grace and the limit to the second. The terminal and MCP doors are covered in tui-games.test.ts and game-diag.test.ts.

To try: as a box owner, open /games/<box> and read the Box block, or call games list and read healed.

Gate flags: the gate wanted a new terminal screen, so I gave a No door: line: heal.ts feeds the existing Games screen and docs/features/games.md, both edited here. There is also a No look: line, since the Box block gains text only.

commented

<!-- look-pages ab1fe6501f7d --> Look pages for ab1fe65, 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
commented

I've pushed one new commit that clears the look-pages feedback. The refusal was my own mistake. I had written Looks: No look: … in the first commit, and the gate read it as a page name. The new commit has a plain No look: line (the Box block gains text only) and a Direction: line naming #17618. It changes no code.

I checked the other two refusals against this branch:

  • Dead code: test/unused-exports.test.ts passes. It only names four exports in other files that are no longer dead, none of them mine.
  • /llms.txt budget: test/llms-budget.test.ts and the other llms-* tests pass. This change adds no routes or tools, only a healed field in the games list.

The gate now passes except for a note about long comment lines, which the nightly rewrap handles.

The two refusals about tests building real input and the one about both doors need nothing further. The new tests build real records, and the doors are the edited Games screen and docs/features/games.md, as stated in the earlier No door: line.

commented

The games heal work is already pushed, and none of the four refusals you listed reproduce here. I changed nothing this turn, because the tree was clean and the branch matches origin.

  • Gate: bun scripts/gate.ts --explain passed all 32 rules, including "name the issue". Both commit subjects end in (#17618). The only note is the comment-width one on five files, which the gate says the nightly rewrap handles on main. --fix changed nothing.
  • Type check: bun x tsc --noEmit is clean. My tests build real records rather than using as never.
  • Dead code and /llms.txt budget: test/unused-exports.test.ts and test/llms-budget.test.ts pass. The unused-exports test prints a note that pinCrawlLag, setCrawlClock, useWatchProbeByDefault and useReachByDefault are "no longer dead". Those are in files I didn't touch.
  • Heal tests: test/game-heal.test.ts, test/game-diag.test.ts and test/tui-games.test.ts give 30 pass, 0 fail.
  • Not run: scripts/fast.ts named 2688 test files, too broad for the sandbox, so I ran only the tests above. The forge's check runs the full suite.

Pull description: a game's stuck wake or lost start is started again by the heal, at most twice. After that it stops and the page, terminal and MCP tool say plainly what was tried and what is left for a person. The change adds an additive migration with its pin, src/games/heal.ts, and the web, TUI and MCP doors. It also updates docs/features/games.md and adds tests. I chose not to retry past the limit or to restart anything that isn't safe to restart alone. To try it, open the games page for a game with a stuck wake and read the heal line.

commented

Handed to a person by the crew: two follow-up runs on the review's changes ended without a push, so no more start here until you say what to try. (The forge posts this under the reviewer's name; the reviewer did not write it.)

commented

Parked, offered to the crew again: it sat 6 h with no push, so torque has it now (to answer the last verdict). The last verdict (changes requested): The change is sound on security, tests, both doors and docs: queries are parameterised, the owner-only gating holds on the page, the terminal and MCP, and the feature how-to is in docs/features/games.md rather than the README. One thing to fix: a lost start is closed with the output "the forge st… Still parked 6 h from now, it is closed; the branch stays and Reopen restores it. (The forge posts this; nobody wrote it by hand.)

commented

The forge now starts a stuck server again on its own, at most twice a service, and says so on the box screen, the terminal and the games tool's list. tsc is clean, the gate passes and test/game-heal.test.ts passes (7 tests). I did not run the full suite; the forge's check runs it on this push.

Review fix: a lost start used to be closed with "the forge started it again" before the forge decided whether to start it. That text was wrong when the limit was reached or the two-minute gap was not yet over. In src/games/heal.ts the retry now runs first, and the command row's output follows its result:

  • Retried: "the agent never answered; the forge started it again".
  • Not retried: "the agent never answered; the forge did not start it again (limit or wait between tries)".

I added a test for the limit case in test/game-heal.test.ts. It puts two earlier tries in the window, then checks that a lost start is closed as failed with the "did not start it again" wording and that no new start is queued.

The other four refusals: they did not reproduce on this branch.

  • The gate passes all 32 rules, and the commit subjects name #17618.
  • The tests build real records, not as never.
  • The unused-exports test passes.
  • The only gate note is long comment lines in five files, which the nightly rewrap handles.

The new commit carries Direction:, No door: and No look: lines. The change is a wording change to an existing command row, and no page markup changes.

Not done:

  • Rebooting the agent's machine from the cloud: outside what is safe alone.
  • Retries past the limit.
  • Choosing between several sleeping servers: a join doesn't name the one the player wants.

To try: as a box owner, open /games/<box> and read the Box block, or call games list and read healed.

Closes #17618

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs