Problem
The agent activity card on a phone goes "Out of date" while the agent is still working. The server publishes a thread's activity only when its state changes, and the relay sends a Live Activity update only when the card differs from the last one it delivered. A turn that stays "Working" for more than ten minutes gets no push, so the card passes its ten-minute stale date and shows every active row as out of date. After two hours without a publish the relay also expires the thread's row as if the environment had died, which ends the card, and a card can only be started again from the foreground. In a week of one relay's delivery records, a live card went more than ten minutes between pushes up to 22 times.
Change
The server now repeats a starting or running thread's state every three minutes, stamped with a heartbeatAt time. The relay carries that time on the thread's card row, so the card differs from the last delivery and is sent again with a fresh stale date, and it measures a running row's two-hour expiry from the heartbeat, including the expiry it gives the Android notification. "Out of date" then means the environment stopped reporting. Row order and each row's own timestamp are unchanged, since those follow the thread's last state change.
Only starting and running threads repeat. Threads waiting for approval or input, and finished ones, do not, so a card whose only rows are waiting still goes out of date. Heartbeats raise no alert: upstream already picks a push's alert from the published state, so starting and running publishes stay silent (pingdotgg#15015 relay-push-spam).
heartbeatAt is optional in the publish contract. An older relay ignores it and behaves as before, and an older server simply sends none. Each running thread costs one publish and one low-priority push every three minutes.
Scope
Bug fix: healthy quiet work is shown as out of date and its card ends after two hours. No upstream issue reports it yet; the closest upstream work (pingdotgg#26261 live-activity-desktop-parity, pingdotgg#35318 widget-background-refresh) does not renew a running row.
Verification
Run on zbook26. The server test "reports quiet running work again, and stops once the run completes" checks that a quiet running thread is published again every three minutes across the ten-minute window with a new heartbeat and its original timestamp, and that the repeats stop once it completes. The relay test "keeps a quiet row alive on its heartbeat, on the card and in Android's expiry" checks that a row with a recent heartbeat survives past the two-hour expiry, carries the heartbeat on its card row and moves the Android expiry. Both fail with the production change reverted. Existing server tests that count publishes leave heartbeats out, and upstream's snooze assertion now allows them. The 29 focused server tests and the relay publisher tests pass.
Not checked against a live relay and phone.