You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Deep Research: max_tokens is never clamped to the context window, and the failure blames the wrong limit #7965
Synthesis requests 16384 at :2711 and :2735. _loaded_context_length() exists and is used to size evidence (:833) and gate auto-scrape (:2114), but never reaches the token budget.
Probed against the live server, gemma-4-12B at n_ctx_slot = 12288, from a UI Context Length of 12160:
The server accepts the oversized value and truncates at the context boundary, returning length. That's the condition :2654 branches on and :2683 raises from, so synthesis fails, retries with a slightly longer prompt, and fails again.
The message is then wrong: "Local model report reached its output limit before completion" points at an output cap the UI does not expose, when the binding constraint was the Context Length slider the user already set. The tooltip actively steers people here by telling them to lower context if the model will not fit in memory.
Fix: clamp max_tokens to n_ctx - prompt_tokens, and distinguish context exhaustion from a genuine output-cap hit so the message names the lever that matters.
Activity
Clamp Deep Research max_tokens to loaded context window (Fixes unslot…
Clamp Deep Research max_tokens to loaded context window (#7985)