Fix: drop num_predict cap that starved the JSON answer (every scan failing) - #17
Merged
jackparnell merged 1 commit intoJun 30, 2026
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Urgent fix. The
num_predict=1024cap 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, somessage.contentcame back empty andjson.loads()failed on every post —Expecting value: line 1 column 1 (char 0)(~13s/post = ~1024 tokens of reasoning, answer truncated).Removes
num_predictentirely. The runaway bound is the 180sOLLAMA_TIMEOUTwall-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