Repository navigation
Description
Observed Behavior
AGUIHttpService only reads lines that start with data: (with a space). In SSE the space after data: is optional, and some servers send data:{...}. All of those events are skipped, so AGUIChatClient returns an empty response and no error.
Expected Behavior
Both data: {...} and data:{...} are parsed, as the SSE spec says: one leading space after the colon is removed if present.
Steps to Reproduce
- Point
AGUIChatClientat a server that writes SSE lines asdata:{...} - Call
get_response - The response text is empty
Minimal Reproduction
import asyncio
import json
import httpx
from agent_framework_ag_ui import AGUIChatClient
EVENTS = [
{"type": "RUN_STARTED", "threadId": "t1", "runId": "r1"},
{"type": "TEXT_MESSAGE_START", "messageId": "m1", "role": "assistant"},
{"type": "TEXT_MESSAGE_CONTENT", "messageId": "m1", "delta": "Hello from the server"},
{"type": "TEXT_MESSAGE_END", "messageId": "m1"},
{"type": "RUN_FINISHED", "threadId": "t1", "runId": "r1"},
]
async def run(prefix: str) -> None:
def handler(request: httpx.Request) -> httpx.Response:
body = "".join(f"{prefix}{json.dumps(e)}\n\n" for e in EVENTS)
return httpx.Response(200, headers={"content-type": "text/event-stream"}, text=body)
http = httpx.AsyncClient(transport=httpx.MockTransport(handler))
client = AGUIChatClient(endpoint="http://server/", http_client=http)
response = await client.get_response("hi")
print(f"{prefix!r:9} -> {response.text!r}")
asyncio.run(run("data: "))
asyncio.run(run("data:"))Error Messages and Stack Traces
'data: ' -> 'Hello from the server'
'data:' -> ''
Package Versions
agent-framework-core 1.25.0, agent-framework-ag-ui 1.8.0 (main at fe87fdd), httpx 0.28.1
Python Version
Python 3.12
Operating System
macOS
Regression
No
Additional Context
The check is line.startswith("data: ") in post_run in _http_service.py. A fix could be to match data: and drop one leading space if there is one. I have a fix with a test and will open a PR.
AI assistance: I used an AI assistant to help find the cause and write this up. I ran the repro myself.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
github-actions commentedon Nov 10, 2026
Reproduced on
main(fe87fdd) using a local httpx MockTransport:data: {...}returns'Hello from the server', while(redacted) returns''. The cause isline.startswith("data: ")athttpservice.pyline 272 inpython/packages/ag-ui/agent_framework_ag_ui`. Routed to the ag-ui owner.Support boundary: unclear. The linked SSE spec describes the behavior, but I didn't find an Agent Framework doc or ADR that states it. A maintainer should decide the scope. Fix PR #10249 is open and I haven't verified it.
Run: https://github.com/microsoft/agent-framework/actions/runs/42881586491