From 94353f9ac71bdbe60109ec57139e646d9dd2e154 Mon Sep 17 00:00:00 2001 From: EMRG Evolution Date: Thu, 20 Aug 2026 20:46:46 +0800 Subject: [PATCH] =?UTF-8?q?emrg:=20vibe=20check=20no=20timeout=20=E2=80=94?= =?UTF-8?q?=20wait=20for=20the=20completion=20judgment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rant 2026-08-20T20:19:31: the 20s deadline in _request_vibe_check drops the work/reason data when concurrent tasks hold the LLM (a single vibe check call can exceed 20s). The vibe check is the completion judgment right after a finished cycle — waiting longer for an accurate result beats dropping it. Remove the deadline; the daemon's LLM call keeps its own retry/timeout and a dead daemon raises ConnectionClosed, so the wait is bounded in practice. --- emrg/server/scheduler.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/emrg/server/scheduler.py b/emrg/server/scheduler.py index af62aa9..33a9acb 100644 --- a/emrg/server/scheduler.py +++ b/emrg/server/scheduler.py @@ -622,9 +622,14 @@ def _saturation_heartbeat_active(self) -> bool: async def _request_vibe_check(self, ws, prompt: str, completion_summary: str) -> dict | None: """Ask the daemon for a structured vibe check on the SAME connection. - Sends ``task_vibe_check`` and waits for ``vibe_check_result`` (~20s). - Fully defensive — any failure/timeout returns None; the caller - conservatively leaves the slowdown state unchanged. + Sends ``task_vibe_check`` and waits for ``vibe_check_result``. Rant + 2026-08-20T20:19:31: no timeout — the vibe check is the completion + judgment right after a finished cycle; when concurrent tasks hold the + LLM a single call can exceed 20s, and waiting longer for an accurate + work/reason beats dropping the data (the daemon's LLM call has its own + retry/timeout, and a dead daemon raises ConnectionClosed). + Fully defensive — any failure/connection-close returns None; the + caller conservatively leaves the slowdown state unchanged. """ try: await ws.send(json.dumps({ @@ -635,13 +640,9 @@ async def _request_vibe_check(self, ws, prompt: str, completion_summary: str) -> "prompt": (prompt or "")[:2000], "completion_summary": (completion_summary or "")[:3000], }, ensure_ascii=False)) - deadline = time.monotonic() + 20.0 - while time.monotonic() < deadline: - remaining = max(0.5, deadline - time.monotonic()) + while True: try: - frame = json.loads(await asyncio.wait_for(ws.recv(), timeout=remaining)) - except asyncio.TimeoutError: - break + frame = json.loads(await ws.recv()) except ConnectionClosed: break if frame.get("type") != "vibe_check_result":