fix(codex): scope CLI configuration to launch - #2519
Draft
wolfyy970 wants to merge 1 commit into
Draft
Conversation
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.
Closes #2517.
Why
omlx launch codexcurrently writes its model and provider into~/.codex/config.toml. Those values survive the CLI process and can affect the next normal Codex launch. The integration also has the selected model's effective context window but does not give it to Codex.This is a narrow CLI fix while draft #2470 develops the full desktop and hybrid-routing integration. It does not change
codex_app.pyor try to duplicate the interceptor.What changed
-coverridesmodel_context_window-margumentmodel_auto_compact_token_limitunset so Codex derives its current 90% thresholdThe user's normal Codex config remains available underneath these overrides, including
[agents], MCP servers, sandbox settings, and other preferences.Verification
uv run pytest tests/test_integrations.py -q(107 passed)uv run pytest tests/ -m "not slow and not integration" -q(7,796 passed, 64 skipped, 71 deselected)uv run ruff check omlx/integrations/codex.py tests/test_integrations.py~/.codex/config.tomlwas unchanged before and after the CLI validationRelationship to #2470
#2470 is the stronger long-term design for Codex Desktop. It preserves native local and cloud model slots, adapts the model catalogue with the real local context window, and handles the desktop process lifecycle through a scoped proxy.
This PR only makes the existing custom-provider CLI launch safer and context-aware. Codex's
appcommand currently accepts-csyntactically but does not forward those overrides to the macOS app process, socodex_appis intentionally out of scope.