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

A machine agent that does not check in after its update goes back to the version before, and the forge says so #18483

opened this

Merged 3h 13m ago, live in production

A machine whose agent update was put back now says so on its /infra row. Most of this issue was already on main from #18019. The row display was the one missing piece.

Notes

opened this

A machine whose agent update was put back now says so on its /infra row. Most of this issue was already on main from #18019. The row display was the one missing piece.

I ran test/infra-agent-back.test.ts, test/infra-page.test.ts and test/game-agent-rollback.test.ts (28 pass), and tsc and design-lint are clean. I did not run the full suite or the ubuntu:24.04 box tests in this sandbox. I did not render the page either: data-agent-back is untested at the page level, and I never checked how it displays, so check it on the preview.

Already on main, so I left it alone:

  • self_update keeps the old script as agent.sh.prev and writes a .trial marker.
  • A new agent that exits 3 times within 10 minutes, or completes no sync within 3 minutes, is replaced by the old one. The old one reports rolledBack in its next diag and does not retry that sha until the forge answers a different one.
  • The ubuntu:24.04 proof of both paths is the existing test/game-agent-rollback.test.ts, which runs in release/agent_tests.ts's ubuntu:24.04 release step (matched by the game-agent-* name).
  • The heartbeat route is also already live: the agent trial runs against /api/v1/agent/v1/heartbeat, which #18475 landed. I did not touch the protocol or the sync route.

Changed:

  • Running in src/actions/infra.ts gains agentBack. It holds the box's diag.rolledBack text and is absent when the agent is fine.
  • The /infra machine row shows "On its old agent: <reason>" (src/web/pages/infra.ts).
  • The terminal Infra list shows the same words after the row's place (src/tui/screens/infra.ts).
  • The infra MCP tool's list carries agentBack as a machine field, through infraOf.
  • docs/features/infra.md describes it.
  • test/infra-agent-back.test.ts covers a box with a healthy agent (no field) and one whose agent was rolled back (the field holds the reason).

Not done: I added no new heartbeat field, because rolledBack in the diag already carries the reason.

Try it: open /infra on the preview. A game box whose agent was rolled back reads "On its old agent: agent update rolled back: …" in its row.

Looks: /infra

[{"go":"/infra","look":"a game box machine row whose agent update was rolled back","expect":"an extra line 'On its old agent: agent update rolled back: …' under its place and end; no such line on other machines"}]

🤖 Generated with Claude Code

Closes #18464

3 earlier comments
commented

A machine whose agent update was put back now says so on its /infra row. Most of this issue was already on main from #18019. The row display was the one missing piece.

I ran test/infra-agent-back.test.ts, test/infra-page.test.ts and test/game-agent-rollback.test.ts (28 pass), and tsc and design-lint are clean. I did not run the full suite or the ubuntu:24.04 box tests in this sandbox. I did not render the page either: data-agent-back is untested at the page level, and I never checked how it displays, so check it on the preview.

Already on main, so I left it alone:

  • self_update keeps the old script as agent.sh.prev and writes a .trial marker.
  • A new agent that exits 3 times within 10 minutes, or completes no sync within 3 minutes, is replaced by the old one. The old one reports rolledBack in its next diag and does not retry that sha until the forge answers a different one.
  • The ubuntu:24.04 proof of both paths is the existing test/game-agent-rollback.test.ts, which runs in release/agent_tests.ts's ubuntu:24.04 release step (matched by the game-agent-* name).
  • The heartbeat route is also already live: the agent trial runs against /api/v1/agent/v1/heartbeat, which #18475 landed. I did not touch the protocol or the sync route.

Changed:

  • Running in src/actions/infra.ts gains agentBack. It holds the box's diag.rolledBack text and is absent when the agent is fine.
  • The /infra machine row shows "On its old agent: <reason>" (src/web/pages/infra.ts).
  • The terminal Infra list shows the same words after the row's place (src/tui/screens/infra.ts).
  • The infra MCP tool's list carries agentBack as a machine field, through infraOf.
  • docs/features/infra.md describes it.
  • test/infra-agent-back.test.ts covers a box with a healthy agent (no field) and one whose agent was rolled back (the field holds the reason).

Not done: I added no new heartbeat field, because rolledBack in the diag already carries the reason.

Try it: open /infra on the preview. A game box whose agent was rolled back reads "On its old agent: agent update rolled back: …" in its row.

Looks: /infra

[{"go":"/infra","look":"a game box machine row whose agent update was rolled back","expect":"an extra line 'On its old agent: agent update rolled back: …' under its place and end; no such line on other machines"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 9c9771986d91 --> Look pages for 9c97719, from the gate:

  • look pages (none): "Looks: /infra" is not a page of app.looks in forge.json; this pull changes src/web/pages/infra.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 28 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

This push only fixes the look-pages complaint. I did not re-check the four recurring check failures, and I changed no code, so nothing under src/ moved.

My earlier commit said Looks: /infra, but /infra is not in app.looks in forge.json. The gate also could not trace its route to infer a page. I pushed an empty commit that says No look: with the reason: a fresh preview has no registered machine, so the "On its old agent:" row can't be shown there. I chose not to add /infra to app.looks, because a look of an empty page would show nothing useful.

This pull makes the forge show a machine whose agent update was rolled back. The /infra row now reads "On its old agent:", in the terminal and in the infra tool as well as on the web page. Tests cover the row.

To try it, open /infra on the preview with a machine whose agent was rolled back.

🤖 Generated with Claude Code

commented

The reason now shows on every machine row, and both doors have a test. bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and bun scripts/gate.ts --fix rewrapped no comments. I ran only test/infra-agent-back.test.ts (4 tests pass), not the other tests on your list.

  • Failed row: machineRow in src/web/pages/infra.ts now puts the data-agent-back span outside the clear ternary. A box that needs clearing shows "On its old agent: …" as well, and it uses the existing meta spans (no new class).
  • Terminal line: the Infra screen's secondary line in src/tui/screens/infra.ts cuts the reason to 80 characters and ends it with …. The 300-character cap in infraOf stays, so the tool and the web row still get the full reason.
  • Page test: test/infra-agent-back.test.ts renders runningRegion for the rolled-back box and expects "On its old agent: " plus the reason. For the healthy box it expects no data-agent-back. Deleting the span now fails the suite.
  • Terminal test: the same file renders the Infra screen and expects on its old agent: agent update rolled back for the rolled-back box and nothing for the healthy one. A 300-character reason is cut to 79 characters plus ….

The new tests do not cover the clear case on the page. The fixture box never has a clear value, so that move is untested. I couldn't try it on the preview either, since it has no registered machine.

I did not look into the four recurring check failures (dead exports, duplicate imports, first-view budget, process-wide state). This round added no exports, imports or module-level state.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs