From 5519bf3557e8355a5d6c4888f1d74960a21f75a3 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Thu, 29 Oct 2026 19:20:26 -0400 Subject: [PATCH] Revert #1335 until Core #3617 lands: Toad main calls hud.header Core main lacks toad#1335 merged at 23:19 while its Core half, agent-comms#3617 (CommanderLoad.header), is still open and sent back. Toad main's screens/commander.py:207 therefore raises AttributeError the moment the commander page opens on any install of Toad main. hud-repair-pi re-lands the Toad half together with #3617. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK --- src/toad/screens/commander.py | 6 +++++- tests/textual/test_commander_page.py | 24 +++++------------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/toad/screens/commander.py b/src/toad/screens/commander.py index 2130c83e8..cf46144e6 100644 --- a/src/toad/screens/commander.py +++ b/src/toad/screens/commander.py @@ -2,6 +2,8 @@ from __future__ import annotations +import time + from agent_comms.commander_hud import ( BoardRow, CommanderHud, CommanderUnit, HudRow, QuietUnits, ) @@ -204,7 +206,9 @@ def reconcile_units(self) -> None: def present(self, hud: CommanderHud) -> None: self.hud = hud self.heading.update(f"Commander {hud.commander.name}") - self.status.update("\n".join(hud.header)) + self.status.update("\n".join(( + str(hud.load), *hud.heartbeat.aged_line("heartbeat", time.time()), + ))) self.footer.update("\n".join( line for row in hud.rows() for line in self.row_text.lines(row) )) diff --git a/tests/textual/test_commander_page.py b/tests/textual/test_commander_page.py index 392eb0198..1415a6faf 100644 --- a/tests/textual/test_commander_page.py +++ b/tests/textual/test_commander_page.py @@ -8,7 +8,6 @@ CommanderFrame, CommanderHud, CommanderUnit, CodexUsage, UnreadableUsage, ) from agent_comms.thread_identity import RecordedThreadIncarnation -from agent_comms.service_passes import ServicePassStore from agent_comms.ui_model.observation import ObserveCommanderHud from agent_comms.ui_model.unit_state import Detached, PendingClock from textual.widgets import Static @@ -25,10 +24,10 @@ async def test_commander_page_survives_unreadable_frames_and_recovers(workspace) PendingClock(1.0, 1.0), (), 1, (), (), ) hud = CommanderHud( - commander=RecordedThreadIncarnation("claude-code", 1.0), units=(unit,), phases=(), - load=OverloadDegradation.from_orders((), 0, 0), - forks=(RecordedThreadIncarnation("fork-hud", 2.0),), - usage=CodexUsage(UnreadableUsage(reason="not requested")), + RecordedThreadIncarnation("claude-code", 1.0), (unit,), (), + OverloadDegradation.from_orders((), 0, 0), + (RecordedThreadIncarnation("fork-hud", 2.0),), + CodexUsage(UnreadableUsage(reason="not requested")), ) CommanderFrame.replace_all(workspace.comms.root, (hud,)) frame, = CommanderFrame.matching_in(workspace.comms.root) @@ -67,20 +66,7 @@ async def test_commander_page_survives_unreadable_frames_and_recovers(workspace) # refusal must stay in the disclosure while observation keeps working. await ui.until_shows("Original details unavailable:") assert str(view.heading.render()) == "Commander claude-code" - assert str(view.status.render()) == '\n'.join(view.hud.header) - retained_frame = frame.read_bytes() - services = ServicePassStore.at(workspace.comms.root) - services.failed('CommanderHeartbeat', KeyError('retained-ui failure')) - await ui.until_shows('retained-ui failure') - assert 'retained-ui failure' in str(view.status.render()).splitlines()[0] - assert 'elapsed' in str(view.status.render()).splitlines()[0] - assert 'STALE retained' in str(view.status.render()) - assert frame.read_bytes() == retained_frame - services.passed('CommanderHeartbeat') - await ui.until(lambda: 'retained-ui failure' not in str(view.status.render()), - why='service-only recovery to update the open frame') - assert rows.query_one(CommanderFrameView) is view - assert not card.collapsed and title.has_focus + assert str(view.status.render()).startswith(str(hud.load)) assert hud.usage.line() in str(view.footer.render()) assert "forks: fork-hud" in str(view.footer.render())