Skip to content

Kimi K2.6 reasoning_content 400 regression in long conversations after LCM compaction (follow-up #70392) #71491

@RoseKongPS

Description

@RoseKongPS

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.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions