fix(codex): set platform env for plugin MCP server#722
Merged
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.
Summary
CONTEXT_MODE_PLATFORM=codexin the Codex plugin MCP manifestWhy
On Windows machines with both Claude Code and Codex installed, context-mode can otherwise fall through config-dir detection and pick
claude-codebecause~/.claudeexists before~/.codex. The Codex hook wrappers already setCONTEXT_MODE_PLATFORM=codex; this makes the plugin MCP server get the same platform signal.This keeps Codex plugin storage and doctor output under
~/.codex/context-modeinstead of accidentally falling back to Claude storage before client/platform metadata is available.Validation
npx vitest run tests/plugins/codex-manifest.test.ts --reporter=dotnpx vitest run tests/core/cli.test.ts tests/plugins/codex-manifest.test.ts tests/adapters/detect.test.ts --reporter=dotnpx vitest run tests/core/server.test.ts -t "getDefaultSessionDir|ctx_doctor reports storage|Storage sessions" --reporter=dotnpm run typecheckgit diff --checkManual Codex check on Windows:
codex-cli 0.133.0.codex-plugin/mcp.jsoncodex mcp get context-mode-env-testshowedCONTEXT_MODE_PLATFORMattached to the MCP server env, confirming Codex consumes this manifest field in the actual plugin registration path