openclaw - 💡(How to fix) Fix Kimi K2.6 reasoning_content 400 regression in long conversations after LCM compaction (follow-up #70392) [2 comments, 2 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#71491Fetched 2026-04-26 05:12:14
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×2cross-referenced ×1

Follow-up to #70392 (closed as fixed). The sanitizeToolCallIds fix from #70030 correctly handles short conversations, but reasoning_content is missing 400 errors still occur in long sessions after context compaction.

Root Cause

The fix preserves reasoning_content in normal multi-turn flow. However, after LCM compaction or context compression, assistant tool-call messages that were part of the compressed context may lose their reasoning_content during reconstruction. Moonshot's API then rejects the transcript on replay because it requires reasoning_content for all assistant tool-call messages when thinking is enabled.

Fix Action

Workaround

Model fallback to MiniMax/Grok succeeds. Kimi K2.6 usage deferred for long sessions until resolved.

RAW_BUFFERClick to expand / collapse

Summary

Follow-up to #70392 (closed as fixed). The sanitizeToolCallIds fix from #70030 correctly handles short conversations, but reasoning_content is missing 400 errors still occur in long sessions after context compaction.

Environment

  • OpenClaw: 2026.4.23 (a979721)
  • Model: moonshot/kimi-k2.6
  • Thinking: enabled

Reproduction

  1. Start a session with kimi-k2.6 as primary model
  2. Run 15-20+ turns with heavy tool usage
  3. Wait for LCM compaction (softThreshold trigger)
  4. Continue tool calls after compaction → 400

Observed Errors (same session, same day)

  • reasoning_content is missing in assistant tool call message at index 122
  • reasoning_content is missing in assistant tool call message at index 144

Hypothesis

The fix preserves reasoning_content in normal multi-turn flow. However, after LCM compaction or context compression, assistant tool-call messages that were part of the compressed context may lose their reasoning_content during reconstruction. Moonshot's API then rejects the transcript on replay because it requires reasoning_content for all assistant tool-call messages when thinking is enabled.

Expected Behavior

reasoning_content should be preserved or synthetically restored for compressed assistant tool-call messages, even after LCM compaction.

Workaround

Model fallback to MiniMax/Grok succeeds. Kimi K2.6 usage deferred for long sessions until resolved.

extent analysis

TL;DR

Preserving or synthetically restoring reasoning_content for compressed assistant tool-call messages after LCM compaction may resolve the reasoning_content is missing 400 errors.

Guidance

  • Verify that the issue is specific to the kimi-k2.6 model and Thinking: enabled configuration by testing with other models and configurations.
  • Investigate the LCM compaction process to determine why reasoning_content is being lost during context compression and reconstruction.
  • Consider implementing a synthetic restoration of reasoning_content for compressed assistant tool-call messages as a temporary workaround.
  • Review the Moonshot API documentation to ensure that the reasoning_content requirement is correctly handled for all assistant tool-call messages when thinking is enabled.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The provided hypothesis suggests that the issue is related to the LCM compaction process and the reconstruction of compressed context. However, without further information about the implementation details, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Model fallback to MiniMax/Grok for long sessions until the issue is resolved, as it has been observed to succeed in the given environment.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING