openclaw - 💡(How to fix) Fix [Bug]: Codex app-server runs ignore agent thinkingDefault unless thinking is explicitly set [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#71020Fetched 2026-04-25 06:08:32
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

On the Codex app-server run path, agent thinkingDefault is ignored. /status shows Think: medium even when agentCfg.thinkingDefault = "xhigh" and agents.defaults.models[codex/gpt-5.5].params.thinking = "xhigh" are both set, because the default-aware thinking level is computed but not passed into the Codex app-server attempt params.

Related to #67199 (same symptom class — thinkingDefault resolved but not passed — on the HTTP /v1/chat/completions → embedded-runner path). This report is the Codex app-server path.

Root Cause

On the Codex app-server run path, agent thinkingDefault is ignored. /status shows Think: medium even when agentCfg.thinkingDefault = "xhigh" and agents.defaults.models[codex/gpt-5.5].params.thinking = "xhigh" are both set, because the default-aware thinking level is computed but not passed into the Codex app-server attempt params.

Fix Action

Fix / Workaround

Local hotfix verification

After patching dist/get-reply-DIRI0vf6.js with the diff above and running node --check to validate syntax, plus patching the active session with:

openclaw gateway call sessions.patch \
  --params '{"key":"agent:main:feishu:default:direct:<peerId>","thinkingLevel":"xhigh"}' \
  --json

Code Example

{
     "agents": {
       "list": [
         {
           "id": "main",
           "default": true,
           "thinkingDefault": "xhigh",
           "model": { "primary": "codex/gpt-5.5" },
           "embeddedHarness": { "runtime": "codex", "fallback": "none" }
         }
       ],
       "defaults": {
         "models": {
           "codex/gpt-5.5": { "params": { "thinking": "xhigh" } },
           "openai-codex/gpt-5.5": { "params": { "thinking": "xhigh" } }
         }
       }
     }
   }

---

model = "gpt-5.5"
   model_reasoning_effort = "xhigh"

---

Model: codex/gpt-5.5
Think: xhigh

---

Model: codex/gpt-5.5
Think: medium

---

const resolvedThinkLevel = directives.thinkLevel ?? targetSessionEntry?.thinkingLevel;
const resolvedThinkLevelWithDefault =
    resolvedThinkLevel ??
    await modelState.resolveDefaultThinkingLevel() ??
    agentCfg?.thinkingDefault;

---

thinkLevel: resolvedThinkLevel,  // ← ignores thinkingDefault

---

function buildTurnStartParams(params, options) {
  return {
    threadId: options.threadId,
    input: buildUserInput(params, options.promptText),
    cwd: options.cwd,
    approvalPolicy: options.appServer.approvalPolicy,
    approvalsReviewer: options.appServer.approvalsReviewer,
    model: params.modelId,
    effort: resolveReasoningEffort(params.thinkLevel)
  };
}

---

- thinkLevel: resolvedThinkLevel,
+ thinkLevel: resolvedThinkLevelWithDefault,

---

openclaw gateway call sessions.patch \
  --params '{"key":"agent:main:feishu:default:direct:<peerId>","thinkingLevel":"xhigh"}' \
  --json

---

attemptParams.thinkLevel === "xhigh"
// and
turnStartParams.effort === "xhigh"
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On the Codex app-server run path, agent thinkingDefault is ignored. /status shows Think: medium even when agentCfg.thinkingDefault = "xhigh" and agents.defaults.models[codex/gpt-5.5].params.thinking = "xhigh" are both set, because the default-aware thinking level is computed but not passed into the Codex app-server attempt params.

Related to #67199 (same symptom class — thinkingDefault resolved but not passed — on the HTTP /v1/chat/completions → embedded-runner path). This report is the Codex app-server path.

Steps to reproduce

  1. Configure a main agent bound to codex/gpt-5.5 with Codex harness and thinkingDefault: "xhigh":

    {
      "agents": {
        "list": [
          {
            "id": "main",
            "default": true,
            "thinkingDefault": "xhigh",
            "model": { "primary": "codex/gpt-5.5" },
            "embeddedHarness": { "runtime": "codex", "fallback": "none" }
          }
        ],
        "defaults": {
          "models": {
            "codex/gpt-5.5": { "params": { "thinking": "xhigh" } },
            "openai-codex/gpt-5.5": { "params": { "thinking": "xhigh" } }
          }
        }
      }
    }
  2. Also set ~/.codex/config.toml:

    model = "gpt-5.5"
    model_reasoning_effort = "xhigh"
  3. Open a fresh DM session (Feishu in the original report, any channel routed to this agent will do). Do not use /think and do not touch sessionEntry.thinkingLevel.

  4. Run /status.

Expected behavior

The Codex app-server turn/start request should receive effort: "xhigh" because agentCfg.thinkingDefault = "xhigh" is configured. /status should show:

Model: codex/gpt-5.5
Think: xhigh

Actual behavior

A fresh DM session shows:

Model: codex/gpt-5.5
Think: medium

openclaw config validate passes, all three levels of thinking config (agent.thinkingDefault, agents.defaults.models.codex/gpt-5.5.params.thinking, agents.defaults.models.openai-codex/gpt-5.5.params.thinking) are set to "xhigh", and ~/.codex/config.toml has model_reasoning_effort = "xhigh". Only an explicit /think xhigh or a persisted sessionEntry.thinkingLevel override brings the session back to xhigh.

Root cause (source-grounded)

In dist/get-reply-DIRI0vf6.js, OpenClaw computes two values:

const resolvedThinkLevel = directives.thinkLevel ?? targetSessionEntry?.thinkingLevel;
const resolvedThinkLevelWithDefault =
    resolvedThinkLevel ??
    await modelState.resolveDefaultThinkingLevel() ??
    agentCfg?.thinkingDefault;

but the Codex app-server attempt is built with the non-default-aware value:

thinkLevel: resolvedThinkLevel,  // ← ignores thinkingDefault

Downstream in dist/extensions/codex/run-attempt-sbLvYJcF.js:

function buildTurnStartParams(params, options) {
  return {
    threadId: options.threadId,
    input: buildUserInput(params, options.promptText),
    cwd: options.cwd,
    approvalPolicy: options.appServer.approvalPolicy,
    approvalsReviewer: options.appServer.approvalsReviewer,
    model: params.modelId,
    effort: resolveReasoningEffort(params.thinkLevel)
  };
}

When params.thinkLevel is undefined, effort becomes null, and the Codex app-server falls back to its own default (observed as medium).

Minimal fix

Pass the default-aware value into the Codex app-server attempt params:

- thinkLevel: resolvedThinkLevel,
+ thinkLevel: resolvedThinkLevelWithDefault,

Local hotfix verification

After patching dist/get-reply-DIRI0vf6.js with the diff above and running node --check to validate syntax, plus patching the active session with:

openclaw gateway call sessions.patch \
  --params '{"key":"agent:main:feishu:default:direct:<peerId>","thinkingLevel":"xhigh"}' \
  --json

/status then reports Think: xhigh for Codex app-server runs without any per-message /think directive.

Suggested regression test

Codex app-server run attempt where:

  1. agentCfg.thinkingDefault = "xhigh"
  2. No /think directive
  3. No sessionEntry.thinkingLevel
  4. Model is codex/gpt-5.5

Expected:

attemptParams.thinkLevel === "xhigh"
// and
turnStartParams.effort === "xhigh"

Impact

Users can correctly configure thinkingDefault = "xhigh" and still silently receive medium reasoning on Codex app-server sessions. /status disagrees with the declared configuration, reasoning effort is silently downgraded, and the bug is especially confusing because /think xhigh and explicit session patches both work — only the declarative thinkingDefault is ignored on this path.

OpenClaw version

2026.4.22 (00bd2cf)

Operating system

macOS (tested on an M-series Mac Mini with fnm-managed Node v22.22.0)

Install method

npm

Model

codex/gpt-5.5 (Codex app-server path)

extent analysis

TL;DR

The most likely fix is to pass the default-aware thinking level into the Codex app-server attempt params by changing thinkLevel: resolvedThinkLevel to thinkLevel: resolvedThinkLevelWithDefault in dist/get-reply-DIRI0vf6.js.

Guidance

  • Identify the file dist/get-reply-DIRI0vf6.js and apply the suggested diff to pass the default-aware thinking level.
  • Verify the fix by checking if /status reports Think: xhigh after configuring agentCfg.thinkingDefault = "xhigh" and running a Codex app-server session without any per-message /think directive.
  • Test the regression by checking if attemptParams.thinkLevel and turnStartParams.effort are both set to "xhigh" when agentCfg.thinkingDefault = "xhigh", no /think directive is used, and no sessionEntry.thinkingLevel is set.
  • Ensure the Codex app-server model is codex/gpt-5.5 during testing.

Example

- thinkLevel: resolvedThinkLevel,
+ thinkLevel: resolvedThinkLevelWithDefault,

This change should be applied to dist/get-reply-DIRI0vf6.js to fix the issue.

Notes

The provided fix assumes that the issue is specific to the Codex app-server path and the codex/gpt-5.5 model. The fix may not apply to other models or paths.

Recommendation

Apply the workaround by changing thinkLevel: resolvedThinkLevel to thinkLevel: resolvedThinkLevelWithDefault in dist/get-reply-DIRI0vf6.js, as this directly addresses the identified root cause of the issue.

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

The Codex app-server turn/start request should receive effort: "xhigh" because agentCfg.thinkingDefault = "xhigh" is configured. /status should show:

Model: codex/gpt-5.5
Think: 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