Skip to content

professional-ALFIE/codex-gpt55-long-context-patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

GPT-5.5 long-context patch for installed Codex

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.

Files

  • gpt55-long-context.patch: source patch for codex-rs/models-manager.
  • install-patched-codex.sh: clone/apply/test/build/install helper.

Dry run

./install-patched-codex.sh --dry-run

Use an existing checkout:

./install-patched-codex.sh --dry-run --source-dir ../codex

Install

./install-patched-codex.sh --source-dir ../codex

The installer:

  1. resolves the native Codex binary behind the npm codex wrapper;
  2. applies gpt55-long-context.patch unless it is already applied;
  3. sets the Cargo workspace version to the currently installed codex --version;
  4. runs cargo test -p codex-models-manager;
  5. builds codex-cli with release LTO disabled by default for local install speed;
  6. backs up the installed native binary;
  7. 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.

Config

Set the context explicitly in ~/.codex/config.toml:

model = "gpt-5.5"
model_context_window = 1000000
model_auto_compact_token_limit = 980000

Without model_context_window, the patch leaves the existing gpt-5.5 catalog defaults unchanged.

Build without replacing installed Codex

./install-patched-codex.sh --source-dir ../codex --no-install

Build with upstream fat LTO:

./install-patched-codex.sh --source-dir ../codex --fat-lto

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages