openclaw - 💡(How to fix) Fix [Bug]: Kimi Code (Moonshot) Provider enters an infinite loop during tasks [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#63173Fetched 2026-04-09 07:57:30
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
1
Author
Participants
Timeline (top)
labeled ×2subscribed ×1

When using kimi-code (Kimi API) as the LLM provider in OpenClaw, the agent frequently gets stuck in an infinite loop. It repeatedly generates the same response text followed by a tool call with empty arguments (e.g., read: {}), which fails validation.

Error Message

The agent repeats the previous turn's text and issues an empty toolCall for read, resulting in a Missing required parameter: path alias. Supply correct parameters before retrying. error in the logs. {"role":"toolResult","toolCallId":"tool_...","toolName":"read","content":[{"type":"text","text":"{\n "status": "error",\n "tool": "read",\n "error": "Missing required parameter: path alias..."\n}"}]}

Root Cause

Additional provider/model setup details Using kimi-coding:default auth profile. The issue occurs because preserveAnthropicThinkingSignatures defaults to false and openAiPayloadNormalizationMode is set to "moonshot-thinking", which appears to interfere with the Anthropic-compatible tool protocol.

Code Example

JSONL log evidence:

{"role":"assistant","content":[{"type":"text","text":"... (repeated analysis) ..."},{"type":"toolCall","id":"tool_...","name":"read","arguments":{}}]}
{"role":"toolResult","toolCallId":"tool_...","toolName":"read","content":[{"type":"text","text":"{\n  \"status\": \"error\",\n  \"tool\": \"read\",\n  \"error\": \"Missing required parameter: path alias...\"\n}"}]}
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When using kimi-code (Kimi API) as the LLM provider in OpenClaw, the agent frequently gets stuck in an infinite loop. It repeatedly generates the same response text followed by a tool call with empty arguments (e.g., read: {}), which fails validation.

Steps to reproduce

  1. Configure OpenClaw 2026.3.24 with the kimi-coding:default provider.
  2. Start a task requiring file system access (e.g., "Analyze app.js").
  3. Observe the agent repeating the same analysis text and calling read with empty arguments in the session logs (~/.openclaw/agents/main/sessions/).

Expected behavior

The agent should preserve its thinkingSignature across turns and correctly provide the path argument in the tool call, as observed with other Anthropic-compatible models.

Actual behavior

The agent repeats the previous turn's text and issues an empty toolCall for read, resulting in a Missing required parameter: path alias. Supply correct parameters before retrying. error in the logs.

OpenClaw version

2026.3.24

Operating system

Linux (Ubuntu/Debian via NVM)

Install method

npm global (nvm)

Model

kimi-coding/k2p5

Provider / routing chain

openclaw -> kimi-coding (direct)

Additional provider/model setup details

Additional provider/model setup details Using kimi-coding:default auth profile. The issue occurs because preserveAnthropicThinkingSignatures defaults to false and openAiPayloadNormalizationMode is set to "moonshot-thinking", which appears to interfere with the Anthropic-compatible tool protocol.

Logs, screenshots, and evidence

JSONL log evidence:

{"role":"assistant","content":[{"type":"text","text":"... (repeated analysis) ..."},{"type":"toolCall","id":"tool_...","name":"read","arguments":{}}]}
{"role":"toolResult","toolCallId":"tool_...","toolName":"read","content":[{"type":"text","text":"{\n  \"status\": \"error\",\n  \"tool\": \"read\",\n  \"error\": \"Missing required parameter: path alias...\"\n}"}]}

Impact and severity

Affected users/systems/channels: Users of the Kimi Coding provider extension. Severity: High (blocks all multi-step coding/analysis tasks). Frequency: Always observed during multi-step workflows. Consequence: Agent becomes unusable for tasks requiring tool interaction.

Additional information

Local fix confirmed:

  1. Setting preserveAnthropicThinkingSignatures: true and openAiPayloadNormalizationMode: "default" in extensions/kimi-coding/index.ts.
  2. Adding anthropicToolSchemaMode: "openai-functions" and anthropicToolChoiceMode: "openai-string-modes" to Kimi capabilities.
  3. Simplifying tool parameter labels from "path alias" to "path" in pi-tools.params.ts.

extent analysis

TL;DR

Setting preserveAnthropicThinkingSignatures to true and adjusting openAiPayloadNormalizationMode to "default" may resolve the infinite loop issue with the Kimi Coding provider in OpenClaw.

Guidance

  • Verify that the kimi-coding:default provider is correctly configured and that the preserveAnthropicThinkingSignatures flag is set to false by default, which may be causing the issue.
  • Try setting preserveAnthropicThinkingSignatures to true and openAiPayloadNormalizationMode to "default" in the extensions/kimi-coding/index.ts file to see if this resolves the issue.
  • Check the tool parameter labels in pi-tools.params.ts to ensure they are simplified and consistent, such as changing "path alias" to "path".
  • Consider adding anthropicToolSchemaMode: "openai-functions" and anthropicToolChoiceMode: "openai-string-modes" to Kimi capabilities to improve compatibility with the Anthropic-compatible tool protocol.

Example

No explicit code example is provided, but the suggested changes can be applied to the extensions/kimi-coding/index.ts and pi-tools.params.ts files.

Notes

The provided local fix suggests that modifying the preserveAnthropicThinkingSignatures and openAiPayloadNormalizationMode settings, as well as simplifying tool parameter labels, may resolve the issue. However, it is essential to test and verify these changes in the specific environment to ensure they are effective.

Recommendation

Apply the workaround by setting preserveAnthropicThinkingSignatures to true and adjusting openAiPayloadNormalizationMode to "default", as this has been confirmed to resolve the issue in a local fix.

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

The agent should preserve its thinkingSignature across turns and correctly provide the path argument in the tool call, as observed with other Anthropic-compatible models.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING