Tested with Codex CLI 0.125.0 / upstream rust-v0.125.0.
This package patches the local Codex client so gpt-5.5 can honor an explicit
model_context_window up to 1_000_000 without being clamped to 272_000.
When the override is present, it also sets the effective context window percent
to 100, avoiding the additional 95% local reduction.
It does not change the OpenAI backend. If the backend rejects or truncates a 1M request, this local patch cannot override that.
gpt55-long-context.patch: source patch forcodex-rs/models-manager.install-patched-codex.sh: clone/apply/test/build/install helper.
./install-patched-codex.sh --dry-runUse an existing checkout:
./install-patched-codex.sh --dry-run --source-dir ../codex./install-patched-codex.sh --source-dir ../codexThe installer:
- resolves the native Codex binary behind the npm
codexwrapper; - applies
gpt55-long-context.patchunless it is already applied; - sets the Cargo workspace version to the currently installed
codex --version; - runs
cargo test -p codex-models-manager; - builds
codex-cliwith release LTO disabled by default for local install speed; - backs up the installed native binary;
- replaces only the native binary, not the npm wrapper.
It patches the npm/global Codex binary it detects from command -v codex.
Already-running app-server processes and editor-extension bundled Codex binaries
are separate binaries and need their own restart or patch path.
The upstream release profile uses fat LTO and can spend a long time in the
final link step. Use --fat-lto only when you want the upstream-size-optimized
binary and are willing to wait.
Set the context explicitly in ~/.codex/config.toml:
model = "gpt-5.5"
model_context_window = 1000000
model_auto_compact_token_limit = 980000Without model_context_window, the patch leaves the existing gpt-5.5 catalog
defaults unchanged.
./install-patched-codex.sh --source-dir ../codex --no-installBuild with upstream fat LTO:
./install-patched-codex.sh --source-dir ../codex --fat-lto