Skip to content

fix: recover mcp server port conflicts#34

Merged
lynnswap merged 1 commit into
mainfrom
codex/mcp-port-conflict-recovery
Jun 9, 2026
Merged

fix: recover mcp server port conflicts#34
lynnswap merged 1 commit into
mainfrom
codex/mcp-port-conflict-recovery

Conversation

@lynnswap

@lynnswap lynnswap commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Purpose

Fix CodexReviewMonitor startup recovery when the MCP HTTP endpoint port is already occupied by a stale process.

Changes

  • Classify MCP HTTP bind failures as addressInUse instead of surfacing the raw NIO error.
  • Preflight the MCP bind before launching codex app-server, then start the real MCP listener only after the app-server backend is ready.
  • Add best-effort port owner diagnostics without exposing full process argv.
  • Keep the sidebar in an unavailable server-state presentation for starting, stopped, and failed states.
  • Cover port conflict startup, owner diagnostics, bind classification, and sidebar unavailable states in tests.

Testing

  • codex-review on uncommitted changes: passed with no findings
  • swift test --build-system swiftbuild --no-parallel
  • xcodebuild test -project Tools/ReviewMonitor/CodexReviewMonitor.xcodeproj -scheme CodexReviewMonitor -destination 'platform=macOS,arch=arm64' CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO

@lynnswap lynnswap merged commit 962cf8d into main Jun 9, 2026
1 check passed
@lynnswap lynnswap deleted the codex/mcp-port-conflict-recovery branch June 9, 2026 09:12
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