Skip to content

[Bug]: extra_body overwriting request payload keys: thinking — framework-level thinking field collision affecting all providers #75040

Description

@kingkong9817

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions