The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(api-server): build run-events test streams as _RunStream after the replay rewrite
kshitijk4poorc35c9178754b
diff --git a/tests/gateway/test_api_server_runs.py b/tests/gateway/test_api_server_runs.pyindex 6774117a25a..f3dcb86724e 100644--- a/tests/gateway/test_api_server_runs.py+++ b/tests/gateway/test_api_server_runs.py@@ -871,9 +871,9 @@ class TestRunEventsCORS:@staticmethoddef _prime_closed_stream(adapter, run_id):_claim_run(adapter, run_id)- q: asyncio.Queue = asyncio.Queue()- q.put_nowait(None) # run finished: handler writes ": stream closed" and returns- adapter._run_streams[run_id] = q+ stream = _RunStream()+ stream.put_nowait(None) # run finished: handler writes ": stream closed" and returns+ adapter._run_streams[run_id] = stream@pytest.mark.asyncioasync def test_events_cors_headers_present_for_allowed_origin(self):@@ -2595,7 +2595,7 @@ class TestRunEventsHeadFlush:run_id = "run_silent_head"# A registered run whose queue stays empty for the whole test — the# exact shape of "subscribed before the first event was emitted".- adapter._run_streams[run_id] = asyncio.Queue()+ adapter._run_streams[run_id] = _RunStream()_claim_run(adapter, run_id)async with TestClient(TestServer(app)) as cli: