Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/agent_comms/commander/vibe_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def held(comms: Comms) -> tuple[str, ...]:
return tuple(
name
for name, thread in comms.registry.all_threads().items()
if any(goal.state.lifts_on_compliance for goal in thread.goal.active())
if any(goal.state.lifts_on_compliance for goal in thread.goal)
)


Expand Down
24 changes: 24 additions & 0 deletions tests/test_chokehold_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""A unit the chokehold paused is found again, so a quoting answer can resume it."""

from functools import partial

from agent_comms.commander.vibe_check import ChokeholdAnswer
from agent_comms.goal_actions import ChokeholdPausedGoalAction, PausedGoalAction
from agent_comms.tool_caller import ThreadCaller
from agent_comms.tools import invoke_tool


def _unit(comms, monkeypatch, name):
monkeypatch.setenv("AGENT_COMMS_THREAD", name)
comms.registry.declare(comms.registry.new_thread(name=name, tags=frozenset(), worktree="/wt"))
partial(invoke_tool, caller=ThreadCaller(name))(comms, "comms_set_goal", {"text": "work"})


def test_a_chokehold_paused_unit_is_held_and_an_owner_pause_is_not(comms, monkeypatch):
_unit(comms, monkeypatch, "choked")
_unit(comms, monkeypatch, "owner-paused")
_unit(comms, monkeypatch, "running")
comms.goals.update_goal("choked", ChokeholdPausedGoalAction())
comms.goals.update_goal("owner-paused", PausedGoalAction())

assert ChokeholdAnswer.held(comms) == ("choked",)
Loading