Skip to content

Chat: finalize gracefully at tool-call cap + stop redundant loops #14

Merged
YuliiaKovalova merged 1 commit into
mainfrom
fix/chat-tool-call-loop
Jun 8, 2026
Merged

Chat: finalize gracefully at tool-call cap + stop redundant loops #14
YuliiaKovalova merged 1 commit into
mainfrom
fix/chat-tool-call-loop

Conversation

@YuliiaKovalova

Copy link
Copy Markdown
Contributor

The @binlog chat participant hit a hardcoded round cap (depth > 10) and dead-ended with "Too many tool calls — stopping here." producing no answer, even after dozens of successful tool calls. The model also looped, re-issuing near-identical perf-tool calls (expensive_targets/tasks/projects with only cosmetic arg changes) until it exhausted the budget.

  • Graceful finalization: at the cap, make one final tool-free request so the model synthesizes a response from the data already gathered (reuses the existing no-tools fallback pattern).
  • Repeat-call short-circuit: byte-identical tool calls (name + args) reuse the earlier result instead of re-querying the MCP server, so commands like /summary converge within budget. Errored calls are not memoized, so transient failures remain retryable.
  • System-prompt tool-use efficiency rule: instruct the model to call each tool at most once per distinct args and stop once it can answer.

Bumps version to 0.10.25 and updates CHANGELOG.

….10.25)

The @binlog chat participant hit a hardcoded round cap (depth > 10) and
dead-ended with "Too many tool calls — stopping here." producing no answer,
even after dozens of successful tool calls. The model also looped, re-issuing
near-identical perf-tool calls (expensive_targets/tasks/projects with only
cosmetic arg changes) until it exhausted the budget.

- Graceful finalization: at the cap, make one final tool-free request so the
  model synthesizes a response from the data already gathered (reuses the
  existing no-tools fallback pattern).
- Repeat-call short-circuit: byte-identical tool calls (name + args) reuse the
  earlier result instead of re-querying the MCP server, so commands like
  /summary converge within budget. Errored calls are not memoized, so transient
  failures remain retryable.
- System-prompt tool-use efficiency rule: instruct the model to call each tool
  at most once per distinct args and stop once it can answer.

Bumps version to 0.10.25 and updates CHANGELOG.

Co-authored-by: Copilot <[email protected]>
@YuliiaKovalova YuliiaKovalova merged commit 704434c into main Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant