You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: ag-ui endpoint drops a text delta that equals the whole text streamed so far #9336
While streaming through the ag-ui endpoint, a text delta is silently dropped when its text happens to equal the accumulated text of the current message. If the model streams "2" and then another "2" (it is answering "22"), the second delta never gets emitted and the client only sees "2".
Expected Behavior
Repeated short tokens are normal deltas and should be appended. The full replay guard added for #4194 should not fire on them.
Steps to Reproduce
Call _emit_text twice with identical text chunks on the same flow.
The second call returns no events.
flow.accumulated_text still holds only the first chunk.
Easy to hit with real token streams. Any answer that starts with a doubled digit or a repeated short token ("22", "55", "haha") triggers it since numbers and repeated words often come out as separate identical chunks.
Error Messages and Stack Traces
No error, the delta is just skipped with a debug log "Skipping duplicate full-text delta for message_id=...".
Package Versions
agent-framework-core and ag-ui built from main (dcbbf79)
Python Version
Python 3.14.8
Operating System
macOS
Regression
No
Additional Context
The guard exists to skip full message replays some providers send after streaming deltas (it mirrors the tool arguments fix in #4194). But a genuine repeated delta and a full replay look identical once the duplicate equals everything streamed so far. One way out: track how many deltas were already emitted for the message and only apply the replay guard when the text arrived in more than one chunk. That keeps the replay protection and stops eating repeated tokens. I can send a PR for this.
Acknowledgements
I searched existing issues and did not find a duplicate.
Activity
Python: fix(ag-ui): keep repeated single-chunk text deltas (microsoft…