Description
What happened?
The agent-framework-ag-ui package only processes output and data event types in workflows, meaning intermediate events produced by agent-framework WorkflowAgent are NOT handled and fall through to custom events instead of being converted to the appropriate AGUI Reasoning* event types.
Location:
|
if event_type in {"output", "data"}: |
This causes intermediate workflow events to be emitted as generic AGUI CustomEvent instead of proper reasoning events.
What did you expect to happen?
- agent-framework-ag-ui should handle "intermediate" events
Since AGENT_FORWARDED_EVENT_TYPES defines "intermediate" as the modern standard (with "data" as deprecated):
# python/packages/core/agent_framework/_workflows/_events.py:L138
AGENT_FORWARDED_EVENT_TYPES: frozenset[str] = frozenset({
"output",
"intermediate", # ← The new standard
"data", # deprecated alias for intermediate; retained for backward compat
"request_info",
})
The AG-UI workflow runner should handle all forwarded event types:
# _workflow_run.py:L1277 (proposed fix)
if event_type in {"output", "intermediate", "data"}:
# ... process as AG-UI events
- Intermediate event content should be displayed as reasoning
When workflows emit intermediate events with text content, the AG-UI layer should automatically convert that content to text_reasoning type so it displays as reasoning in the UI (collapsible "thinking" sections), not as final assistant messages.
This could be handled in either:
- Option A:
WorkflowAgent._convert_workflow_event_to_agent_response_updates() - auto-convert text content in intermediate events to text_reasoning before forwarding
- Option B:
agent-framework-ag-ui/_workflow_run.py - detect intermediate events and convert their text content to text_reasoning before calling _emit_content()
Steps to reproduce the issue
@executor(id="thinking_executor")
async def thinking_executor(
msgs: list[Message],
ctx: WorkflowContext[None, str]
) -> None:
"""Emit intermediate output that should display as reasoning."""
# This should appear as reasoning/thinking in the UI
await ctx.yield_output("Analyzing the problem...", type="intermediate")
# This should appear as final response
await ctx.yield_output("Here's my answer!", type="output")
# Create workflow with intermediate output enabled
builder = WorkflowBuilder(
name="test_workflow",
start_executor=thinking_executor,
intermediate_output_from=[thinking_executor],
)
workflow = builder.build()
# Wrap in AG-UI
agui_workflow = AgentFrameworkWorkflow(
workflow=workflow,
name="test-reasoning",
description="Test intermediate events",
)
# Run it - intermediate events will NOT display as reasoning
# They fall through to CustomEvent instead of ReasoningMessageContentEvent
Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-core 1.13.0; agent-framework-ag-ui 1.0.1
Python Version
python 3.12
Additional Context
No response
Description
What happened?
The agent-framework-ag-ui package only processes
outputanddataevent types in workflows, meaningintermediateevents produced by agent-frameworkWorkflowAgentare NOT handled and fall through to custom events instead of being converted to the appropriate AGUIReasoning*event types.Location:
agent-framework/python/packages/ag-ui/agent_framework_ag_ui/_workflow_run.py
Line 1277 in baf0ea5
This causes intermediate workflow events to be emitted as generic AGUI
CustomEventinstead of proper reasoning events.What did you expect to happen?
Since
AGENT_FORWARDED_EVENT_TYPESdefines "intermediate" as the modern standard (with "data" as deprecated):The AG-UI workflow runner should handle all forwarded event types:
When workflows emit intermediate events with text content, the AG-UI layer should automatically convert that content to
text_reasoningtype so it displays as reasoning in the UI (collapsible "thinking" sections), not as final assistant messages.This could be handled in either:
WorkflowAgent._convert_workflow_event_to_agent_response_updates()- auto-convert text content in intermediate events totext_reasoningbefore forwardingagent-framework-ag-ui/_workflow_run.py- detect intermediate events and convert their text content totext_reasoningbefore calling_emit_content()Steps to reproduce the issue
Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-core 1.13.0; agent-framework-ag-ui 1.0.1
Python Version
python 3.12
Additional Context
No response