-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Kimi K2.6 reasoning_content 400 regression in long conversations after LCM compaction (follow-up #70392) #71491
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, 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.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, 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.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Follow-up to #70392 (closed as fixed). The
sanitizeToolCallIdsfix from #70030 correctly handles short conversations, butreasoning_content is missing400 errors still occur in long sessions after context compaction.Environment
Reproduction
Observed Errors (same session, same day)
reasoning_content is missing in assistant tool call message at index 122reasoning_content is missing in assistant tool call message at index 144Hypothesis
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.