Skip to content

fix(core): preserve non-app MCP tools in apps mode#11841

Open
karel-openai wants to merge 1 commit intomainfrom
karel/fix-apps-mcp-tool-drop
Open

fix(core): preserve non-app MCP tools in apps mode#11841
karel-openai wants to merge 1 commit intomainfrom
karel/fix-apps-mcp-tool-drop

Conversation

@karel-openai
Copy link

Summary

This fixes a regression where enabling Feature::Apps could hide non-codex_apps MCP tools (e.g. Notion MCP write tools) from the model tool list.

In built_tools, the apps path rebuilt mcp_tools from:

  • selected MCP tools (if any), plus
  • filtered codex_apps tools.

When there was no MCP tool selection yet, this effectively dropped non-codex_apps servers from model-visible tools.

Root Cause

built_tools applied apps filtering by constructing a reduced MCP map and assigning it back to mcp_tools.
That reduced map only guaranteed codex_apps tool inclusion, so tools from other MCP servers could disappear even though those servers were started and healthy.

Fix

  • Introduce merge_apps_mode_mcp_tools(...) to merge app-filtered tools with selected tools.
  • Preserve non-codex_apps MCP tools when there is no explicit MCP tool selection.
  • Preserve explicit selection behavior when selection is present.

Tests

Added unit tests in codex-rs/core/src/codex.rs:

  • apps_mode_keeps_non_codex_apps_mcp_tools_without_selection
  • apps_mode_respects_explicit_tool_selection

Ran:

  • cargo test -p codex-core apps_mode_keeps_non_codex_apps_mcp_tools_without_selection -- --nocapture
  • cargo test -p codex-core apps_mode_respects_explicit_tool_selection -- --nocapture

User Impact

With apps enabled, MCP tools from non-app servers (including Notion MCP write tools) remain callable unless explicitly filtered by selection semantics.

@github-actions
Copy link
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@karel-openai karel-openai marked this pull request as ready for review February 15, 2026 02:39
&mcp_tools,
selected_mcp_tools,
apps_mcp_tools,
selected_tool_names.is_none(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should include non-apps MCP tools regardless of the current selection.

@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants