fix(backend): probe the LLM with a budget a reasoning model can answer in #509
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/507-preflight-reasoning-probe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #507.
The hardware preflight's LLM probe asked for at most 128 output tokens, which on a reasoning model is no answer at all: the hidden thinking spends the whole budget before the first visible word, llama.cpp returns
finish_reason='length'with empty content, and the panel reported "Not measured" on the default self-hosted stack (qwen3.5), beside an endpoint that summarises whole sessions fine.reasoningis probed withPROBE_MAX_TOKENS_REASONING = 2048; everyone else keeps 128. Resolved throughllm_provider_foron the config, never sniffed from the URL. Bounded rather thanmax_tokens=None, so the probe stays bounded in time on exactly the slow hardware it exists to describe.retried_with_reasoning_budgetso the panel can say why the measurement took longer. One retry, never a loop.llm_service.OutputBudgetExhausted(aRuntimeErrorsubclass, so every existing caller and test is unchanged) types the llama.cpp raise, andUsageMeternow keeps the per-call truncation flagUsagealways carried, which is how the transports that return an empty string instead of raising are recognised. Nothing matches on operator-facing prose.tokens_per_secondstill counts reasoning tokens: they decode at the same rate and a real run pays for them through the same meter.Nine new tests, asserting on the
max_tokensthat goes over the wire through the existingMockTransportseam rather than on a patchedgenerate_structured_text. Full backend suite 2321 passed / 13 skipped; frontend 505 passed; ruff and eslint clean. No migration, no contract change.🤖 Generated with Claude Code