Skip to content

fix(codex): harden Weixin MCP startup in desktop launches - #19

Open
logicrw wants to merge 1 commit into
qufei1993:mainfrom
logicrw:fix/codex-mcp-startup
Open

fix(codex): harden Weixin MCP startup in desktop launches#19
logicrw wants to merge 1 commit into
qufei1993:mainfrom
logicrw:fix/codex-mcp-startup

Conversation

@logicrw

@logicrw logicrw commented May 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent the Codex Weixin MCP server from failing during initialize when Codex App launches it outside a login shell.
  • Make the standalone Codex bridge script clean up its spawned app-server process and avoid lockfile churn during startup.

Changes

  • Add a plugin-relative cwd and explicit Bun PATH setup to .codex-mcp.json.
  • Use --frozen-lockfile during startup dependency checks.
  • Add regression coverage for sparse PATH and non-plugin working directory launches.
  • Document the connection closed: initialize response troubleshooting path for Codex users.

Testing

  • bun test
  • bun run typecheck
  • Verified installed plugin MCP handshake with a clean PATH environment

Codex App plugin launches can inherit a sparse PATH and an unpredictable working directory, which made the Weixin MCP server exit before initialize when bun was only available through user shell setup.

The plugin MCP config now sets a plugin-relative cwd, normalizes Bun lookup paths, freezes dependency installation to avoid lockfile churn, and keeps CODEX_PLUGIN_ROOT as an override for clients that provide it. The standalone Codex bridge script gets the same PATH handling plus cleanup for the spawned app-server process.

Constraint: Codex App can start plugin MCP processes outside a login shell

Rejected: Require users to launch Codex from a configured terminal | desktop app launches should work without shell-specific PATH setup

Rejected: Hardcode an absolute plugin path in upstream config | installed plugin paths are user-specific

Confidence: high

Scope-risk: narrow

Directive: Do not remove the cwd/PATH setup unless Codex guarantees plugin root cwd and Bun path inheritance

Tested: bun test

Tested: bun run typecheck

Tested: installed plugin MCP handshake with clean PATH

Not-tested: Codex desktop app plugin reload on other operating systems

Co-authored-by: OmX <omx@oh-my-codex.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant