diff --git a/fireflyframework_agentic/pipeline/engine.py b/fireflyframework_agentic/pipeline/engine.py index cea10b14..8317e5b1 100644 --- a/fireflyframework_agentic/pipeline/engine.py +++ b/fireflyframework_agentic/pipeline/engine.py @@ -193,9 +193,7 @@ def _is_send_payload(value: Any) -> bool: """ if isinstance(value, Send): return True - if isinstance(value, list) and value and all(isinstance(s, Send) for s in value): - return True - return False + return isinstance(value, list) and bool(value) and all(isinstance(s, Send) for s in value) def _serialize_value(value: Any) -> Any: diff --git a/tests/unit/pipeline/test_pipeline_engine_pause_send.py b/tests/unit/pipeline/test_pipeline_engine_pause_send.py index f4526e15..32e56c85 100644 --- a/tests/unit/pipeline/test_pipeline_engine_pause_send.py +++ b/tests/unit/pipeline/test_pipeline_engine_pause_send.py @@ -161,9 +161,7 @@ async def test_send_dispatches_workers_concurrently(): async def test_single_send_is_treated_as_list_of_one(): - planner = _step_emit_sends(["a"]) - # Override to emit a single Send (not a list). - + # A planner step that emits one Send directly (not wrapped in a list). class _Solo: async def execute(self, ctx, inputs): return Send(target="a", payload={"items": ["just-a"]}) @@ -196,8 +194,8 @@ async def execute(self, ctx, inputs): def test_pause_and_send_reexported_from_pipeline_package(): - from fireflyframework_agentic.pipeline import Pause as P - from fireflyframework_agentic.pipeline import Send as S + from fireflyframework_agentic.pipeline import Pause as PausePkg + from fireflyframework_agentic.pipeline import Send as SendPkg - assert P is Pause - assert S is Send + assert PausePkg is Pause + assert SendPkg is Send