openclaw - ✅(Solved) Fix [Bug]: 工具参数验证错误触发无限循环(read/web_fetch 等) [1 pull requests, 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#68026Fetched 2026-04-18 05:54:23
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1

当工具的参数验证失败时,错误未被标记为 retryable: false,导致 OpenClaw 框架无限重试,形成循环调用。该问题影响多个工具(read、web_fetch 等),造成 API 费用浪费和用户体验灾难。

Error Message

  1. 其他工具 - 任何在参数验证时直接抛出普通 Error 的工具都可能触发相同问题
  2. Trigger a tool parameter validation error (e.g., call read with empty path or web_fetch with invalid URL)
  3. Observe the error is not marked as retryable: false
  4. Check logs for repeated error messages (hundreds of times) Parameter validation errors should be marked as non-retryable (retryable: false) and stop immediately without looping. The error should be returned to the user once. The tool parameter validation error triggers an infinite retry loop, causing 200+ duplicate messages and wasting API tokens. The error is treated as retryable and keeps retrying indefinitely.

Root Cause

当工具的参数验证失败时,错误未被标记为 retryable: false,导致 OpenClaw 框架无限重试,形成循环调用。该问题影响多个工具(read、web_fetch 等),造成 API 费用浪费和用户体验灾难。

Fix Action

Fixed

PR fix notes

PR #68070: fix: prevent infinite retry loops on tool parameter validation errors

Description (problem / solution / changelog)

Closes #68026

Marks parameter validation errors as non-retryable so the agent does not enter an infinite loop when tool arguments are missing or malformed.

Changed files

  • src/agents/pi-tool-definition-adapter.ts (modified, +9/-1)
  • src/agents/pi-tools.params.ts (modified, +3/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

当工具的参数验证失败时,错误未被标记为 retryable: false,导致 OpenClaw 框架无限重试,形成循环调用。该问题影响多个工具(read、web_fetch 等),造成 API 费用浪费和用户体验灾难。

现象

  1. read 工具循环 - 空路径调用 read 时,Missing required parameter: path 错误导致无限重试
  2. web_fetch 工具循环 - 无效 URL 调用 web_fetch 时,Invalid URL: must be http or https 错误导致无限重试
  3. 其他工具 - 任何在参数验证时直接抛出普通 Error 的工具都可能触发相同问题

Steps to reproduce

  1. Trigger a tool parameter validation error (e.g., call read with empty path or web_fetch with invalid URL)
  2. Observe the error is not marked as retryable: false
  3. OpenClaw framework enters infinite retry loop
  4. Check logs for repeated error messages (hundreds of times)

Expected behavior

Parameter validation errors should be marked as non-retryable (retryable: false) and stop immediately without looping. The error should be returned to the user once.

Actual behavior

The tool parameter validation error triggers an infinite retry loop, causing 200+ duplicate messages and wasting API tokens. The error is treated as retryable and keeps retrying indefinitely.

OpenClaw version

v2026.4.12

Operating system

Linux (SteamOS / Arch Linux)

Install method

npm global

Model

gemini/gemini-3.1-flash-lite-preview

Provider / routing chain

Direct API connection

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Mark parameter validation errors as non-retryable (retryable: false) to prevent infinite retry loops in the OpenClaw framework.

Guidance

  • Identify the source of parameter validation errors in tools like read and web_fetch to ensure they are correctly marked as non-retryable.
  • Review the error handling mechanism in the OpenClaw framework to prevent it from treating parameter validation errors as retryable.
  • Implement a check to stop retrying when a parameter validation error occurs, and return the error to the user immediately.
  • Consider adding logging to track the number of retries and detect potential infinite loops.

Example

// Example of marking a parameter validation error as non-retryable
const error = new Error('Missing required parameter: path');
error.retryable = false;
throw error;

Notes

The solution may require modifications to the OpenClaw framework and individual tools to correctly handle parameter validation errors. The provided example is a simplified illustration and may need to be adapted to the actual codebase.

Recommendation

Apply workaround: Modify the error handling mechanism to mark parameter validation errors as non-retryable (retryable: false) to prevent infinite loops, as the root cause seems to be related to how these errors are handled rather than a version-specific issue.

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

Parameter validation errors should be marked as non-retryable (retryable: false) and stop immediately without looping. The error should be returned to the user once.

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 - ✅(Solved) Fix [Bug]: 工具参数验证错误触发无限循环(read/web_fetch 等) [1 pull requests, 1 participants]