Skip to content

Python: fix(ag-ui): read tool_call_id on TOOL_CALL_RESULT events - #8734

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
anishmehta24:fix/ag-ui-tool-result-snake-case-id
Sep 28, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
anishmehta24:fix/ag-ui-tool-result-snake-case-id

Conversation

@anishmehta24

Copy link
Copy Markdown
Contributor

Motivation & Context

AGUIEventConverter._handle_tool_call_result only read toolCallId. The other tool call handlers go through _get_tool_call_id, which accepts both toolCallId and tool_call_id, so a result sent with the snake_case spelling came back with an empty call_id and was no longer linked to its call:

converter.convert_event({"type": "TOOL_CALL_RESULT", "tool_call_id": "c1", "content": "sunny"})
# contents[0].call_id == ""

Description & Review Guide

  • What are the major changes? Use _get_tool_call_id(event) in _handle_tool_call_result like the other handlers.
  • What is the impact of these changes? Tool results with tool_call_id keep their call id.
  • What do you want reviewers to focus on? Nothing else changes; toolCallId still takes precedence.

Related Issue

No existing issue.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible

Test: test_tool_call_result_event_snake_case_id in tests/ag_ui/test_event_converters.py; it fails on main. The file passes and the repo's pre-commit checks are clean.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Sep 24, 2026
Merged via the queue into microsoft:main with commit fd932dc Sep 28, 2026
50 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 81bccc4e Deployed Sep 24, 2026 by anishmehta24 via team_check #5245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants