refactor(stall_watch): HerdrSource needs the herdr name, no fallback to the original (Issue #71)

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-25 17:00:25 +00:00
1 parent 015075077c
commit bd61ef532f
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -155,12 +155,12 @@ class HerdrError(Exception):
class HerdrSource(object):
"""Every herdr and OS read the judgement needs, in one place."""
def __init__(self, target, agent, session=None, name=None):
def __init__(self, target, agent, session=None, *, name):
self.target, self.session = target, session or None
# `name` is the name herdr knows the agent by (#66), worked out once
# by StallWatch (#71); the kind is read off the original name, whose
# suffix a long name's hash replaces.
self.name = name or target
self.name = name
self.agent = resolve_agent(agent, target)
adapter = get_adapter(self.agent) if self.agent else None
self.resident = tuple(adapter.resident_children) if adapter else ()
+1 -1
View File
@@ -96,7 +96,7 @@ def test_the_1x_capture_still_reads_empty():
@pytest.mark.parametrize("name", HOME_SCREENS)
def test_stall_watch_sees_the_2x_home_box_empty(name, monkeypatch):
src = stall_watch.HerdrSource("t", "opencode")
src = stall_watch.HerdrSource("t", "opencode", name="t")
monkeypatch.setattr(src, "_herdr", lambda *args: _pane(name))
assert src.input_empty() is True