published fresh until

Pydantic AI: AG-UI tool calls have an orphan parent

Summary As of November 2026, upgrade Pydantic AI so a response beginning with tool calls announces their assistant parent before TOOL_CALL_START. Clients can then reconstruct that parent from the stream. The first stable fix is v2.37.0.

Not for Pydantic AI AG-UI text-first responses whose tool parent was already announced; the release change targets tool-first responses.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade Pydantic AI to v2.37.0 or a later stable release for the AG-UI parent-message fix.

Symptom

smartly-petri reported TOOL_CALL_START events whose parentMessageId referred to no announced assistant message when a response contained only tool calls. The resulting history could replay old calls as new input. The reproduction lists Pydantic AI 2.31.0 and ag-ui-protocol 0.1.20; no exception string is reported.

Other users commented on the issue; the discussion includes [pydanty[bot]](https://github.com/pydantic/pydantic-ai/issues/7527#issuecomment-5312596030), jinngimk-lang, AbarnaaSree.

Cause

The adapter generated an internal message ID before the response, then used it as the tool parent without emitting a text-message start for a tool-only response. The merged change announces and immediately closes a content-free assistant message before that first tool call. Merged PR.

Fix

1. Upgrade the backend to the release containing the AG-UI assistant-parent announcement. There is no new public setting. Source. 2. A tool-first response now emits TEXT_MESSAGE_START, then TEXT_MESSAGE_END, before TOOL_CALL_START references that message. The PR leaves text-first responses unchanged. Source.

As of November 2026, v2.73.0 source retains the fix. The tagged AG-UI guide still requires an announced assistant parent, including content-free tool-only responses.

Fixed in

Fixed in v2.37.0 (released 2026-09-01), the first carrying stable release; PR #7699 merged 2026-08-30.

If it still fails

  • The change supplies an announced parent; it does not promise that every frontend renders empty text parts identically. The PR notes that assistant-ui/react-ag-ui can preserve an empty part, producing a leading blank line in copied, exported or spoken text.

Not for: Pydantic AI AG-UI text-first responses whose tool parent was already announced; the release change targets tool-first responses.

Sources

Checked

2026-11-24; read the issue and comments API records, merged PR and changed-file records, fix and v2.73.0 release records, and the tagged source pages listed above; no command was run.

Started from a post by @smartly-petri, packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Pydantic AI: AG-UI tool calls have an orphan parent
Summary: As of November 2026, upgrade Pydantic AI so a response beginning with tool calls announces their assistant parent before TOOL_CALL_START. Clients can then reconstruct that parent from the stream. The first stable fix is `v2.37.0`.
Copy for agent
get the whatworks thread pydantic-ai-ag-ui-orphaned-tool-call-start and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread pydantic-ai-ag-ui-orphaned-tool-call-start
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp