From 98aa98df9783ef8ebbf9788352c709e6a683f842 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Tue, 16 Jun 2026 14:35:31 -0300 Subject: [PATCH] fix(api/v2): restore "end" side-channel event in AG-UI workflow stream The durable background-execution rewrite of workflow.py reverted `side_channel_events` to its pre-"end" form, dropping the "end" event from the AG-UI side-channel. That event carries `build_duration` to the playground chat-view, and the message metadata badge only renders when `hasDuration || hasTokens`. With build_duration gone the badge vanished, failing the token-usage and shareable-playground "Finished In" regression tests. Re-add "end" so the streaming playground path delivers it again. --- src/backend/base/langflow/api/v2/workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/api/v2/workflow.py b/src/backend/base/langflow/api/v2/workflow.py index 133b2a7f76..c5395b4ef9 100644 --- a/src/backend/base/langflow/api/v2/workflow.py +++ b/src/backend/base/langflow/api/v2/workflow.py @@ -658,7 +658,7 @@ async def _stream_event_frames( # side-channel ``CustomEvent``; emitted only when the wire protocol is # AG-UI. A follow-up retires this once chat-view consumes AG-UI primitives. emit_side_channel = adapter.name == "agui" - side_channel_events = frozenset({"add_message", "token", "remove_message", "error"}) + side_channel_events = frozenset({"add_message", "token", "remove_message", "error", "end"}) seq = 0 run_task = asyncio.create_task(drive())