openclaw - ✅(Solved) Fix Installed 2026.3.24 still resolves openai-codex/gpt-5.4 to ~266k unless models.providers override is added [1 pull requests, 1 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#55461Fetched 2026-04-08 01:39:14
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Author
Participants
Timeline (top)
cross-referenced ×1

On an installed OpenClaw 2026.3.24, openai-codex/gpt-5.4 still resolves locally as roughly 266k/272k context in openclaw models list, even though upstream work around GPT-5.4 large-context support has already landed.

In practice, this can trigger unnecessarily early local compaction pressure for long sessions.

A supported config override under models.providers.openai-codex.models[] fixes it immediately on this machine and restores a ~1M-class context window for runtime behavior.

Root Cause

This was operationally significant because a long Telegram topic session kept getting pushed toward compaction much earlier than expected.

Fix Action

Fix / Workaround

Observed before workaround

Example local output:

Supported config workaround that fixed it here

This config block was added:

At minimum, the config workaround above is effective and could be documented as an interim fix if there is still another unresolved path.

PR fix notes

PR #62694: Agents: prefer runtime-resolved metadata for explicit codex gpt-5.4

Description (problem / solution / changelog)

Summary

Fixes openai-codex/gpt-5.4 resolution so an explicit model selection can still prefer provider runtime metadata when the provider reports a larger context window than the static registry entry.

This PR now:

  • lets the openai-codex plugin opt into runtime-preferred resolution via a provider-owned preferRuntimeResolvedModel hook instead of a hardcoded core special case
  • compares the explicit registry model with the provider runtime-resolved model only for providers that opt in, so normal explicit-model resolution still short-circuits for everyone else
  • preserves the correct runtime hook inputs by passing the configured workspace directory as workspaceDir while keeping agentDir available separately in context
  • adds focused regression coverage for the gpt-5.4 runtime-preference path
  • includes the follow-up review fixes that repaired the runtime hook plumbing and workspace handling

Testing

  • pnpm exec vitest run src/agents/pi-embedded-runner/model.test.ts
  • pnpm build

Fixes #55461

Thanks to Rudi Cilibrasi and Metagood.com for building and funding this fix.

Changed files

  • CHANGELOG.md (modified, +2/-0)
  • extensions/openai/openai-codex-provider.ts (modified, +3/-0)
  • src/agents/pi-embedded-runner/model.provider-runtime.test-support.ts (modified, +6/-0)
  • src/agents/pi-embedded-runner/model.test.ts (modified, +127/-0)
  • src/agents/pi-embedded-runner/model.ts (modified, +69/-3)
  • src/plugins/provider-runtime.ts (modified, +13/-0)
  • src/plugins/types.ts (modified, +14/-0)

Code Example

openclaw models list | rg 'openai-codex/gpt-5\.4|gpt-5\.4'

---

openai-codex/gpt-5.4                       text       266k     no    yes   default,configured

---

{
  models: {
    mode: "merge",
    providers: {
      "openai-codex": {
        baseUrl: "https://chatgpt.com/backend-api",
        api: "openai-codex-responses",
        models: [
          {
            id: "gpt-5.4",
            name: "gpt-5.4",
            contextWindow: 1050000,
            maxTokens: 128000,
          },
        ],
      },
    },
  },
}

---

openai-codex/gpt-5.4                       text       1025k    no    yes   default,configured

---

🧠 Model: openai-codex/gpt-5.4 · 🔑 oauth (openai-codex:default)
🧮 Tokens: 560k in / 381 out
📚 Context: 560k/1.1m (53%) · 🧹 Compactions: 1
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect model metadata / premature compaction risk)

Summary

On an installed OpenClaw 2026.3.24, openai-codex/gpt-5.4 still resolves locally as roughly 266k/272k context in openclaw models list, even though upstream work around GPT-5.4 large-context support has already landed.

In practice, this can trigger unnecessarily early local compaction pressure for long sessions.

A supported config override under models.providers.openai-codex.models[] fixes it immediately on this machine and restores a ~1M-class context window for runtime behavior.

Why I think this is still an active bug path

