Private
Public Access
0
0

fix(orchestration_logic): migrate test_run_worker_lifecycle_blocked mock (Phase 2 follow-up)

Phase 2.13 missed the test_run_worker_lifecycle_blocked test in
test_orchestration_logic.py - it also mocked src.ai_client.send.
The test was failing with "Worker send_result failed for T1: ...
[Errno 2] No such file or directory: .beads_mock/beads.json" because
the unmocked send_result fell through to the real provider which
tried to read beads.json.

Changes:
- Replace patch(src.ai_client.send) with patch(src.ai_client.send_result)
- Wrap mock return_value with Result(data="BLOCKED because of missing info")

All 8 tests in test_orchestration_logic.py now pass.
This commit is contained in:
2026-06-15 17:45:18 -04:00
parent 36962ef6b6
commit 4592618372
+2 -2
View File
@@ -105,11 +105,11 @@ def test_conductor_engine_parse_json_tickets() -> None:
def test_run_worker_lifecycle_blocked() -> None:
ticket = Ticket(id="T1", description="desc", status="todo", assigned_to="worker1")
context = WorkerContext(ticket_id="T1", model_name="model", messages=[])
with patch("src.ai_client.send") as mock_ai_client, \
with patch("src.ai_client.send_result") as mock_ai_client, \
patch("src.ai_client.reset_session"), \
patch("src.ai_client.set_provider"), \
patch("src.multi_agent_conductor.confirm_spawn", return_value=(True, "p", "c")):
mock_ai_client.return_value = "BLOCKED because of missing info"
mock_ai_client.return_value = Result(data="BLOCKED because of missing info")
multi_agent_conductor.run_worker_lifecycle(ticket, context)
assert ticket.status == "blocked"
assert ticket.blocked_reason == "BLOCKED because of missing info"