[BUG] Tool calls trottling LLM
Tool calls(same command) trottling LLM with eventual RATE LIMIT error-
Here is the log, let me know I can help debug this issue, have been seeing this quite frequently.
Using ECA 0.89.0 on emacs. This has been a issue for a while, I have noticed this in previous versions of ECA as well. LLM being used is Mistral Devstral-2-small, although this issue occurs with other LLMs as well
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos", "pattern" "PathInjector\\.new.*inject_path"}'
[TOOLS] Calling tool 'eca__read_file' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "line_offset" 1910, "limit" 30}'
[TOOLS] Calling tool 'eca__read_file' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "line_offset" 1940, "limit" 30}'
[TOOLS] Calling tool 'eca__read_file' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "line_offset" 1970, "limit" 30}'
[TOOLS] Calling tool 'eca__read_file' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "line_offset" 2000, "limit" 100}'
[TOOLS] Calling tool 'eca__read_file' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "line_offset" 2100, "limit" 100}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[TOOLS] Calling tool 'eca__grep' with args '{"path" "/home/mypc/git-repos/build-emacs-for-macos/build-emacs-for-macos", "pattern" "inject_path.*true", "max_results" 5}'
[OPENAI-CHAT] 7403 Unexpected response status: %s body: %s 429 {"object":"error","message":"Rate limit exceeded","type":"rate_limited","param":null,"code":"1300"}
{:message LLM response status: 429 body: {"object":"error","message":"Rate limit exceeded","type":"rate_limited","param":null,"code":"1300"}}
:db/upsert-cache 7ms
@CsBigDataHub Unfortunately I don't think there is much to do as this seems to be LLM's fault, byt maybe we could add some check if the same tool is being called with same args for 5-10 times in a row, but even so, not sure what we would do. c/c @zikajk
maybe we could add some check if the same tool is being called with same args for 5-10 times in a row.
Yes that would make sense but I have not experienced this issue when using the same LLM and provider in GPTEL or Mistral's vibe cli.
Also I have only noticed this with grep tool, may be we can tweak the prompt?
This is the GREP prompt from GPTEL-AGENT
https://github.com/karthink/gptel-agent/blob/99a8b940271fbe68cdfb7c2329d090dc4ef04b99/agents/gptel-agent.md?plain=1#L235
<tool name="Grep">
**When to use `Grep`:**
- Finding ONE specific, well-defined string/pattern in the codebase
- You know what you're looking for and where it likely is
- Verifying presence/absence of specific text
- Quick, focused searches with expected results <20 matches
**When NOT to use `Grep`:**
- **Building code understanding or exploring unfamiliar code** → DELEGATE to `researcher`
- **Expected to get many results (20+ matches)** → DELEGATE to `researcher`
- **Will need follow-up searches based on results** → DELEGATE to `researcher`
- Searching for files by name → use `Glob`
- Reading known file contents → use `Read`
**How to use `Grep`:**
- Supports full regex syntax (ripgrep-based)
- Can specify directory path and glob pattern to narrow scope
- Use `context_lines` parameter to see surrounding lines
- Can perform multiple focused grep searches in parallel
- **If you find yourself doing a second grep based on first results, you should have used `researcher`**
</tool>
vibe cli grep prompt is dry
https://github.com/mistralai/mistral-vibe/blob/main/vibe/core/tools/builtins/prompts/grep.md?plain=1
Yeah maybe, the hard thing is know what to tweak exactly without afecting the tool or results or even other models that already work
Yeah I get it, dense model vs smart model.
I agree that it might be a prompt/tool problem. I'm using local qwen3-coder-next, works wonderfully but does not like the read file command. Sometimes it works around it by calling head+tail. It surely knows where to read ("Let me try a different approach and read the file at offset 285:", but then always call the function with limit=X instead of offset=X), while all other commands works perfectly, but never had problems with grep, so probably the fix is model-based => each user using "small" models should tweak the tools instructions maybe
Yeah, I wonder if the problem is that those models are trying to mimic Claude Code. We can always just translate some invalid params to valid ones but we would have to create a dictionary.