From b79610852bc1e27bdde89bfa514e701ec951303f Mon Sep 17 00:00:00 2001 From: Skeldoor Date: Wed, 15 Jul 2026 13:37:36 +0100 Subject: [PATCH] coli: consume the engine's TIERS line at startup so it doesn't leak into the first answer After the READY handshake, run_serve emits one TIERS status line (the web-dashboard expert-pyramid snapshot). cmd_chat never read it, so in interactive chat it surfaced as literal "TIERS 0 181 19275 0.00 ..." text prepended to the first response. Read and discard that one line after READY, matching how the other status frames are consumed. Chat-only; the HTTP serve path already drains it. Co-Authored-By: Claude Fable 5 --- c/coli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c/coli b/c/coli index 8c89caf..933f635 100755 --- a/c/coli +++ b/c/coli @@ -438,6 +438,8 @@ def cmd_chat(a): try: errlog.write(p.stderr.read().decode("utf-8","replace")) except (OSError, ValueError): pass errlog.seek(0); print(errlog.read()[-1500:]); sys.exit("the engine exited while loading") + p.stdout.readline() # TIERS line (web-dashboard protocol): emitted once right after STAT; + # left unread it leaks into the first answer's text # READY received. Drain the child's stderr into errlog without blocking: # the engine is still alive (blocked on stdin), so a plain read() would # hang forever waiting for EOF. A short bounded drain grabs the ~400 bytes