Skip to content

Fix TeamHeartbeat failure/corrupt-frame retention and stale TeamHudReading tests - #5290

Merged
trissim merged 1 commit into
mainfrom
fix/team-hud-reading-tests
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/team-hud-reading-tests

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes two real bugs in heartbeat board publication plus 4 stale TeamHudReading / TeamUpdateStore test sites exposed by tests/test_team_notifications.py:

  1. TeamHeartbeat.failed pre-HUD failure retention (src/agent_comms/team/team_heartbeat.py:466, src/agent_comms/team/team_hud.py:593):
    • When a heartbeat pass failed before any prior successful beat had published a TeamHud for a recipient, TeamHeartbeat.failed() skipped appending to changed_huds, dropping the failure packet from TeamBoardPublicationStore so muted-heartbeat failure retention returned () and repeated failures failed to deduplicate.
    • Added TeamHud.for_failure(...) and retained the failure packet in TeamBoardPublicationStore even before a first full HUD frame exists.
  2. Corrupt/newer-build board writer recovery (src/agent_comms/team/team_hud.py:896,1014):
    • TeamBoardPublicationStore.replace_all() already caught RecordProblems to overwrite an unreadable future-build publication file, but TeamBoardPublicationStore.retained() and write_all() crashed with RecordProblems before TeamHeartbeatEffects.pass_body ever reached replace_all().
    • retained() and write_all() now treat an unreadable stored publication as empty for writers while readers (read, read_cut, read_for) continue surfacing RecordProblems -> TeamHudUnreadable.
  3. Updated stale tests (tests/test_team_notifications.py):
    • Updated test_team_page_reads_each_beats_frame_and_nothing_between and test_preparing_the_board_answers_each_read_outcome_through_its_owner to exercise synchronous TeamHudReading.prepare(comms, revision) / RetryObservationStep / TeamHudObserved.cut.huds instead of the removed async reading.preparation / reading.read_board attributes.
    • Migrated legacy TeamUpdateStore test sites (:451, :590, :862) to TeamBoardPublicationStore / TeamUpdate.latest and updated TeamHeartbeat.served monkeypatch signature (snapshot=None).

Verification

  • tests/test_team_notifications.py (all 10 previously failing/updated tests): 10 passed (30.57s, plus 39 other tests passing in the prior run -> 49/49).
  • tests/test_team_plan_absent.py + tests/test_shared_team_frames.py: 27 passed (0.97s).
  • REL_IMPORTS=0.

@trissim
trissim merged commit f90748a into main Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant