openclaw - 💡(How to fix) Fix [Bug]: asking weather is being repeatedly in an infinite loop due to an error. [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68578Fetched 2026-04-19 15:10:00
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

When asking about the weather, the weather tool is being called repeatedly in an infinite loop due to an error. the tool output "Tool weather not found", but nothing happened. the session would ask the same question about weather then the LM Studio(Gemma4) would feedback call "weather" tool. Causes an infinite loop. Causes an infinite loop. Causes an infinite loop.

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":"\n"},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"984047191","type":"function","function":{"name":"weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"type":"function","function":{"arguments":"{"url":"wttr.in/Shanghai?format=v2"}"}}]},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[],"usage":{"prompt_tokens":16495,"completion_tokens":27,"total_tokens":16522,"completion_tokens_details":{"reasoning_tokens":1}}}

Error Message

When asking about the weather, the weather tool is being called repeatedly in an infinite loop due to an error.

Root Cause

  • This issue occurs because the LLM returns an incorrect tool call. Some models may behave this way.
  • It would be helpful if OpenClaw could include the tool execution failure details in the next prompt when retrying after a failed tool call.
  • This way, even if the LLM initially returns incorrect information, it still has a chance to correct itself on the second or third attempt.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When asking about the weather, the weather tool is being called repeatedly in an infinite loop due to an error. the tool output "Tool weather not found", but nothing happened. the session would ask the same question about weather then the LM Studio(Gemma4) would feedback call "weather" tool. Causes an infinite loop. Causes an infinite loop. Causes an infinite loop.

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":"\n"},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"984047191","type":"function","function":{"name":"weather","arguments":""}}]},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"type":"function","function":{"arguments":"{"url":"wttr.in/Shanghai?format=v2"}"}}]},"logprobs":null,"finish_reason":null}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}]}

data: {"id":"chatcmpl-3voetw0a3wxxfqjxt23jl","object":"chat.completion.chunk","created":1776512800,"model":"google/gemma-4-26b-a4b","system_fingerprint":"google/gemma-4-26b-a4b","choices":[],"usage":{"prompt_tokens":16495,"completion_tokens":27,"total_tokens":16522,"completion_tokens_details":{"reasoning_tokens":1}}}

Steps to reproduce

  • just config the model: local LM Studio Gemma4-27b-a4b
  • new/reset session
  • just ask how is the weather
  • LLM feedback :<|tool_call>call:weather{url:"https://wttr.in/Shanghai?format=3\"}<tool_call|>
  • Tool weather not found, then infinite loop

Expected behavior

  • This issue occurs because the LLM returns an incorrect tool call. Some models may behave this way.
  • It would be helpful if OpenClaw could include the tool execution failure details in the next prompt when retrying after a failed tool call.
  • This way, even if the LLM initially returns incorrect information, it still has a chance to correct itself on the second or third attempt.

Actual behavior

It keeps showing "Tool weather not found" and retries endlessly, resulting in an infinite loop.

OpenClaw version

v2026.4.14

Operating system

macOS 26.3

Install method

curl -fsSL https://openclaw.ai/install.sh | bash

Model

gemma4-26b-a4b

Provider / routing chain

LM Studio

Additional provider/model setup details

"providers": { "lmstudio": { "baseUrl": "http://127.0.0.1:1234/v1", "api": "openai-completions", "models": [ { "id": "gemma-4-26b-a4b", "name": "gemma-4-26b-a4b", "api": "openai-completions", "reasoning": false, "input": [ "text", "image" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072, "maxTokens": 8192 } ] }

Logs, screenshots, and evidence

Impact and severity

The probability of occurrence is around 90%

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by modifying the OpenClaw configuration to handle tool execution failure details and prevent infinite loops when the LLM returns an incorrect tool call.

Guidance

  • Review the OpenClaw configuration to ensure it is set up to handle tool execution failures and provide detailed error messages.
  • Consider adding a retry mechanism with a limited number of attempts to prevent infinite loops.
  • Verify that the LLM model (Gemma4-26b-a4b) is correctly configured and updated to the latest version.
  • Check the LM Studio provider setup to ensure it is correctly routing requests and handling responses.

Example

No code example is provided as the issue is related to configuration and setup.

Notes

The issue is specific to the Gemma4-26b-a4b model and the OpenClaw version v2026.4.14. The solution may not apply to other models or versions.

Recommendation

Apply a workaround by modifying the OpenClaw configuration to handle tool execution failures and prevent infinite loops. This will allow the system to recover from incorrect tool calls and provide a better user experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • This issue occurs because the LLM returns an incorrect tool call. Some models may behave this way.
  • It would be helpful if OpenClaw could include the tool execution failure details in the next prompt when retrying after a failed tool call.
  • This way, even if the LLM initially returns incorrect information, it still has a chance to correct itself on the second or third attempt.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: asking weather is being repeatedly in an infinite loop due to an error. [1 participants]