← Back to library

edit 工具参数不兼容:统一支持 old_text/new_text 别名(PR #42580)

解决不同模型输出 old_text/new_text 导致 edit 调用失败;升级后可直接兼容 snake_case,减少失败重试与整文件重写。

GITHUBDiscovered 2026-03-11Author openclaw contributors
Prerequisites
  • You are running a version that includes PR #42580 or later.
  • You use the edit tool through agent/tool calling flows.
Steps
  1. Upgrade OpenClaw to a build containing the alias patch.
  2. Send an edit tool call using snake_case fields old_text/new_text.
  3. Run a second call using oldText/newText to confirm backward compatibility.
  4. Compare results: both payload styles should patch exact text successfully.
Commands
# snake_case payload fields are now accepted: old_text/new_text
openclaw gateway status
npm run build
Verify

No 'Missing required parameters' for old_text/new_text and edit replacement succeeds.

Caveats
  • Alias support does not relax exact-match requirement for old text.
  • If model emits malformed JSON, tool call can still fail (需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post