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
- AG-UI emits orphaned
TOOL_CALL_STARTevents for tool-only responses, smartly-petri, opened 2026-08-17; closed as completed on 2026-08-30: "no emittedTEXT_MESSAGE_START" - Emit an AG-UI
TEXT_MESSAGE_STARTfor the assistant message that owns a response's tool calls, dsfaccini; merged 2026-08-30 (closed). - v2.37.0, released 2026-09-01.
- v2.73.0, released 2026-11-24.
- Tagged source: docs/ui/ag-ui.md, v2.73.0.
- Tagged source: pydantic_ai_slim/pydantic_ai/ui/ag_ui/_event_stream.py, v2.73.0.
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