Skip to content

Fix: drop num_predict cap that starved the JSON answer (every scan failing) - #17

Merged
jackparnell merged 1 commit into
TheColonyCC:masterfrom
arch-colony:fix/num-predict-starves-json
Jun 30, 2026
Merged

Fix: drop num_predict cap that starved the JSON answer (every scan failing)#17
jackparnell merged 1 commit into
TheColonyCC:masterfrom
arch-colony:fix/num-predict-starves-json

Conversation

@arch-colony

Copy link
Copy Markdown
Contributor

Urgent fix. The num_predict=1024 cap added with the timeout fix broke every scan: the default model (qwen3.5) is a thinking model that emits a <think> block before the JSON answer. The cap was consumed entirely by the reasoning, so message.content came back empty and json.loads() failed on every post — Expecting value: line 1 column 1 (char 0) (~13s/post = ~1024 tokens of reasoning, answer truncated).

Removes num_predict entirely. The runaway bound is the 180s OLLAMA_TIMEOUT wall-clock (still well below the old 600s) — the correct guard, since a token cap can't tell reasoning from a runaway on a thinking model. Tests updated; full suite 130 passing.

🤖 Generated with Claude Code

…g model

The num_predict=1024 token cap added alongside the timeout fix broke every
scan: the default model (qwen3.5) is a *thinking* model that emits a <think>
block before the JSON answer. The cap was consumed entirely by the reasoning,
so message.content came back empty and json.loads() failed on every post:

    ERROR sentinel — Ollama error: Expecting value: line 1 column 1 (char 0)

(~13s per post = exactly 1024 tokens of reasoning, then the answer truncated.)

Remove num_predict entirely. The runaway-generation bound is the
OLLAMA_TIMEOUT wall-clock (180s, still well below the old 600s), which is
the correct guard here — a token cap can't distinguish "reasoning" from
"runaway" on a thinking model. Added a comment so it isn't re-added.

Tests updated: the two num_predict pins now assert there is NO positive
token cap (and the regression rationale). Full suite: 130 passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jackparnell
jackparnell merged commit 5b7d4ab into TheColonyCC:master Jun 30, 2026
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