From fd4a171d3ce2d4d5bcdab13eecc7fbba41343e7e Mon Sep 17 00:00:00 2001 From: Dylan Huang Date: Mon, 29 Sep 2025 15:06:46 -0700 Subject: [PATCH] better error message --- eval_protocol/pytest/remote_rollout_processor.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/eval_protocol/pytest/remote_rollout_processor.py b/eval_protocol/pytest/remote_rollout_processor.py index e2fabddd..d6e563a4 100644 --- a/eval_protocol/pytest/remote_rollout_processor.py +++ b/eval_protocol/pytest/remote_rollout_processor.py @@ -121,8 +121,19 @@ async def _process_row(row: EvaluationRow) -> EvaluationRow: # Fire-and-poll def _post_init() -> None: url = f"{remote_base_url}/init" - r = requests.post(url, json=init_payload.model_dump(), timeout=30) - r.raise_for_status() + try: + r = requests.post(url, json=init_payload.model_dump(), timeout=30) + r.raise_for_status() + except requests.exceptions.Timeout: + raise TimeoutError( + "The /init endpoint timed out after 30 seconds. " + "CRITICAL: The /init endpoint must return immediately (within 30s) and NOT block on rollout execution. " + "Your remote server should:\n" + "1. Accept the /init request and return a 200 response immediately\n" + "2. Process the actual rollout asynchronously in the background\n" + "3. Use the /status endpoint to report progress\n" + "For Python/Node.js: Start a separate process per rollout to avoid blocking the /init response." + ) await asyncio.to_thread(_post_init)