Follow-up to #453, with the cause the platform session found on stage: the batch triage warning ended with an empty answer.
Cause
LlmClient::chat() sends max_tokens: 4096. The model behind LiteLLM (Qwen3.8-27B) reasons first. Once the reasoning uses up the budget, the content is empty or an unclosed <think> block that without_reasoning removes, and the client returned "" without saying why.
Change (llm/client.rs, llm/types.rs)
The response now reads finish_reason.
An empty answer with finish_reason=length → the same request again, once, with 16384 tokens (logged at info).
Still no answer → an error "the model used its whole token budget reasoning and gave no answer (finish_reason=length)" instead of "". #453 then retries the affected findings in smaller chunks, and anything still unanswered stays as reported.
This applies to every chat()/chat_with_messages() caller: triage, control judge, code review and help chat. Tool calls are unaffected.
Not done (needs access to the LiteLLM config)
Switching off reasoning for JSON tasks (chat_template_kwargs.enable_thinking=false or /no_think) would be more efficient. Whether LiteLLM passes those parameters through for that model group can only be tested on stage.
Tests
New fake gateway in llm::client::budget_tests:
out of tokens at 4096, answers at 16384 → correct answer, requests [4096, 16384];
out of tokens both times → error with finish_reason=length, 2 requests;
Follow-up to #453, with the cause the platform session found on stage: the batch triage warning ended with **an empty answer**.
## Cause
`LlmClient::chat()` sends `max_tokens: 4096`. The model behind LiteLLM (Qwen3.8-27B) reasons first. Once the reasoning uses up the budget, the content is empty or an unclosed `<think>` block that `without_reasoning` removes, and the client returned **`""` without saying why**.
## Change (`llm/client.rs`, `llm/types.rs`)
- The response now reads `finish_reason`.
- **An empty answer with `finish_reason=length`** → the same request again, once, with **16384** tokens (logged at info).
- **Still no answer** → an error "the model used its whole token budget reasoning and gave no answer (finish_reason=length)" instead of `""`. #453 then retries the affected findings in smaller chunks, and anything still unanswered stays as reported.
- This applies to every `chat()`/`chat_with_messages()` caller: triage, control judge, code review and help chat. Tool calls are unaffected.
## Not done (needs access to the LiteLLM config)
Switching off reasoning for JSON tasks (`chat_template_kwargs.enable_thinking=false` or `/no_think`) would be more efficient. Whether LiteLLM passes those parameters through for that model group can only be tested on stage.
## Tests
New fake gateway in `llm::client::budget_tests`:
- out of tokens at 4096, answers at 16384 → correct answer, requests `[4096, 16384]`;
- out of tokens both times → error with `finish_reason=length`, 2 requests;
- normal answer → exactly 1 request with 4096.
fmt and clippy with the CI flags.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
On stage, a batch triage answer came back empty: the reasoning model
(Qwen3.8-27B behind LiteLLM) spent chat()'s 4096 tokens thinking, so the
content was empty or an unclosed <think> block, and the client returned ""
without saying why.
The client now reads finish_reason. An empty answer with
finish_reason=length is sent once more with 16384 tokens; if that gives
no answer either, the call fails with "the model used its whole token
budget reasoning and gave no answer (finish_reason=length)" instead of an
empty string. Covers every chat() and chat_with_messages() caller
(triage, control judge, code review, help chat).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 96da28dd3f into main2026-10-05 19:09:09 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #453, with the cause the platform session found on stage: the batch triage warning ended with an empty answer.
Cause
LlmClient::chat()sendsmax_tokens: 4096. The model behind LiteLLM (Qwen3.8-27B) reasons first. Once the reasoning uses up the budget, the content is empty or an unclosed<think>block thatwithout_reasoningremoves, and the client returned""without saying why.Change (
llm/client.rs,llm/types.rs)finish_reason.finish_reason=length→ the same request again, once, with 16384 tokens (logged at info)."". #453 then retries the affected findings in smaller chunks, and anything still unanswered stays as reported.chat()/chat_with_messages()caller: triage, control judge, code review and help chat. Tool calls are unaffected.Not done (needs access to the LiteLLM config)
Switching off reasoning for JSON tasks (
chat_template_kwargs.enable_thinking=falseor/no_think) would be more efficient. Whether LiteLLM passes those parameters through for that model group can only be tested on stage.Tests
New fake gateway in
llm::client::budget_tests:[4096, 16384];finish_reason=length, 2 requests;fmt and clippy with the CI flags.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p