openclaw - 💡(How to fix) Fix lossless-claw + thinking + tool-call triggers 400 invalid_request_error, causing fallback [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#70996Fetched 2026-04-24 10:36:57
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Error Message

400 invalid_request_error: "thinking is enabled but reasoning_content is missing in assistant tool call message at index 3"

Code Example

400 invalid_request_error: "thinking is enabled but reasoning_content is missing in assistant tool call message at index 3"
RAW_BUFFERClick to expand / collapse

Version: OpenClaw 2026.4.21, lossless-claw (bundled)

Description: When plugins.slots.contextEngine = "lossless-claw" and the agent has thinking enabled, executing tasks that involve tool calls triggers a fallback to the secondary model.

Error:

400 invalid_request_error: "thinking is enabled but reasoning_content is missing in assistant tool call message at index 3"

Reproduction Steps:

  1. Configure contextEngine: lossless-claw and thinking: high
  2. Execute a task requiring tool calls (e.g., read + web_search + exec)
  3. Kimi (anthropic-messages) returns 400, triggering fallback to openai-codex/gpt-5.4

Control Experiment:

  • Same OpenClaw version, without lossless-claw (contextEngine: memory-core), same task completes normally without fallback.
  • This confirms the issue lies in how lossless-claw handles assistant tool-call messages with thinking enabled, specifically losing the reasoning_content field.

Expected Behavior: lossless-claw should preserve the reasoning_content field in assistant tool-call messages when reconstructing/compressing message history.

Environment:

  • OS: linux 6.8.0-107-generic (x64)
  • Node: v22.22.2
  • Model: kimi/kimi-for-coding (anthropic-messages API)
  • Fallbacks configured: openai-codex/gpt-5.4, deepseek/deepseek-v4-pro, etc.

extent analysis

TL;DR

The issue can be resolved by ensuring that the reasoning_content field is preserved in assistant tool-call messages when using the lossless-claw context engine with thinking enabled.

Guidance

  • Verify that the reasoning_content field is being sent correctly in the tool-call messages by checking the request payload before it is processed by lossless-claw.
  • Check the lossless-claw configuration to ensure that it is not intentionally dropping or modifying the reasoning_content field.
  • Consider modifying the lossless-claw implementation to preserve the reasoning_content field, or use a different context engine that handles this field correctly.
  • Test the task execution with a different context engine, such as memory-core, to confirm that the issue is specific to lossless-claw.

Example

No code snippet is provided as the issue is related to the configuration and implementation of the lossless-claw context engine.

Notes

The issue seems to be specific to the lossless-claw context engine and the way it handles assistant tool-call messages with thinking enabled. The memory-core context engine does not exhibit this behavior, suggesting that the issue lies in the lossless-claw implementation.

Recommendation

Apply a workaround by modifying the lossless-claw implementation to preserve the reasoning_content field, or use a different context engine that handles this field correctly, as the current implementation is causing the fallback to the secondary model.

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