From 4592618372aec07f6ffd6c4646c01db84eae7b46 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 17:45:18 -0400 Subject: [PATCH] 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. --- tests/test_orchestration_logic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_orchestration_logic.py b/tests/test_orchestration_logic.py index c4948d79..ed186ddd 100644 --- a/tests/test_orchestration_logic.py +++ b/tests/test_orchestration_logic.py @@ -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"