openclaw - 💡(How to fix) Fix Clarify canonical context metadata for openai-codex/gpt-5.5: 272k contextTokens vs 400k contextWindow [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#71403Fetched 2026-04-26 05:13:13
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1subscribed ×1

There still appears to be a separate metadata consistency question for openai-codex/gpt-5.5: different OpenClaw catalog/runtime paths report different context values for the same model.

This is distinct from #71294, which fixed the session persistence fallback to 200_000. That fix makes sessions preserve the runtime-resolved value, but it does not clarify which value is canonical for openai-codex/gpt-5.5.

Root Cause

After #71294, session persistence should no longer fall back to 200_000. However, users may still see conflicting context values:

provider constant / contextTokens: 272000
models list / contextWindow:     400000 (~391k displayed)

This makes it hard to know the actual expected runtime context budget and whether status/session values are correct.

Code Example

{
  "key": "openai-codex/gpt-5.5",
  "name": "GPT-5.5",
  "input": "text+image",
  "contextWindow": 400000,
  "local": false,
  "available": true
}

---

openai-codex/gpt-5.5  text+image 391k  no  yes

---

const OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS = 272e3;

---

contextTokens: OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS

---

/opt/homebrew/lib/node_modules/openclaw/dist/openai-codex-provider-1vlUUIdx.js#L35
/opt/homebrew/lib/node_modules/openclaw/dist/openai-codex-provider-1vlUUIdx.js#L149

---

contextWindow: 400000

---

/opt/homebrew/lib/node_modules/openclaw/dist/extensions/openai/node_modules/@mariozechner/pi-ai/dist/models.generated.js

---

provider constant / contextTokens: 272000
models list / contextWindow:     400000 (~391k displayed)
RAW_BUFFERClick to expand / collapse

Summary

There still appears to be a separate metadata consistency question for openai-codex/gpt-5.5: different OpenClaw catalog/runtime paths report different context values for the same model.

This is distinct from #71294, which fixed the session persistence fallback to 200_000. That fix makes sessions preserve the runtime-resolved value, but it does not clarify which value is canonical for openai-codex/gpt-5.5.

Observed

Environment where this was observed:

  • OpenClaw: 2026.4.23 / latest release at time of investigation
  • Model: openai-codex/gpt-5.5
  • Provider: openai-codex
  • Runner: embedded Pi / direct runtime

1. openclaw models list --json reports 400000

openclaw models list --all --json reports:

{
  "key": "openai-codex/gpt-5.5",
  "name": "GPT-5.5",
  "input": "text+image",
  "contextWindow": 400000,
  "local": false,
  "available": true
}

The table view displays this as roughly 391k, presumably due to 1024-based formatting:

openai-codex/gpt-5.5  text+image 391k  no  yes

2. OpenAI Codex provider code has 272000 default context tokens

In the OpenAI Codex provider implementation, gpt-5.5 appears to have a different runtime context token constant:

const OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS = 272e3;

and the forward-compat model definition uses it as:

contextTokens: OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS

Local compiled paths observed:

/opt/homebrew/lib/node_modules/openclaw/dist/openai-codex-provider-1vlUUIdx.js#L35
/opt/homebrew/lib/node_modules/openclaw/dist/openai-codex-provider-1vlUUIdx.js#L149

3. Generated model catalog reports 400000 contextWindow

The generated Pi model catalog has openai-codex/gpt-5.5 with:

contextWindow: 400000

Example local compiled path:

/opt/homebrew/lib/node_modules/openclaw/dist/extensions/openai/node_modules/@mariozechner/pi-ai/dist/models.generated.js

Question / expected behavior

Which value is intended to be canonical for openai-codex/gpt-5.5?

  • If the intended runtime budget is 400000, should the provider-specific OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS = 272e3 be updated or removed to avoid confusion?
  • If the intended runtime budget is 272000, should openclaw models list avoid displaying the generated catalog contextWindow: 400000 as the effective context size?
  • Should models list display both values when they differ, e.g. native/contextWindow vs runtime/contextTokens?

Why this matters

After #71294, session persistence should no longer fall back to 200_000. However, users may still see conflicting context values:

provider constant / contextTokens: 272000
models list / contextWindow:     400000 (~391k displayed)

This makes it hard to know the actual expected runtime context budget and whether status/session values are correct.

Related

  • #71294 fixed the 200_000 session fallback bug.
  • This issue is about the remaining 272000 vs 400000 metadata/source-of-truth mismatch.

extent analysis

TL;DR

Update the OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS constant to match the intended canonical value for openai-codex/gpt-5.5, which is likely 400000.

Guidance

  • Verify the intended runtime budget for openai-codex/gpt-5.5 by checking the model's documentation or configuration.
  • If the intended runtime budget is 400000, update the OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS constant to 400000 to avoid confusion.
  • Consider displaying both the native and runtime context values in openclaw models list when they differ, to provide clarity on the actual expected runtime context budget.
  • Review the generated model catalog and openclaw models list output to ensure consistency with the updated canonical value.

Example

const OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS = 400000;

Notes

The correct canonical value for openai-codex/gpt-5.5 is unclear from the provided information, and further investigation may be necessary to determine the intended runtime budget.

Recommendation

Apply workaround: update the OPENAI_CODEX_GPT_55_DEFAULT_CONTEXT_TOKENS constant to match the intended canonical value, likely 400000, to ensure consistency and avoid confusion.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING