fix: tool call history loop in local agent#20
Merged
Conversation
The tool-calling loop in LocalAgent omitted tool_calls from assistant messages pushed to conversation history. This caused the model to not correlate tool results with prior requests, re-issuing tool calls each round until MAX_TOOL_ROUNDS. Also filters malformed tool call entries to prevent TypeError crashes from null/undefined entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qwen3:8b's thinking mode generates hundreds of hidden reasoning tokens even for simple prompts, causing multi-minute response times. Switch to qwen2.5-coder:7b which is code-focused, has no thinking overhead, and responds much faster. Also strip <think> tags from responses in case any model leaks thinking content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vailable Instead of exiting with a manual install message, fall back to `curl -fsSL https://ollama.com/install.sh | sh` on macOS when Homebrew is not found — matching the officially recommended method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_callsin assistant messages pushed to conversation history so the model can correlate tool results with prior requests — without this, the model re-issues tool calls each round untilMAX_TOOL_ROUNDS(5), causing a ~30-60s "loop" during simple promptstool_callsentries before processing to preventTypeErrorcrashes from null/undefined entries returned by some models (e.g. qwen3)Test plan
tool_callsafter tool executiontool_calls(null/undefined entries) treated as no tool calls🤖 Generated with Claude Code