fix: Handle None event_queue in _queue_put, fix test assertion

This commit is contained in:
2026-03-07 16:53:45 -05:00
parent 3984132700
commit ca65f29513
2 changed files with 4 additions and 3 deletions

View File

@@ -271,6 +271,7 @@ class ConductorEngine:
def _queue_put(event_queue: events.SyncEventQueue, event_name: str, payload) -> None:
"""Thread-safe helper to push an event to the SyncEventQueue from a worker thread."""
if event_queue is not None:
event_queue.put(event_name, payload)
def confirm_execution(payload: str, event_queue: events.SyncEventQueue, ticket_id: str) -> bool:

View File

@@ -282,8 +282,8 @@ def test_run_worker_lifecycle_pushes_response_via_queue(monkeypatch: pytest.Monk
patch("src.multi_agent_conductor._queue_put") as mock_queue_put:
mock_spawn.return_value = (True, "prompt", "context")
run_worker_lifecycle(ticket, context, event_queue=mock_event_queue)
mock_queue_put.assert_called_once()
call_args = mock_queue_put.call_args[0]
mock_queue_put.assert_called()
call_args = mock_queue_put.call_args_list[0][0]
assert call_args[1] == "response"
assert call_args[2]["stream_id"] == "Tier 3 (Worker): T1"
assert call_args[2]["text"] == "Task complete."