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.
This commit is contained in:
ogabrielluiz
2026-06-16 14:35:31 -03:00
parent 33cd3baa58
commit 98aa98df97

View File

@ -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())