openclaw - 💡(How to fix) Fix [Bug]: extra_body overwriting request payload keys: thinking — framework-level thinking field collision affecting all providers [1 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#75040Fetched 2026-05-01 05:38:52
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Every API request produces a WARN log: extra_body overwriting request payload keys: thinking. This is a framework-level issue that affects all providers (DeepSeek, Ollama, etc.), not just a single provider. The thinking parameter is being written in two separate locations within the request payload pipeline, causing a field collision on every request.

Error Message

Every API request produces a WARN log: extra_body overwriting request payload keys: thinking. This is a framework-level issue that affects all providers (DeepSeek, Ollama, etc.), not just a single provider. The thinking parameter is being written in two separate locations within the request payload pipeline, causing a field collision on every request.

  • Essentially every request triggers this WARN
  • No WARN about parameter overwriting should appear on requests where thinking is explicitly disabled

Root Cause

2. Ollama/Qwen3 (local model): This has severe consequences for local models:

  • [llm-idle-timeout] ollama/qwen3:32b-q4_K_M-16k produced no reply before the idle watchdog
  • Profile ollama:default timed out
  • Stuck sessions with state=processing age=141s
  • The root cause appears to be: OpenClaw sends "thinking" parameter, but Ollama native protocol uses "think" (top-level). When the thinking field state is unreliable due to the overwrite collision, the model may output to message.thinking instead of message.content, causing OpenClaw to see an empty reply → idle-timeout → stuck session → failover to surface_error.
  • Mitigation: Setting thinking: false, think: false, and reasoning: false for all local Ollama models resolves the issue, confirming the thinking field is the root cause.

Fix Action

Workaround

For Ollama/Qwen3: explicitly disable all thinking-related parameters in the model config (thinking: false, think: false, reasoning: false).

Code Example

extra_body overwriting request payload keys: thinking
[llm-idle-timeout] ollama/qwen3:32b-q4_K_M-16k produced no reply before the idle watchdog
Profile ollama:default timed out. Trying next account...
stuck session: sessionId=main state=processing age=141s
RAW_BUFFERClick to expand / collapse

Bug Report

Summary

Every API request produces a WARN log: extra_body overwriting request payload keys: thinking. This is a framework-level issue that affects all providers (DeepSeek, Ollama, etc.), not just a single provider. The thinking parameter is being written in two separate locations within the request payload pipeline, causing a field collision on every request.

Version

  • OpenClaw 2026.4.26 (be8c246)
  • Node.js v25.9.0
  • macOS (launchd managed gateway)

Reproduction

Always reproducible. Simply run the gateway with any model — the warning appears on every single API request.

Frequency

  • ~384 occurrences/day (observed 2026-04-30, 18:56 CST)
  • 271 occurrences/day (observed 2026-04-28)
  • Essentially every request triggers this WARN

Impact

1. DeepSeek (V4 Pro): When thinking is enabled, this parameter collision has caused:

  • Frequent API timeouts (10 consecutive timeouts observed between 04:03-04:20 UTC on 2026-04-28)
  • May be related to issue #74374 (400 "reasoning_content must be passed back")

2. Ollama/Qwen3 (local model): This has severe consequences for local models:

  • [llm-idle-timeout] ollama/qwen3:32b-q4_K_M-16k produced no reply before the idle watchdog
  • Profile ollama:default timed out
  • Stuck sessions with state=processing age=141s
  • The root cause appears to be: OpenClaw sends "thinking" parameter, but Ollama native protocol uses "think" (top-level). When the thinking field state is unreliable due to the overwrite collision, the model may output to message.thinking instead of message.content, causing OpenClaw to see an empty reply → idle-timeout → stuck session → failover to surface_error.
  • Mitigation: Setting thinking: false, think: false, and reasoning: false for all local Ollama models resolves the issue, confirming the thinking field is the root cause.

Relevant Source Location

Based on investigation, this appears to originate from createOpenAICompletionsExtraBodyWrapper in:

  • src/agents/pi-embedded-runner/extra-params.ts (around line 492)
  • The extra_body wrapper is applied after provider-specific wrappers, and Object.assign overwrites payload keys with a collision warning

Expected Behavior

  • The thinking parameter should be written to the request payload exactly once, in a single location
  • No WARN about parameter overwriting should appear on requests where thinking is explicitly disabled
  • Local Ollama models should work reliably whether thinking is enabled or disabled

Workaround

For Ollama/Qwen3: explicitly disable all thinking-related parameters in the model config (thinking: false, think: false, reasoning: false).

Log Evidence

extra_body overwriting request payload keys: thinking
[llm-idle-timeout] ollama/qwen3:32b-q4_K_M-16k produced no reply before the idle watchdog
Profile ollama:default timed out. Trying next account...
stuck session: sessionId=main state=processing age=141s

extent analysis

TL;DR

The most likely fix involves modifying the createOpenAICompletionsExtraBodyWrapper function in src/agents/pi-embedded-runner/extra-params.ts to avoid overwriting the thinking parameter in the request payload.

Guidance

  • Investigate the createOpenAICompletionsExtraBodyWrapper function to identify why the thinking parameter is being written twice, causing a field collision.
  • Verify that the thinking parameter is only written once by checking the request payload before and after the extra_body wrapper is applied.
  • Consider adding a check to prevent overwriting existing keys in the request payload, such as using Object.assign with a custom merge function.
  • Test the fix by running the gateway with a model and checking for the WARN log message.

Example

// Example of how to modify the createOpenAICompletionsExtraBodyWrapper function
// to avoid overwriting existing keys in the request payload
function createOpenAICompletionsExtraBodyWrapper(payload) {
  const extraBody = { thinking: true }; // or false, depending on the configuration
  // Use a custom merge function to avoid overwriting existing keys
  return { ...payload, ...extraBody };
}

Notes

The provided workaround for Ollama/Qwen3 models suggests that disabling thinking-related parameters resolves the issue, which supports the hypothesis that the thinking parameter collision is the root cause.

Recommendation

Apply a workaround by modifying the createOpenAICompletionsExtraBodyWrapper function to avoid overwriting the thinking parameter, as this is a more targeted fix than disabling thinking-related parameters for all models.

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

openclaw - 💡(How to fix) Fix [Bug]: extra_body overwriting request payload keys: thinking — framework-level thinking field collision affecting all providers [1 comments, 2 participants]