macOS patcher for making Codex Desktop run local threads with a 1M-token context window.
What it does:
- starts the Codex Desktop
app-serverwithmodel_context_window=1000000 - sets
model_auto_compact_token_limit=900000 - sets
model_auto_compact_token_limit_scope=body_after_prefix - writes
~/.codex/codex-1m/model_catalog_1m.json - rewrites every model in that catalog to a visible/effective 1M context window
- rewrites the context usage tooltip to display 1M instead of 1000k
- migrates old local rollout files so reopened threads do not keep stale
258400context metadata - removes stale "full context" token markers from old context-window failures
- repacks
app.asarin place using a temporary file - updates Electron ASAR integrity in
Info.plist - ad-hoc signs the patched app
- force-restarts Codex Desktop and kills every Desktop
app-serversidecar - installs the
Codex 1M auto-reapply jobLaunchAgent for app updates
The LaunchAgent is:
~/Library/LaunchAgents/ai.companion.codex-1m.plist
with launchd label:
ai.companion.codex-1m
Logs go to:
~/Library/Logs/codex-1m/
Apply once and force-restart Codex Desktop:
curl -fsSL https://raw.githubusercontent.com/companion-inc/codex-1m/main/install.sh | bash -s -- applyApply now and auto-reapply after app updates:
curl -fsSL https://raw.githubusercontent.com/companion-inc/codex-1m/main/install.sh | bash -s -- install-agentCheck status:
~/.codex/codex-1m/install.sh statusRemove the auto-reapply job:
~/.codex/codex-1m/install.sh uninstall-agentThe launch args become:
codex app-server --analytics-default-enabled \
-c model_context_window=1000000 \
-c model_auto_compact_token_limit=900000 \
-c model_auto_compact_token_limit_scope=body_after_prefix \
-c 'model_catalog_json="/Users/you/.codex/codex-1m/model_catalog_1m.json"'This patches local Codex metadata and UI behavior for all local Desktop threads/models launched through the patched app-server. The model/provider still has to actually accept the requested window.