Skip to content

[codex] Preserve disabled MCP servers across runtime overlays#27414

Merged
e-provencher merged 2 commits into
mainfrom
eprovencher/fix-disabled-mcp-initialization
Jun 10, 2026
Merged

[codex] Preserve disabled MCP servers across runtime overlays#27414
e-provencher merged 2 commits into
mainfrom
eprovencher/fix-disabled-mcp-initialization

Conversation

@e-provencher

Copy link
Copy Markdown
Contributor

Why

Recent MCP runtime overlay changes replace same-name configured server entries with compatibility or extension-provided configs. Those replacement configs default to enabled, so an MCP server explicitly configured with enabled = false could be initialized anyway.

The connection manager still filters disabled servers correctly, but the configured disabled state was lost before initialization reached that filter.

What changed

  • Remember MCP servers that are disabled in the configured view before applying runtime fallbacks and extension overlays.
  • Restore enabled = false for those servers after overlays, while leaving all other overlay fields and Remove precedence unchanged.
  • Add focused extension-backed regression coverage for a disabled codex_apps server.

Testing

  • just fmt
  • just test -p codex-mcp-extension
  • just fix -p codex-core
  • just fix -p codex-mcp-extension

The full workspace just test suite was not run.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@e-provencher

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 10, 2026
@e-provencher e-provencher marked this pull request as ready for review June 10, 2026 16:39
@e-provencher e-provencher requested a review from a team as a code owner June 10, 2026 16:39
@jif-oai

jif-oai commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1db1d33d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

#[tokio::test]
async fn runtime_overlay_preserves_disabled_server() -> TestResult {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cover disabled Apps tools through a Codex turn

This only asserts effective_servers, so it can pass even if a Codex turn still sends codex_apps tools in /responses. Because this overlay changes agent MCP tool exposure, add a core/suite test_codex turn asserting disabled Apps tools are absent from the model request, per guidance.

Useful? React with 👍 / 👎.

@e-provencher e-provencher merged commit 980f60b into main Jun 10, 2026
31 of 32 checks passed
@e-provencher e-provencher deleted the eprovencher/fix-disabled-mcp-initialization branch June 10, 2026 20:11
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants