* fix(book): retry an interactive page with thinking off when it runs out of room
deepseek-flash thinks by default and can spend the whole 16000-token
visualize budget on reasoning, so a book interactive block came back with
no code. When the page is empty or cut off before </html>, ask once more
with thinking turned off (thinking_off_effort_for) before failing. If that
still runs out of room, the error names the budget sent to the model and
the settings that change it.
The shipped default stays at 16000: the budget is shared by every visualize
caller, and 32768 breaks models with a lower output cap (#3018).
Refs #3011
* fix(llm): raise the visualize budget to 32k and cap each request to the model
A thinking model can spend 16k tokens before it writes any code, so the
visualize default is now 32768. Sent unchanged that would be rejected by
models whose output stops lower (gpt-4o and gpt-4o-mini at 16384) and could
overflow a small local context window, so every request now carries
min(budget, the model's known output limit, half the configured context
window). The cap lives in get_token_limit_kwargs, so it applies to every
caller; BaseAgent and the agentic loop pass the configured window.
deepseek-flash thinks by default and spent the whole 16000-token visualize
budget on reasoning, so book interactive blocks came back with no code.
Raise the default to 32768 and make the book's interactive errors name the
two settings that fix it: Max tokens under Settings -> Capabilities ->
Visualize, or turning off thinking for the model.
* fix(book): reject incomplete interactive HTML
Normalize wrapped HTML and require complete document and script boundaries so truncated output follows the existing retry/error path instead of being persisted as READY.
* fix(book): end interactive html at its real </html> and name truncation
Find the document end with the HTML parser instead of the last </html> or
the first code fence: script bodies stay raw text, so a fence in <pre>, an
end tag in a script string or prose after the page no longer moves the end.
A reply whose fence never closes is accepted when the document is complete,
and a cut-off document now says it was probably cut off.
---------
Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>