feat(api): Implement agent streaming router with SSE

This commit is contained in:
Yunxiao Xu
2026-02-10 15:49:15 -08:00
parent 057278a1c5
commit b8fa60962e
3 changed files with 101 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ async def test_stream_agent_success(auth_header):
json={"message": "hello", "thread_id": "t1"},
headers=auth_header) as response:
assert response.status_code == 200
assert response.headers["content-type"] == "text/event-stream"
assert "text/event-stream" in response.headers["content-type"]
lines = list(response.iter_lines())
# Each event should start with 'data: ' and be valid JSON