rony-llm-agent/pkg/llm/providers/llamacpp
Victor Vargas 8e887c8c78 fix(agent,llamacpp): recover turns killed by unparsed tool calls and reasoning spirals
Two failure modes seen live with Qwen3.6 on llama.cpp ended turns silently
mid-task:

- The model writes its tool call as plain text inside its reasoning, the
  server never parses it, and the round ends with nothing executed. The
  loop now detects the markers and nudges the model to re-issue the call
  for real (max 2 per turn).

- llama.cpp silently ignores the max_thinking_tokens field, so a model in
  a reasoning spiral ran until max_tokens (seen live: 25k+ tokens of
  nonstop thinking, ~20 min). The llamacpp client now enforces the budget
  client-side during Stream: once exceeded while the round is still pure
  reasoning, it cuts with FinishThinkingBudget and aborts the request
  (freeing the server slot); the loop answers with its own corrective
  nudge, on a separate counter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 14:50:45 -07:00
..
client.go fix(agent,llamacpp): recover turns killed by unparsed tool calls and reasoning spirals 2026-07-15 14:50:45 -07:00
client_test.go style: gofmt 2026-07-12 16:14:15 -07:00
thinking_budget_test.go fix(agent,llamacpp): recover turns killed by unparsed tool calls and reasoning spirals 2026-07-15 14:50:45 -07:00