openclaw - 💡(How to fix) Fix [Bug]: startup race can downgrade agent thinkingDefault=xhigh to high and persist the downgrade into the session

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…

Root Cause

These seem related in symptom space, but not identical to this root cause:

Fix Action

Fix / Workaround

  • resolve default thinking as xhigh
  • call supportsXHighThinking(provider, model)
  • if that returns false, downgrade to high
  • persist the downgraded value back into the session

Locally, I hotfixed the live dist so the thinking support check ensures the plugin registry is loaded before reading xhigh support. After that:

  • silently changes runtime behavior
  • silently persists the wrong thinking level into the session
  • makes agent config look ignored
  • can reappear after upgrade if a local hotfix gets overwritten

Code Example

{"type":"model_change","provider":"openai-codex","modelId":"gpt-5.4"}
{"type":"thinking_level_change","thinkingLevel":"high"}

---

if (resolvedThinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
  resolvedThinkLevel = "high";
  // persist "high" back into session entry
}

---

supportsXHighThinking("openai-codex", "gpt-5.4") === true
RAW_BUFFERClick to expand / collapse

What happened?

An agent configured with thinkingDefault: "xhigh" can start a new session at high without any user override.

In my case this happened on an invoice agent using openai-codex/gpt-5.4. The downgrade happened before the first user message, and the downgraded level was then persisted into the session.

This does not look like a model capability issue. It looks like a startup timing / initialization-order bug in the xhigh support check.

Version

  • OpenClaw: 2026.4.15
  • Provider/model: openai-codex/gpt-5.4

Expected behavior

If an agent is configured with thinkingDefault: "xhigh" and the model supports xhigh, a new session should start at xhigh.

Actual behavior

The session starts at high, even though:

  • the agent config still has thinkingDefault: "xhigh"
  • there was no manual /thinking change
  • the downgrade happens before the first user message

Reproduction

  1. Configure an agent with thinkingDefault: "xhigh".
  2. Use openai-codex/gpt-5.4.
  3. Start a fresh session, especially after a cold startup / fresh runtime initialization.
  4. Inspect the session transcript.

I observed the session starting like this:

{"type":"model_change","provider":"openai-codex","modelId":"gpt-5.4"}
{"type":"thinking_level_change","thinkingLevel":"high"}

This happened before the first user message.

Why this looks like an OpenClaw bug

The startup path appears to do this:

  • resolve default thinking as xhigh
  • call supportsXHighThinking(provider, model)
  • if that returns false, downgrade to high
  • persist the downgraded value back into the session

The relevant logic is in the agent startup path:

if (resolvedThinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
  resolvedThinkLevel = "high";
  // persist "high" back into session entry
}

The likely problem is that supportsXHighThinking() checks plugin/provider registry state too early. At startup time, the provider/plugin registry may not be loaded yet, so the check returns false even though the model actually supports xhigh.

Extra validation

Locally, I hotfixed the live dist so the thinking support check ensures the plugin registry is loaded before reading xhigh support. After that:

supportsXHighThinking("openai-codex", "gpt-5.4") === true

and new sessions no longer auto-downgrade from xhigh to high.

So this looks like an initialization order / startup race, not a real capability mismatch.

Impact

  • silently changes runtime behavior
  • silently persists the wrong thinking level into the session
  • makes agent config look ignored
  • can reappear after upgrade if a local hotfix gets overwritten

Related issues

These seem related in symptom space, but not identical to this root cause:

  • #59416
  • #50601
  • #67199

extent analysis

TL;DR

The issue can be fixed by ensuring the plugin registry is loaded before checking for xhigh thinking support in the agent startup path.

Guidance

  • Verify that the supportsXHighThinking function is being called after the plugin registry has been loaded to prevent false negatives.
  • Check the initialization order of the plugin registry and the agent startup path to identify any potential race conditions.
  • Consider adding a delay or a callback to ensure the plugin registry is fully loaded before checking for xhigh thinking support.
  • Review the hotfix applied locally to ensure it is a viable solution and can be integrated into the main codebase.

Example

// Ensure plugin registry is loaded before checking for xhigh support
if (pluginRegistryLoaded) {
  if (resolvedThinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
    resolvedThinkLevel = "high";
    // persist "high" back into session entry
  }
} else {
  // Wait for plugin registry to load or use a callback
}

Notes

The issue seems to be related to the initialization order of the plugin registry and the agent startup path. Ensuring the plugin registry is loaded before checking for xhigh thinking support should resolve the issue. However, further testing and verification are needed to confirm this solution.

Recommendation

Apply the workaround by ensuring the plugin registry is loaded before checking for xhigh thinking support, as this seems to be the root cause of the issue. This will prevent the silent downgrade from xhigh to high and ensure the correct thinking level is persisted in the session.

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

If an agent is configured with thinkingDefault: "xhigh" and the model supports xhigh, a new session should start at xhigh.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING