Skip to content

fix: merge CODEX_CONFIG MCP servers - #507

Closed
kocaemre wants to merge 1 commit into
agentclientprotocol:mainfrom
kocaemre:fix/merge-codex-config-mcp-servers
Closed

kocaemre wants to merge 1 commit into
agentclientprotocol:mainfrom
kocaemre:fix/merge-codex-config-mcp-servers

Conversation

@kocaemre

Copy link
Copy Markdown

Summary

Test Plan

  • npm test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts -t 'preserves MCP servers from CODEX_CONFIG'
  • npm run typecheck
  • npm test
  • git diff --check

Claude Code note: attempted claude -p diff review locally, but this machine's Claude Code is not logged in (Not logged in · Please run /login).

@kocaemre
kocaemre force-pushed the fix/merge-codex-config-mcp-servers branch from f68e2b0 to 1859cc7 Compare September 30, 2026 02:02
@kocaemre

Copy link
Copy Markdown
Author

Rebased this onto the current main and resolved the MCP config merge conflict by keeping the current normalized MCP serialization while preserving existing CODEX_CONFIG.mcp_servers entries.

Verification on head 1859cc7:

  • npm ci
  • npm run test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts -t 'CODEX_CONFIG|sanitizes whitespace in ACP MCP server names' — 2 passed, 111 skipped
  • npm run test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts — 113 passed
  • npm run typecheck
  • npm run build
  • git diff --check upstream/main..HEAD

Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
@kocaemre
kocaemre force-pushed the fix/merge-codex-config-mcp-servers branch from 1859cc7 to d75174f Compare October 1, 2026 03:42
@kocaemre

kocaemre commented Oct 1, 2026

Copy link
Copy Markdown
Author

Rebased this onto current main after the 2.1.0 release and resolved the MCP config conflict by preserving the current createMcpSeverConfig(...) path while keeping the existing CODEX_CONFIG.mcp_servers merge behavior.

Local verification on the rebased head:

  • npm ci
  • npm run test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts -t 'CODEX_CONFIG|sanitizes whitespace in ACP MCP server names' — 2 passed / 111 skipped
  • npm run test -- src/__tests__/CodexACPAgent/CodexAcpClient.test.ts — 113 passed
  • npm run typecheck
  • npm run build
  • git diff --check upstream/main..HEAD

@kocaemre

Copy link
Copy Markdown
Author

Closing this as duplicate of #490. That earlier PR preserves CODEX_CONFIG.mcp_servers when ACP adds another server with the same object-merge behavior, and also tests conflicts and session isolation. No need to ask maintainers to review two implementations of the same fix.

@kocaemre kocaemre closed this Oct 10, 2026
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.

MCP env overrides in CODEX_CONFIG get dropped when a session adds another MCP server

1 participant