Description
When a Foundry hosted agent uses a Foundry Toolbox to dispatch a knowledge-base tool call, the Responses API emits the result as a response.output_item.added item with type == "function_call_output". agent_framework_openai has no handler for this item type, logs it as unparsed, and discards it. No Content.from_function_result(...) reaches agent_framework_ag_ui.
Downstream, this means:
agent_framework_ag_ui emits TOOL_CALL_END but no matching TOOL_CALL_RESULT; its fallback treats the call as declaration-only.
The model still receives and uses the real output, but the structured result never reaches the AG-UI client.
Caveat: the model sees a generic call_tool wrapper; the Toolbox executes the inner MCP tool locally and ResponsesHostServer intentionally serializes its function_result as the standard function_call_output Responses item. The same KB tool called directly is a normal mcp_call and works, confirming this is a client-parser gap rather than a KB-tool failure.
Reproduction
- Configure a Foundry hosted agent with a Foundry Toolbox connected to a knowledge-base retrieval tool. The agent must call the KB tool through the toolbox's generic
call_tool function; a direct call does not reproduce this.
- Drive it via
agent_framework_ag_ui's AgentFrameworkAgent.run() (AG-UI protocol) with DEBUG logging enabled for agent_framework.openai.
- Ask a question that triggers the hosted tool.
- Observe, with DEBUG logging on
agent_framework.openai:
DEBUG agent_framework.openai - Unparsed event of type: response.output_item.added:
ResponseOutputItemAddedEvent(item=ResponseFunctionToolCallOutputItem(...,
call_id='call_XXXX', output='<actual tool result text>',
type='function_call_output', ...))
- The stream emits
TOOL_CALL_END but no matching TOOL_CALL_RESULT. agent_framework_ag_ui._agent_run logs:
INFO agent_framework_ag_ui._agent_run - Found 1 pending tool calls without end event
INFO agent_framework_ag_ui._agent_run - Emitting ToolCallEndEvent for declaration-only tool 'call_XXXX'
No function_result content is produced, despite the successful tool output in step 4.
Controls
- The same FoundryIQ KB tool called directly, without a Toolbox, is exposed as
mcp_call and produces the complete TOOL_CALL_START → TOOL_CALL_END → TOOL_CALL_RESULT lifecycle. This shows the issue is specific to the local Toolbox execution path, not the KB tool.
- A Databricks Genie tool routed through
mcp_call also works correctly.
- A SharePoint grounding preview emits
sharepoint_grounding_preview_call and sharepoint_grounding_preview_call_output, which are both logged as unparsed and produce no AG-UI events. This is secondary evidence because the feature is preview.
Expected behavior
Parse function_call_output into Content.from_function_result(call_id=..., result=event_item.output, ...) so agent_framework_ag_ui emits the matching TOOL_CALL_RESULT. Other supported Responses item types should likewise be handled instead of silently dropped.
Suggested fix location
Add function_call_output handling to agent_framework_openai/_chat_client.py. The SharePoint preview types may need equivalent handling.
Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-openai==1.14.2, agent-framework-core==1.17.0, agent-framework-ag-ui==1.2.2, agent-framework-foundry==1.12.0
Python Version
Python 3.12
Additional Context
No response
Description
When a Foundry hosted agent uses a Foundry Toolbox to dispatch a knowledge-base tool call, the Responses API emits the result as a
response.output_item.addeditem withtype == "function_call_output".agent_framework_openaihas no handler for this item type, logs it as unparsed, and discards it. NoContent.from_function_result(...)reachesagent_framework_ag_ui.Downstream, this means:
agent_framework_ag_uiemitsTOOL_CALL_ENDbut no matchingTOOL_CALL_RESULT; its fallback treats the call as declaration-only.The model still receives and uses the real output, but the structured result never reaches the AG-UI client.
Caveat: the model sees a generic
call_toolwrapper; the Toolbox executes the inner MCP tool locally andResponsesHostServerintentionally serializes itsfunction_resultas the standardfunction_call_outputResponses item. The same KB tool called directly is a normalmcp_calland works, confirming this is a client-parser gap rather than a KB-tool failure.Reproduction
call_toolfunction; a direct call does not reproduce this.agent_framework_ag_ui'sAgentFrameworkAgent.run()(AG-UI protocol) with DEBUG logging enabled foragent_framework.openai.agent_framework.openai:TOOL_CALL_ENDbut no matchingTOOL_CALL_RESULT.agent_framework_ag_ui._agent_runlogs:function_resultcontent is produced, despite the successful tool output in step 4.Controls
mcp_calland produces the completeTOOL_CALL_START→TOOL_CALL_END→TOOL_CALL_RESULTlifecycle. This shows the issue is specific to the local Toolbox execution path, not the KB tool.mcp_callalso works correctly.sharepoint_grounding_preview_callandsharepoint_grounding_preview_call_output, which are both logged as unparsed and produce no AG-UI events. This is secondary evidence because the feature is preview.Expected behavior
Parse
function_call_outputintoContent.from_function_result(call_id=..., result=event_item.output, ...)soagent_framework_ag_uiemits the matchingTOOL_CALL_RESULT. Other supported Responses item types should likewise be handled instead of silently dropped.Suggested fix location
Add
function_call_outputhandling toagent_framework_openai/_chat_client.py. The SharePoint preview types may need equivalent handling.Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-openai==1.14.2, agent-framework-core==1.17.0, agent-framework-ag-ui==1.2.2, agent-framework-foundry==1.12.0
Python Version
Python 3.12
Additional Context
No response