Skip to content

The agent that grows with you

test(api-server): keep the behavioural run-output test, drop the source-reading guard

teknium116ec8a35eb37
diff --git a/tests/gateway/test_session_api.py b/tests/gateway/test_session_api.py
index fb4efbdfdf1..e263d74c95b 100644
--- a/tests/gateway/test_session_api.py
+++ b/tests/gateway/test_session_api.py
@@ -1092,42 +1092,3 @@ async def test_session_stream_records_reply_text_for_post_disconnect_recovery(
response = await adapter._handle_get_run(get_request)
assert response.status == 200
assert "the answer worth keeping" in response.text
-
-
-async def test_both_run_routes_record_output(adapter):
- """Structural guard against the asymmetry coming back.
-
- The two routes that mint run ids must both persist the reply text. A future
- edit that drops `output=` from either one silently removes the recovery
- path, and no behavioural test of the *other* route would notice.
- """
- from pathlib import Path
-
- src = (
- Path(__file__).resolve().parents[2]
- / "gateway"
- / "platforms"
- / "api_server.py"
- ).read_text(encoding="utf-8")
-
- for name, anchor in (
- ("session stream", "async def _handle_session_chat_stream"),
- ("/v1/runs", "async def _handle_runs"),
- ):
- start = src.index(anchor)
- # Anchor on the terminal STATUS WRITE, not on the string "completed" —
- # the SSE payload carries a `"completed": True` key that would match a
- # naive search and hide a missing output=.
- cursor = start
- window = None
- while True:
- call_at = src.find("_set_run_status(", cursor)
- assert call_at != -1, f"{name}: no terminal _set_run_status found"
- candidate = src[call_at:call_at + 2000] # generous: the call may carry comments
- if '"completed",' in candidate[:400]:
- window = candidate
- break
- cursor = call_at + 1
-
- assert "output=" in window, f"{name} no longer records the reply text"