Issue #37875 and PR #37876 addressed the forward-compat fallback path, but the installed 2026.3.24 build here still showed:

  • openclaw models list -> openai-codex/gpt-5.4 ... 266k

After adding an explicit provider-model override in config and restarting the gateway, the same install showed:

  • openclaw models list -> openai-codex/gpt-5.4 ... 1025k
  • /status in the live Telegram topic session -> Context: 560k/1.1m (53%)

That strongly suggests there is still a runtime/catalog resolution path where the installed build inherits stale Codex template limits unless the provider model is explicitly overridden.

Environment

  • OpenClaw: 2026.3.24
  • Model: openai-codex/gpt-5.4
  • Auth: Codex OAuth (openai-codex:default)
  • Channel: Telegram forum topic session
  • Gateway mode: local macOS launch agent

Repro

  1. Install/update OpenClaw to 2026.3.24
  2. Set default model to openai-codex/gpt-5.4
  3. Run:
    openclaw models list | rg 'openai-codex/gpt-5\.4|gpt-5\.4'
  4. Observe the context window is still reported around 266k

Observed before workaround

Example local output:

openai-codex/gpt-5.4                       text       266k     no    yes   default,configured

This was operationally significant because a long Telegram topic session kept getting pushed toward compaction much earlier than expected.

Supported config workaround that fixed it here

This config block was added:

{
  models: {
    mode: "merge",
    providers: {
      "openai-codex": {
        baseUrl: "https://chatgpt.com/backend-api",
        api: "openai-codex-responses",
        models: [
          {
            id: "gpt-5.4",
            name: "gpt-5.4",
            contextWindow: 1050000,
            maxTokens: 128000,
          },
        ],
      },
    },
  },
}

After gateway restart:

openai-codex/gpt-5.4                       text       1025k    no    yes   default,configured

And in the live session /status:

🧠 Model: openai-codex/gpt-5.4 · 🔑 oauth (openai-codex:default)
🧮 Tokens: 560k in / 381 out
📚 Context: 560k/1.1m (53%) · 🧹 Compactions: 1

Expected behavior

Installed OpenClaw should resolve openai-codex/gpt-5.4 with the correct large context window by default, without requiring an explicit models.providers.openai-codex.models[] override.

Actual behavior

Installed OpenClaw 2026.3.24 still reports and appears to use a ~272k-class local window unless explicitly overridden in config.

Impact

  • premature local compaction
  • unnecessary compaction timeout exposure
  • misleading model/status output
  • avoidable risk for long-lived topic/thread sessions

Suggestion

Please check whether the #37876 fix is present only in one forward-compat/catalog path while installed/runtime resolution still falls back to stale Codex metadata somewhere else.

At minimum, the config workaround above is effective and could be documented as an interim fix if there is still another unresolved path.

extent analysis

Fix Plan

To resolve the issue with OpenClaw 2026.3.24 and openai-codex/gpt-5.4 model, follow these steps:

  • Add a supported config override under models.providers.openai-codex.models[] to fix the context window issue.
  • Example config block:
{
  models: {
    mode: "merge",
    providers: {
      "openai-codex": {
        baseUrl: "https://chatgpt.com/backend-api",
        api: "openai-codex-responses",
        models: [
          {
            id: "gpt-5.4",
            name: "gpt-5.4",
            contextWindow: 1050000,
            maxTokens: 128000,
          },
        ],
      },
    },
  },
}
  • Restart the gateway after adding the config override.

Verification

To verify that the fix worked:

  • Run openclaw models list | rg 'openai-codex/gpt-5\.4|gpt-5\.4' and check if the context window is reported around 1025k.
  • Check the /status output in the live Telegram topic session to ensure the context window is correctly displayed.

Extra Tips

  • Ensure that the #37876 fix is present in all relevant paths, not just the forward-compat/catalog path.
  • Document the config workaround as an interim fix if there is still another unresolved path.
  • Monitor the issue to ensure that the fix does not introduce any regressions.

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

Installed OpenClaw should resolve openai-codex/gpt-5.4 with the correct large context window by default, without requiring an explicit models.providers.openai-codex.models[] override.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING