Skip to content

coli: honor THINK=1 in run mode#402

Merged
JustVugg merged 1 commit into
JustVugg:devfrom
anrasi:fix/coli-run-think
Jul 19, 2026
Merged

coli: honor THINK=1 in run mode#402
JustVugg merged 1 commit into
JustVugg:devfrom
anrasi:fix/coli-run-think

Conversation

@anrasi

@anrasi anrasi commented Jul 19, 2026

Copy link
Copy Markdown

Summary

coli run hardcodes the nothink template β€” <|assistant|><think></think> β€” so THINK=1 silently has no effect in one-shot runs: the reasoning block is pre-closed before the engine sees a token. Serve mode already picks the template from the env in glm.c (getenv("THINK") && atoi(...) ? "<think>" : "<think></think>"). This PR makes cmd_run pick it the same way: two lines, default unchanged (nothink), and ENVIRONMENT.md's "THINK=1 turns on visible reasoning" now holds for run the way it does for serve.

Noticed on a DGX Spark GB10 while batch-running long planning prompts through coli run: outputs consistently opened with an empty <think></think> despite THINK=1 in the environment. With the patch the model emits its reasoning block; we've been running exactly this change locally for multi-hour THINK batches on the 744B model today.

coli chat needs no change β€” it hands the raw text to the engine, whose template already honors THINK.

Validation

  • make -C c check β€” clean build, C unit tests, and the Python suite (73 tests) green on this branch (aarch64, gcc 13.3)
  • CUDA β€” n/a (launcher-only change)
  • No performance claims

Compatibility

  • The default CPU build remains dependency-free (stdlib os.environ only)
  • No model files, generated binaries, or benchmark artifacts

πŸ€– Generated with Claude Code

coli run hardcoded the nothink template (<|assistant|><think></think>),
so THINK=1 had no effect in one-shot runs while serve mode honors it
(glm.c serve template picks <think> vs <think></think> from the same
env var). Pick the template the same way here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants