Skip to content

core: allow excluding tool namespaces from code mode#26320

Merged
sayan-oai merged 2 commits into
mainfrom
codex/exclude-code-mode-tool-namespaces
Jun 4, 2026
Merged

core: allow excluding tool namespaces from code mode#26320
sayan-oai merged 2 commits into
mainfrom
codex/exclude-code-mode-tool-namespaces

Conversation

@sayan-oai

@sayan-oai sayan-oai commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Why

Research and training setups need to control which tool namespaces appear inside code mode's nested tools surface without disabling those tools entirely. This makes it possible to train against a deliberately reduced nested-tool setup while preserving the normal direct and deferred tool paths.

What

  • Extend features.code_mode to accept structured configuration while preserving the existing boolean syntax.

  • Add an exact excluded_tool_namespaces list under [features.code_mode]:

    [features.code_mode]
    enabled = true
    excluded_tool_namespaces = ["mcp__codex_apps", "multi_agent_v1"]
  • Filter matching canonical ToolName namespaces when constructing code mode's nested router and code-mode-specific direct tool descriptions.

  • Keep excluded tools registered, directly exposed in mixed code mode, and discoverable through top-level tool_search when otherwise eligible.

  • Derive deferred nested-tool guidance after namespace filtering so the exec description does not advertise excluded-only deferred tools.

  • Preserve the boolean/table representation when materializing config locks and update the generated config schema.

Testing

  • just test -p codex-features
  • just test -p codex-config
  • just test -p codex-core load_config_resolves_code_mode_config
  • just test -p codex-core lock_contains_prompts_and_materializes_features
  • just test -p codex-core excluded_deferred_namespaces_do_not_enable_nested_tool_guidance
  • just test -p codex-core code_mode_excludes_configured_nested_tool_namespaces
  • cargo check -p codex-thread-manager-sample

@sayan-oai sayan-oai requested a review from a team as a code owner June 4, 2026 05:44
@sayan-oai sayan-oai force-pushed the codex/exclude-code-mode-tool-namespaces branch from 9a073ee to f5ada08 Compare June 4, 2026 05:54
@sayan-oai sayan-oai enabled auto-merge (squash) June 4, 2026 18:33
@sayan-oai sayan-oai merged commit 8b12388 into main Jun 4, 2026
31 checks passed
@sayan-oai sayan-oai deleted the codex/exclude-code-mode-tool-namespaces branch June 4, 2026 18:40
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 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