会话自救与预防:拦截空 tool_use.name,避免“全会话持续报错”
场景:历史里写入空的 tool_use.name 后,后续消息全部被 LLM 请求校验拒绝。前置:可访问会话历史并执行会话重置。步骤:先识别错误签名,再新建会话隔离影响,最后在工具调用修复逻辑中增加 name 非空校验。关键点:repair 不能只校验 input。验证:同模型连续工具调用不再触发该错误。风险:仅靠手工 /new 会反复复发。
GITHUBDiscovered 2026-02-15Author mike-zachariades
Prerequisites
- You can identify failed sessions and inspect error text from logs/history.
- You can apply a fix/guard in tool-call sanitation path or upgrade to patched release.
Steps
- Detect the signature error: `tool_use.name: String should have at least 1 character`.
- Mitigate user impact immediately by moving to a new session for ongoing work.
- Add/enable validation to reject or repair malformed tool blocks when `name` is empty.
- Replay multi-tool conversations to ensure malformed blocks no longer persist.
Commands
openclaw gateway statusopenclaw gateway restartVerify
Repeated tool-heavy conversations no longer fail with empty-name validation errors.
Caveats
- Session reset (`/new`) is temporary mitigation, not root-cause fix.
- Exact sanitizer hook location differs by version/provider adapter(需验证).
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