Repository navigation
feat(openai): make million-token context an explicit opt-in - #112916
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 23, 2026 05:19
steipete
force-pushed
the
steipete/fervent-easley-09d5c5
branch
from
July 23, 2026 06:28
ee66313 to
016d79b
Compare
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: feat(openai): make million-token context an explicit opt-in This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
steipete
force-pushed
the
steipete/fervent-easley-09d5c5
branch
from
July 23, 2026 07:05
016d79b to
060748d
Compare
Contributor
Author
|
Land-ready proof for
Known gap: the first Testbox |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 24, 2026
…#112916) * feat(openai): add safe long-context opt-in * fix(ci): keep long-context checks within gates * fix(ci): keep Codex usage helpers internal
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
OpenAI GPT-5.5 and GPT-5.6 expose a 1,050,000-token Platform API context window, but requests above 272,000 input tokens use materially higher long-context pricing. OpenClaw currently exposes the full GPT-5.6 window by default, which makes ordinary API-key sessions unexpectedly expensive, while the long-context configuration and Codex harness proof are incomplete.
This also fixes the Codex live harness silently ignoring its context overrides because
app-serverconfiguration flags were placed before the subcommand instead of after it.Why This Change Was Made
The OpenAI plugin now keeps the native provider window as metadata while defaulting GPT-5.5 and GPT-5.6 active runtime budgets to 272,000 tokens across API-key and ChatGPT/Codex routes. Operators can explicitly opt into a derived 922,000-token input budget, with a conservative 700,000-token compaction target that leaves room for a large incoming turn.
The Codex harness now projects native context-window and prompt-token usage, applies app-server overrides in the correct argument position, and has separate automatic-compaction and full-context checkpoint stress modes. The embedded OpenAI runtime gets a permanent live repeated-compaction test as well.
AI-assisted: implementation and review used Claude Code and Codex autoreview. I understand and verified the resulting ownership boundaries and runtime behavior.
User Impact
/statusand live proof can observe Codex's native effective context window instead of relying only on OpenClaw catalog metadata.Evidence
node scripts/run-vitest.mjs extensions/openai/openclaw.plugin.test.ts extensions/openai/openai-provider.test.ts extensions/openai/openai-chatgpt-provider.test.ts extensions/codex/src/app-server/event-projector.usage.test.ts src/gateway/gateway-codex-harness.live-helpers.test.tspnpm buildpnpm docs:check-mdx && pnpm docs:check-links && pnpm docs:check-i18n-glossaryapp-server -cargument placement./statusreportedContext: 24k/48kandCompactions: 3.pnpm check:changedwas also attempted on Blacksmith Testbox https://github.com/openclaw/openclaw/actions/runs/29957455751; it stopped on the existing main-branch max-lines baseline shrink requirement before reaching changed-surface gates. Focused tests, build, docs checks, and live proofs above passed on the final candidate.