Versioned patches and native build tooling for a Codex CLI variant configured
for the extended context window used by gpt-5.6-sol.
The patch removes two local client clamps:
- A configured context window may exceed the model catalog maximum.
- An automatic-compaction limit of
i64::MAXis preserved instead of being reduced to 90 percent of the context window.
The launcher selects gpt-5.6-sol, sets the context window to 1,050,000 tokens,
and sets the automatic-compaction limit to i64::MAX. These are client-side
changes; the service still decides what requests it accepts.
codex-1m is intentionally a Sol-specific launcher. Do not switch it to another
model with /model: the explicit context and compaction overrides would remain
active. Exit it and start the normal codex launcher when using another model.
This repository contains no authentication data or compiled binaries.
VERSION
launcher/codex-1m
scripts/build
scripts/verify
scripts/install
versions/<version>/codex-1m.patch
versions/<version>/source-commit
artifacts/<version>/<platform>/ # generated and ignored by Git
.work/ # temporary and ignored by Git
VERSION supplies the default version when a command does not receive one. Each
supported Codex version has its own patch and a full upstream commit pin. Builds
and artifacts are native to their platform.
Supported native platforms are:
- Apple silicon macOS:
darwin-arm64 - x86-64 Linux:
linux-x86_64 - ARM64 Linux:
linux-arm64
Install Git, Rust through rustup, and the native build tools for the machine. The upstream checkout pins its Rust toolchain, which rustup installs when needed.
On macOS, install the Xcode Command Line Tools:
xcode-select --installOn Linux, the default build needs file and the binutils strip command.
--keep-symbols also needs objcopy and tar. The source build may require
the usual C/C++ compilation and system-library packages for the distribution.
The scripts use sha256sum when available and otherwise use shasum.
From the repository root:
./scripts/buildOr select a version explicitly:
./scripts/build 0.146.1The build performs the following operations:
- Detects the native platform.
- Clones the upstream
rust-v<version>tag into a unique.work/directory and requires it to resolve toversions/<version>/source-commit. - Confirms and applies
versions/<version>/codex-1m.patch. - Runs one foreground Cargo release build.
- Packages the binary, checks its reported identity using an isolated temporary
CODEX_HOMEinside the build work directory, and generates its manifest. - Assembles a complete artifact directory, moves the prior directory to a temporary backup, and publishes the new directory. An ordinary publication failure restores the backup.
A successful build removes its temporary work directory. A failed build leaves
the work directory in place and reports its path. Work interrupted during
publication can leave a .previous-<platform>.* backup under the version's
artifact directory, preserving the prior complete artifact for recovery.
The default output is:
artifacts/<version>/<platform>/codex
artifacts/<version>/<platform>/manifest.txt
The build refuses publication unless the binary reports the expected identity
under an isolated temporary CODEX_HOME. The manifest records that observed
identity, the source tag and pinned commit, native platform, binary format,
binary and patch checksums, packaging mode, focused-test status, and the Rust
and Cargo versions selected by the upstream source tree. The identity check's
temporary Codex state is removed with the successful build work directory.
When preparing or rebasing a patch for a new Codex version, run its two focused tests before the release build:
./scripts/build --test-patch 0.146.1This runs:
model_context_window_override_can_exceed_catalog_max_context_windowmax_auto_compact_token_limit_disables_context_window_clamp
Failure stops the build before artifact publication and preserves the work
directory. Success is recorded as patch_tests=passed; a normal build records
patch_tests=not-run.
These tests validate the two client changes. They do not test whether the service accepts a particular context length. Because the source commit is pinned and the patch is versioned, normal repeated builds do not need to rerun them.
All modes use the same optimized Cargo release profile:
./scripts/build 0.146.1
./scripts/build --unstripped 0.146.1
./scripts/build --keep-symbols 0.146.1- The default strips the installable binary and discards debugging symbols.
--unstrippedpreserves the optimized symbol-bearing binary.--keep-symbolsstrips the binary and retainsartifacts/<version>/<platform>/codex-symbols.tar.gz.
--unstripped and --keep-symbols are mutually exclusive. Either can be
combined with --test-patch.
Running another build for the same version and platform is supported. The new successful output replaces the old artifact. If the packaging mode no longer retains a symbol archive, any old archive is removed during publication. Builds for the same version and platform must be run sequentially; concurrent publication to the same artifact directory is not supported.
Verify the default native artifact and its generated manifest:
./scripts/verify
./scripts/verify 0.146.1An explicit binary and manifest may also be supplied:
./scripts/verify 0.146.1 /path/to/codex /path/to/manifest.txtVerification checks the version, source tag and pinned commit, literal binary identity, native platform and binary format, packaging metadata, binary checksum, patch checksum, focused-test status, and retained symbol archive when present. Verification does not execute the Codex binary. It checks consistency with the generated manifest and does not independently prove how that manifest was produced.
Install the generated native artifact:
./scripts/install
./scripts/install 0.146.1The installer:
- Verifies the artifact against its generated manifest.
- Copies the binary and manifest into a temporary staging directory.
- Verifies the staged copy.
- Installs it under
~/.local/lib/codex-1m/<version>/. - Points
~/.local/lib/codex-1m/currentat that version. - Installs the launcher as
~/.local/bin/codex-1m, atomically replacing an older regular-file copy when the repository launcher changes.
Installing the same version repeatedly is supported. If the installed binary
and manifest, launcher, and current link already match, the installer returns
without creating a staging copy. If a different verified build of the same
version is present, the installer stages it, replaces the prior version
directory, and removes the temporary backup after success. A launcher being
replaced is also retained until the current link switches successfully and is
restored if that transaction fails.
The retained symbol archive is not installed. It remains in the ignored artifact directory.
Ensure ~/.local/bin is on PATH, then check the installed version:
codex-1m --versionStart the TUI and confirm that its status line shows the expected model and
1.05M window:
codex-1mSign in independently on each machine. Do not copy authentication files between machines.
Synchronize the repository without compiled artifacts or temporary build work:
rsync -a --exclude artifacts/ --exclude .work/ \
./ user@host:~/workspace/codex-1m/On the destination machine, build and install natively:
cd ~/workspace/codex-1m
./scripts/build
./scripts/install
codex-1m --versionA Linux artifact does not run on macOS, and a macOS artifact does not run on Linux. Build on each target platform instead of transporting binaries.
For a new upstream version:
- Create
versions/<new-version>/codex-1m.patchby rebasing the two source changes and their focused tests against the upstream tag. - Record the tag's reviewed full commit SHA in
versions/<new-version>/source-commit. - Update
VERSIONif the new version should become the default. - Run
./scripts/build --test-patch <new-version>on one native development machine. This also produces that machine's release artifact. - Run the normal native build on each remaining platform that will use the binary.
- Run
./scripts/verify <new-version>and./scripts/install <new-version>on each machine. - Smoke-test
codex-1m --versionand the TUI context-window display. Keep that launcher ongpt-5.6-sol; use normalcodexfor other models.
The patch must be reviewed and rebased for each upstream version. A clean
git apply result alone does not prove that upstream semantics remain
compatible with the two changes.