openclaw - 💡(How to fix) Fix [Bug]: No config key to override dropReasoningFromHistory for openai-completions providers

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…

All openai-completions models have their reasoning/thinking blocks stripped from replayed conversation history by default, except two models in a whitelist - with no way to override.

Root Cause

  • Issue #81058 — "Empty responses from OpenAI-compatible models with reasoning" (same root cause, incorrect workaround suggested)
  • Commit f66b1d1 (May 10) — "fix: strip OpenAI-compatible replay reasoning" (introduced the blanket default)
  • Commit e7277b4 (May 8) — "refactor(agents): preserve raw reasoning stream"

Fix Action

Fix / Workaround

The issue #81058 suggested workaround (dropReasoningFromHistory: false in provider config) — does not work. The key is not in the schema (additionalProperties: false on provider schema), so validation rejects it.

  • Issue #81058 — "Empty responses from OpenAI-compatible models with reasoning" (same root cause, incorrect workaround suggested)
  • Commit f66b1d1 (May 10) — "fix: strip OpenAI-compatible replay reasoning" (introduced the blanket default)
  • Commit e7277b4 (May 8) — "refactor(agents): preserve raw reasoning stream"

Code Example

In `buildUnownedProviderTransportReplayFallback()` (attempt.tool-run-context.js), the transcript policy for `openai-completions` is hardcoded:


// Line ~577
...isStrictOpenAiCompatible ? { dropReasoningFromHistory: !requiresReasoningContentReplay(params.modelId) } : {}


This means `dropReasoningFromHistory: true` for all `openai-completions` models unless the model ID matches one of:
- `kimi-for-coding`, `kimi-k2.5`, `kimi-k2.6`, `kimi-k2-thinking`, `kimi-k2-thinking-turbo`
- `mimo-v2-pro`, `mimo-v2-omni`, `mimo-v2.5`, `mimo-v2.5-pro`, `mimo-v2.6-pro`

The `mergeTranscriptPolicy()` function already supports the override:


// Line ~618
...typeof policy.dropReasoningFromHistory === "boolean" ? { dropReasoningFromHistory: policy.dropReasoningFromHistory } : {}


But there is **no config path** that flows into `resolveTranscriptPolicy()` to provide that override. The `params` object is built from the runtime context, not from `openclaw.json`.

---

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "transcriptPolicy": {
          "dropReasoningFromHistory": false
        }
      }
    }
  }
}

---

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "dropReasoningFromHistory": false
      }
    }
  }
}

---

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "models": [
          {
            "id": "my-model",
            "reasoning": true,
            "transcriptPolicy": {
              "dropReasoningFromHistory": false
            }
          }
        ]
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

All openai-completions models have their reasoning/thinking blocks stripped from replayed conversation history by default, except two models in a whitelist - with no way to override.

Steps to reproduce

  1. Use a custom model provider with openai-completions, and a model that emits reasoning blocks e.g. reasoning_content.
  2. Observe the reasoning blocks are unconditionally stripped from the context in later turns. There is currently no config key to override this behavior.

Expected behavior

Some models, e.g. Qwen3.6 series, make use of preserve_thinking and leverage reasoning content from prior turns. This requires the reasoning content be retained across turns. I was going to file as an RFE but unconditionally stripping all reasoning content seems to me more like a bug.

The issue #81058 suggested workaround (dropReasoningFromHistory: false in provider config) — does not work. The key is not in the schema (additionalProperties: false on provider schema), so validation rejects it.

Actual behavior

All openai-completions models have their reasoning/thinking blocks stripped from replayed conversation history by default, except two models in a whitelist - with no way to override.

OpenClaw version

2026.5.28

Operating system

Ubuntu 24.04

Install method

npm global

Model

Qwen3.6-35B-A3B

Provider / routing chain

openclaw -> llama.cpp (openai-completions API)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

In `buildUnownedProviderTransportReplayFallback()` (attempt.tool-run-context.js), the transcript policy for `openai-completions` is hardcoded:


// Line ~577
...isStrictOpenAiCompatible ? { dropReasoningFromHistory: !requiresReasoningContentReplay(params.modelId) } : {}


This means `dropReasoningFromHistory: true` for all `openai-completions` models unless the model ID matches one of:
- `kimi-for-coding`, `kimi-k2.5`, `kimi-k2.6`, `kimi-k2-thinking`, `kimi-k2-thinking-turbo`
- `mimo-v2-pro`, `mimo-v2-omni`, `mimo-v2.5`, `mimo-v2.5-pro`, `mimo-v2.6-pro`

The `mergeTranscriptPolicy()` function already supports the override:


// Line ~618
...typeof policy.dropReasoningFromHistory === "boolean" ? { dropReasoningFromHistory: policy.dropReasoningFromHistory } : {}


But there is **no config path** that flows into `resolveTranscriptPolicy()` to provide that override. The `params` object is built from the runtime context, not from `openclaw.json`.

Impact and severity

Affected: users of openai-completions endpoint and a custom model provider Severity: at best annoying, at worst can block workflow Frequency: always Consequence: degrades model response quality when in thinking mode

Additional information

Proposed Fix

Add a config path to models.providers.* (and optionally models.providers.*.models.*) that flows into resolveTranscriptPolicy().

Option A: Provider-level config

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "transcriptPolicy": {
          "dropReasoningFromHistory": false
        }
      }
    }
  }
}

Option B: Direct key (simpler)

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "dropReasoningFromHistory": false
      }
    }
  }
}

Option C: Per-model config (most granular)

{
  "models": {
    "providers": {
      "my-provider": {
        "api": "openai-completions",
        "models": [
          {
            "id": "my-model",
            "reasoning": true,
            "transcriptPolicy": {
              "dropReasoningFromHistory": false
            }
          }
        ]
      }
    }
  }
}

Files to Modify

  1. Schema (config.schema): Add transcriptPolicy (object with dropReasoningFromHistory?: boolean) to models.providers.* and/or models.providers.*.models.*

  2. resolveTranscriptPolicy() (attempt.tool-run-context.js): Read the config-level transcriptPolicy from the provider/model context and pass it into mergeTranscriptPolicy() so it can override the hardcoded fallback defaults.

Related

  • Issue #81058 — "Empty responses from OpenAI-compatible models with reasoning" (same root cause, incorrect workaround suggested)
  • Commit f66b1d1 (May 10) — "fix: strip OpenAI-compatible replay reasoning" (introduced the blanket default)
  • Commit e7277b4 (May 8) — "refactor(agents): preserve raw reasoning stream"

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…

FAQ

Expected behavior

Some models, e.g. Qwen3.6 series, make use of preserve_thinking and leverage reasoning content from prior turns. This requires the reasoning content be retained across turns. I was going to file as an RFE but unconditionally stripping all reasoning content seems to me more like a bug.

The issue #81058 suggested workaround (dropReasoningFromHistory: false in provider config) — does not work. The key is not in the schema (additionalProperties: false on provider schema), so validation rejects it.

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]: No config key to override dropReasoningFromHistory for openai-completions providers