Public: anyone can read this; the crew can change it.
A game box agent that does not check in after its update goes back to the one before #18023
Closed 11h 14m ago
A game box's new agent is now on trial until the forge answers one of its syncs, and if it never does, the box goes back to the previous agent (#18019). The ubuntu:24.04 run, which the issue asks for, was not done: this sandbox has no docker.
-
Reviews
Changes requested — before the latest pushThe idea is right and the forge side is tidy: the sync field is validated, the tests drive the real agent script, there is a TUI line and a how-to, and nothing was added to README. Three things to fix in this round.
- First, and it matters most: a forge outage rolls back a good agent. The ten-minute check counts a box that cannot reach the forge against the new agent. The rolled-back agent then never fetches that sha again. A forge that is down for ten minutes (the Never that says the forge can't go dark) leaves every box that just updated stuck on the old agent, and only a different agent can free it. Count the time only while the forge is answering, or when the sync gets an HTTP answer that is not 2xx. A box that got no answer at all should not start or advance the clock. A refused sha should also be retried after a while instead of being barred for good. Add a test where the forge does not answer and the agent stays.
- The web and terminal changes have no test. The Games row's new Agent fact (
src/web/pages/games.ts) and the lead line on the box's terminal screen (src/tui/screens/games.ts) are only covered throughagentBackLine. Add a test that renders/gamesand the screen for a box withagentBackShaset and sees the line. Without it, both could be removed and the suite would stay green. - The how-to is one long paragraph, with the env var names and file names inline. Give the rollback its own short section in
docs/features/games.md: what the person sees, what they do (nothing, or ship a fixed agent), and how to look atagent.sh.refused.
The ubuntu:24.04 run the issue asked for was not done. Say so in the pull, or run it where docker exists.
Design: the Agent fact uses the existing facts row, a
dlrow and not a card, with no new accent or border. That is fine. No phone screenshot shows a box on its previous agent, so I could not see the wrapped line; the line is up to 200 characters plus the sha, so check that it wraps at 360px. -
Checks
stopped closed without shipping deploy 14689b0
-
History
- Games: a forge that does not answer never rolls a good agent back; a refused sha is tried again after a while (#18019) 14689b0
- Games: rewrap comments, pin the agent-back migration (#18019) 4982667
- Games: a new box agent on trial is put back on the previous one, and the forge says so (#18019) 6c0f3a9
- Asks: routes so a client can clear the whole queue (resume paused, snooze, group contents, dismiss all kinds) (#17966) 11275b0
- Merge pull request #18016 from sold/forge-fast b9491db
- Talk API: a person's sent files on each turn, and search inside turns (#18009) 0e5211b
- Merge commit '2b24ebd48bea0a43bd8236087ff986b3542c25d4' into HEAD cee6636
- GET /api/v1/repos/{owner}/{name}/commits reads `path`: only the commits that touched it (#18007) 2b24ebd
- Move in: bring all of GitHub and Vercel into the forge through one trusted flow (inventory → plan → paced copy → verify), read-only toward the sources; clean-up is a separate, later step (#18000) 6d7f17e
- A test that reads an /api/v1 answer disagreeing with openapi.json goes red (#18013) 23d6af8
- Talk API: an agent turn's cards as data, with exact values (#18008) 866b811
- The test files outside api-* read no answer that disagrees with openapi.json (#18001) d861d63
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17968) 35a5490
- Traces 3: one trace as a tree beside a time strip, with what it changed (#17996) 2902a64
- Merge pull request #17997 from sold/ssh-mlkem 05c87e1
- SSH: the hybrid's K has its own known answer, the client test skips the hybrid on OpenSSH before 9.9, one comment, the docs in their own paragraph 281e40c
- Merge pull request #17998 from sold/tab-start 7e39794
- The /tab fix serves #16840 4eed511
- /tab starts in Safari and Chrome: the worker sees its host page, and the page waits for activation a5d9dd7
- SSH offers the hybrid post-quantum key exchange first: mlkem768x25519-sha256 1124a92
4 earlier comments
A game box's new agent is now on trial until the forge answers one of its syncs, and if it never does, the box goes back to the previous agent (#18019). The ubuntu:24.04 run, which the issue asks for, was not done: this sandbox has no docker.
The agent-script tests (test/game-agent-rollback.test.ts and the existing update test) pass as plain bash, and the gate and tsc are clean. I did not run the full suite. The unused-exports and module-state checks I ran pass. I never ran the FORGE_TEST_UBUNTU=1 docker path. It installs curl and jq inside the container, so it needs network access.
What changed
- Keeping the old script:
self_updatecopies the running script toagent.sh.prevbefore replacing it. It writes.agent.trialwith the start time, the new sha and the old sha. - Trial guard: a guard at the very top of
agent.shreplaces the new agent with the previous one in two cases:- Repeated starts: it has started more than
FORGE_GAME_TRIAL_STARTStimes (default 5) without an answered sync. - Too slow: it has run
FORGE_GAME_TRIAL_Sseconds (default 600) without one. The main loop checks this too, for an agent that runs but never syncs.
- Repeated starts: it has started more than
- Proving the new agent: a 2xx sync answer ends the trial and clears the markers.
- What the rolled-back agent does:
- Saying so: it keeps
.agent.backand sendsagentBack: {sha, why}on every sync. - No retry: it never fetches that sha again, so a mismatch with the forge's sha cannot loop. A different agent shipping ends it.
- Evidence kept: the failed script is kept as
agent.sh.refused.
- Saying so: it keeps
- What the forge shows:
- Storage: the sync is validated (a 64-hex sha, plain text under 200 characters) and stored in two new
game_boxcolumns, with a migration and its pin. The forge clears them when the box stops sendingagentBack. - Display: the Games list row shows an "Agent" fact, and the box's terminal screen leads with "On its previous agent: the new one (…) was put back: …". Both come from
agentBackLine. - Docs: the how-to is in
docs/features/games.md, and the sync route description in OpenAPI mentionsagentBack.
- Storage: the sync is validated (a 64-hex sha, plain text under 200 characters) and stored in two new
- Tests: they cover keeping the previous script, the repeated-exit rollback, the timeout rollback, the sync saying why without refetching, and the forge's storing and clearing of
agentBack.
What I left out
- The guard is the new agent's own code. A new agent that dies before the guard runs is not caught. Closing that would need a systemd-side check.
- A box that cannot reach the forge for the whole ten minutes is rolled back too, and stays on the old agent until a different sha ships. I did not add a later retry.
- I did not extract a shared test helper. The gate notes the box and run helpers look like the ones in
game-agent-update.test.ts.
To try it
- Run
bun test test/game-agent-rollback.test.ts. - Run it in ubuntu:24.04 with
FORGE_TEST_UBUNTU=1 bun test test/game-agent-rollback.test.ts. - On a preview, open
/gamesfor a box whose agent was put back.
Commit lines carry Try:, Looks:/No look: and No door:. The box's terminal screen and the how-to already carry the change, and agent_back.ts is the shared helper.
🤖 Generated with Claude Code
<!-- look-pages 4982667cc770 --> Look pages for 4982667, from the gate:
look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /admin/telemetry, /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
A game box's agent that is not answered by the forge no longer gets rolled back, and the web and terminal lines now have a test.
What changed
- Forge outage: the ten-minute clock now starts at the first sync the forge answers with a non-2xx status, kept in
.agent.bad. A box that gets no answer at all (forge down, network out) neither starts nor advances it. - Retry: a refused sha is fetched again after
FORGE_GAME_RETRY_S(default six hours), measured from when.agent.backwas written. A different sha is fetched at once, as before. - Start limit: the five-starts rule is unchanged. A crash-looping agent never reaches a sync, so it still rolls back.
- Forge-down test: the forge is stopped, the agent runs twice with its time limit set to zero, and the new agent stays. There is no
.agent.backor.agent.bad. - Error-answer test: the forge answers 500, the clock starts and the agent is put back. It stays barred, then a backdated
.agent.backmakes it fetch the sha again. - Page and screen test: it renders
/gamesas an owner withagentBackShaset and checks for "On its previous agent…". It does the same forgameBoxScreen. - How-to:
docs/features/games.mdnow has its own section, "When a new agent is put back". It covers what you see, what puts it back, what to do (nothing, or ship a fixed agent), and where to look (agent.sh.refused,.agent.back, the journal). I removed the old paragraph.
Not done
- ubuntu:24.04 run: I did not do it. The sandbox has no docker. The tests still support it through
FORGE_TEST_UBUNTU=1. - 360px wrap: I did not check it. No browser was available here. The Agent fact reuses the existing
dlfacts row with no new styling, anddesign-lintis clean. - Slow-to-start agent: an agent that hangs for a reason other than the network now stays on trial until the forge gives it an error answer. I judged that safer than rolling back on silence.
- Reviewer's point 3: gate and
tscare clean.
Looks: /games
<!-- look-pages 14689b0697df --> Look pages for 14689b0, from the gate:
look pages (none): "Looks: /games" is not a page of app.looks in forge.json; this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /admin/telemetry, /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
A game box's new agent is now on trial until the forge answers one of its syncs, and if it never does, the box goes back to the previous agent (#18019). The ubuntu:24.04 run, which the issue asks for, was not done: this sandbox has no docker.
The agent-script tests (
test/game-agent-rollback.test.tsand the existing update test) pass as plain bash, and the gate andtscare clean. I did not run the full suite. The unused-exports and module-state checks I ran pass. I never ran theFORGE_TEST_UBUNTU=1docker path. It installs curl and jq inside the container, so it needs network access.What changed
self_updatecopies the running script toagent.sh.prevbefore replacing it. It writes.agent.trialwith the start time, the new sha and the old sha.agent.shreplaces the new agent with the previous one in two cases:FORGE_GAME_TRIAL_STARTStimes (default 5) without an answered sync.FORGE_GAME_TRIAL_Sseconds (default 600) without one. The main loop checks this too, for an agent that runs but never syncs..agent.backand sendsagentBack: {sha, why}on every sync.agent.sh.refused.game_boxcolumns, with a migration and its pin. The forge clears them when the box stops sendingagentBack.agentBackLine.docs/features/games.md, and the sync route description in OpenAPI mentionsagentBack.agentBack.What I left out
game-agent-update.test.ts.To try it
bun test test/game-agent-rollback.test.ts.FORGE_TEST_UBUNTU=1 bun test test/game-agent-rollback.test.ts./gamesfor a box whose agent was put back.Commit lines carry
Try:,Looks:/No look:andNo door:. The box's terminal screen and the how-to already carry the change, andagent_back.tsis the shared helper.🤖 Generated with Claude Code
Closes #18019