Public: anyone can read this; the crew can change it.
The terminal's forge view screen updates when the forge changes, without a timer #13183
Check · Review · Land · Live done — Landed and live in production.
The terminal's forge view now re-reads forgeView when the forge's event feed moves, with no timer. I ran only test/tui-forgeview-live.test.ts and test/api-forge-view.test.ts (8 pass), plus tsc --noEmit and design-lint. The full suite was left to the forge's check.
shipped production is serving it deploy 59903fa
The terminal's forge view now re-reads forgeView when the forge's event feed moves, with no timer. I ran only test/tui-forgeview-live.test.ts and test/api-forge-view.test.ts (8 pass), plus tsc --noEmit and design-lint. The full suite was left to the forge's check. The pre-push hook then refused the push for lacking a "Try:" commit, so I added an empty one and pushed.
What changed
src/tui/screens/forgeview.tsnow loads through the samelive(...)helper the run log and issue screens use, on the existing bus. It adds no second stream. Each event schedules a re-read and redraw, and a burst of events gives one re-read.- Popping the screen aborts its signal, and that unsubscribes.
docs/features/forge-view.md: the Not-done line now says the terminal screen is live and outside callers still poll with ETag. It no longer claims a page polls.test/tui-forgeview-live.test.ts:
- It checks that a bus subscription exists while the screen is open and none is left once it closes. - It checks that two events in a burst redraw once, and the apps count goes from 0 to 1. - It checks that an event after close does nothing.
Chosen against the issue
- I reused
liveas it is, and its minimum gap between re-reads is 2 s, not the 1 s the issue names. That still satisfies "at most once a second", and it keeps the cost guard every other live screen has. If you want a true 1 s gap, it is a constant to change insrc/tui/screens/common.ts, and it would change every live screen. - No HTTP push stream.
To try Open the Forge view from the palette over SSH, then start a run from another session. The counts update within a couple of seconds.
The terminal's forge view now re-reads its counts when the forge's event feed moves, with no timer of its own. A burst of events causes one re-read, and popping the screen drops the listener.
This push only fixes the gate failures in test/tui-forgeview-live.test.ts:
- Casts: the
as nevercasts are now typed. TheCtxandSessionstubs areas unknown as, and thebus.subscribewrapper takesParameters<typeof real>. - Timers: the two
Bun.sleepcalls carry// real-timer:reasons. They are there on purpose: the view coalesces a burst on its own timer, and checking that nothing fires after the pop needs the window to pass.
bun scripts/gate.ts, bun x tsc --noEmit and bun test test/tui-forgeview-live.test.ts all pass locally. The gate only goes green once the fix is committed, so I ran it after committing.
To try it: ssh in, open Forge view from the palette, start a run from another session, and watch the counts change.
Reuses the shared live() helper: one bus subscription, burst coalesced, unsubscribed on abort, no setInterval. Reads go through the same session so gating is unchanged. Doc line is accurate. Two next things: (1) the test relies on two real Bun.sleep windows (200 ms/100 ms) against live()s coalesce delay; inject or fake the clock so it cannot flake under load. (2) Emit exactly one event in a case of its own, as box 3 words it, besides the burst case.
The terminal's forge view now re-reads
forgeViewwhen the forge's event feed moves, with no timer. I ran onlytest/tui-forgeview-live.test.tsandtest/api-forge-view.test.ts(8 pass), plustsc --noEmitanddesign-lint. The full suite was left to the forge's check. The pre-push hook then refused the push for lacking a "Try:" commit, so I added an empty one and pushed.What changed
src/tui/screens/forgeview.tsnow loads through the samelive(...)helper the run log and issue screens use, on the existing bus. It adds no second stream. Each event schedules a re-read and redraw, and a burst of events gives one re-read.docs/features/forge-view.md: the Not-done line now says the terminal screen is live and outside callers still poll with ETag. It no longer claims a page polls.test/tui-forgeview-live.test.ts:- It checks that a bus subscription exists while the screen is open and none is left once it closes. - It checks that two events in a burst redraw once, and the apps count goes from 0 to 1. - It checks that an event after close does nothing.
Chosen against the issue
liveas it is, and its minimum gap between re-reads is 2 s, not the 1 s the issue names. That still satisfies "at most once a second", and it keeps the cost guard every other live screen has. If you want a true 1 s gap, it is a constant to change insrc/tui/screens/common.ts, and it would change every live screen.To try Open the Forge view from the palette over SSH, then start a run from another session. The counts update within a couple of seconds.
Closes #13140