Description
When an agent streams a function call through DevUI, the chat displays the same tool call multiple times. Each streamed arguments chunk that repeats the function call ID and name is rendered as another tool call, even though the framework executes the tool only once.
Expected behaviour: DevUI should add one tool-call item per unique call_id and append subsequent argument chunks to that item.
Steps to reproduce:
- Run a DevUI agent with a function tool and a streaming chat client.
- Ask the agent to invoke the tool.
- Use a provider that repeats
call_id and name on streamed function-call argument chunks.
- Observe multiple copies of the tool call in the chat and multiple
response.output_item.added events for the same call.

Code Sample
first_update = AgentResponseUpdate(contents=[
Content.from_function_call(
call_id="call_123",
name="get_weather",
arguments="{\"location\":",
)
])
second_update = AgentResponseUpdate(contents=[
Content.from_function_call(
call_id="call_123",
name="get_weather",
arguments="\"Seattle\"}",
)
])
Passing both updates through MessageMapper.convert_event emits two response.output_item.added events for call_123; it should emit one added event and two argument delta events.
Error Messages / Stack Traces
No exception is raised. The failure is visible as duplicate tool-call entries and duplicate response.output_item.added events.
Package Versions
agent-framework-devui: 1.0.0b260730, agent-framework-core: 1.13.0
Python Version
Python 3.14.6
Additional Context
MessageMapper._map_function_call_content currently treats every chunk containing both call_id and name as a new function call. Real streaming clients can repeat that metadata for every arguments chunk. The mapper already tracks calls in active_function_calls, so new output items can be limited to previously unseen call IDs while preserving argument deltas.
Description
When an agent streams a function call through DevUI, the chat displays the same tool call multiple times. Each streamed arguments chunk that repeats the function call ID and name is rendered as another tool call, even though the framework executes the tool only once.
Expected behaviour: DevUI should add one tool-call item per unique
call_idand append subsequent argument chunks to that item.Steps to reproduce:
call_idandnameon streamed function-call argument chunks.response.output_item.addedevents for the same call.Code Sample
Passing both updates through
MessageMapper.convert_eventemits tworesponse.output_item.addedevents forcall_123; it should emit one added event and two argument delta events.Error Messages / Stack Traces
No exception is raised. The failure is visible as duplicate tool-call entries and duplicate
response.output_item.addedevents.Package Versions
agent-framework-devui: 1.0.0b260730, agent-framework-core: 1.13.0
Python Version
Python 3.14.6
Additional Context
MessageMapper._map_function_call_contentcurrently treats every chunk containing bothcall_idandnameas a new function call. Real streaming clients can repeat that metadata for every arguments chunk. The mapper already tracks calls inactive_function_calls, so new output items can be limited to previously unseen call IDs while preserving argument deltas.