From 2410688559bccf03e77ebe5ea7d3643789185da0 Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Mon, 9 Feb 2026 14:00:43 -0500 Subject: [PATCH] fix: pass DagStatusData model instead of dict to append_event_and_broadcast add_event() calls .model_dump() on data, so it needs a Pydantic model not a dict. --- server/reflector/hatchet/dag_progress.py | 2 +- server/tests/test_dag_progress.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/reflector/hatchet/dag_progress.py b/server/reflector/hatchet/dag_progress.py index 06ebfd1c..19b95e90 100644 --- a/server/reflector/hatchet/dag_progress.py +++ b/server/reflector/hatchet/dag_progress.py @@ -216,7 +216,7 @@ async def broadcast_dag_status(transcript_id: str, workflow_run_id: str) -> None transcript_id, transcript, "DAG_STATUS", - dag_status.model_dump(mode="json"), + dag_status, logger, ) except Exception: diff --git a/server/tests/test_dag_progress.py b/server/tests/test_dag_progress.py index 8279624c..a80b3e3c 100644 --- a/server/tests/test_dag_progress.py +++ b/server/tests/test_dag_progress.py @@ -676,8 +676,9 @@ class TestBroadcastDagStatus: assert call_args[0][1] is mock_transcript # transcript assert call_args[0][2] == "DAG_STATUS" # event_name data = call_args[0][3] - assert data["workflow_run_id"] == "wf-abc" - assert len(data["tasks"]) == 1 + assert isinstance(data, DagStatusData) + assert data.workflow_run_id == "wf-abc" + assert len(data.tasks) == 1 @pytest.mark.asyncio async def test_swallows_exceptions(self):