Skip to content

Python: [Feature]: TOOL_CALL_RESULT Events Not Emitted on Approval Resume #4589

Description

@nandireddy19

Description

File: agent_framework_ag_ui/_agent_run.py · Lines: 710–742

Description

When a tool is approved via the interrupt/resume flow, _resolve_approval_responses (line 710) executes the tool and injects the result into the messages array passed to agent.run(). However, no TOOL_CALL_RESULT SSE event is yielded to the client.

Current behavior

  • Turn 1: Agent calls tool → TOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END emitted → run interrupts
  • Turn 2 (resume with approval): Wrapper executes the tool internally → result injected into messages → LLM continues → only the LLM's text response is streamed
  • The client sees the tool call (START/ARGS/END) but never the tool result

Impact

  1. UI cannot display tool output. The UI renders tool calls and their outputs, but for approved tools there is no TOOL_CALL_RESULT event to render.
  2. Middleware cannot reconstruct full conversation history. In multi-turn HITL scenarios (Turn 1 interrupts → Turn 2 approves/interrupts → Turn 3 approves), middleware has no record of prior turn tool results, preventing construction of a full messages[] array. Current workaround: only include the most recent turn's messages in each resume request.

Expected behavior

After _resolve_approval_responses executes approved tools (line 710), run_agent_stream should yield a TOOL_CALL_RESULT event for each successfully executed tool before calling agent.run(). The fix goes between line 710 and line 742 — iterate over resolved messages, find function_result contents, and yield corresponding events.

Reproduction

  1. Configure an agent with MCPSpecificApproval on a tool
  2. Send a query that triggers the tool
  3. Resume with {"accepted": true}
  4. Observe SSE stream — no TOOL_CALL_RESULT event appears

Code Sample

Language/SDK

Python

Activity

  1. changed the title [-][Feature]: TOOL_CALL_RESULT Events Not Emitted on Approval Resume[/-] [+]Python: [Feature]: TOOL_CALL_RESULT Events Not Emitted on Approval Resume[/+] on Mar 10, 2026
  2. moonbox3 commented on Mar 12, 2026

    @moonbox3
    Contributor

    We've fixed this bug. Could you let us know which version of the agent-framework-ag-ui package you're using?

  3. added and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Mar 12, 2026
  4. nandireddy19 commented on Mar 12, 2026

    @nandireddy19
    Author

    agent-framework-ag-ui = {version = "^1.0.0b260304", allow-prereleases = true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: Python

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions