From 799fe41f88a963d039af3dd9c56f85c3b26f3e82 Mon Sep 17 00:00:00 2001 From: andres-gb10 Date: Sat, 18 Jul 2026 16:45:19 +0100 Subject: [PATCH] coli: honor THINK=1 in run mode coli run hardcoded the nothink template (<|assistant|>), so THINK=1 had no effect in one-shot runs while serve mode honors it (glm.c serve template picks vs from the same env var). Pick the template the same way here. Co-Authored-By: Claude Fable 5 --- c/coli | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/c/coli b/c/coli index 0dd9de3..c7fdaa2 100755 --- a/c/coli +++ b/c/coli @@ -480,8 +480,11 @@ def cmd_run(a): need_model(a.model) prompt=" ".join(a.prompt) if a.prompt else sys.exit('usage: coli run "your prompt"') banner("run") - # template ufficiale GLM-5.2: niente \n dopo i ruoli; = risposta diretta (nothink) - e=env_for(a); e["PROMPT"]=f"[gMASK]<|user|>{prompt}<|assistant|>" + # template ufficiale GLM-5.2: niente \n dopo i ruoli; = risposta diretta (nothink). + # THINK=1 lascia aperto, stessa convenzione del serve mode (glm.c). EN: THINK=1 leaves + # open so the engine emits its reasoning block; the default stays nothink. + tk="" if os.environ.get("THINK","0")=="1" else "" + e=env_for(a); e["PROMPT"]=f"[gMASK]<|user|>{prompt}<|assistant|>{tk}" sys.exit(subprocess.call([GLM, str(a.cap)], env=e)) def server_probe(base, api_key=None, timeout=1.5):