fix(compiler): don't cap concepts-plan at max_tokens=2048 (empty plans on reasoning models)#90
Open
cnndabbler wants to merge 1 commit into
Open
Conversation
Reasoning/thinking models can exhaust a 2048-token budget before emitting the JSON plan, yielding empty output -> unparseable plan -> zero concept pages (silently). Remove the cap so concepts-plan matches the uncapped summary call.
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.
Problem
The
concepts-planLLM call is hard-capped atmax_tokens=2048:With reasoning / thinking models (e.g.
ollama/qwen3.6:27b, deepseek reasoners), the model can spend the entire 2048-token budget on reasoning before emitting any JSON, so the response comes back empty. The plan then fails to parse and zero concept pages are generated — silently, while the doc is still marked[OK]:This is the failure in #80 (
model: ollama/qwen3.6:27b). Observed hitting ~50% of docs with a local thinking model before the cap was lifted.Fix
Remove the
max_tokens=2048cap soconcepts-planis uncapped, matching the existing uncappedsummarycall in the same pipeline. Content-rich plans (and reasoning-model preludes) then complete instead of truncating to empty.Note / alternative
If a hard ceiling is preferred for cost control, an alternative would be to make it configurable (e.g. a
concepts_plan_max_tokensconfig key, default high orNone) rather than a fixed 2048. Happy to adjust to whichever you prefer — but the current fixed 2048 is too low for reasoning models and fails closed (empty output → no concepts).Fixes #80.