Skip to content

[code mode] defer mcp tools from exec description#17287

Merged
sayan-oai merged 3 commits intomainfrom
dev/sayan/code-mode-deferred-tool-guidance
Apr 16, 2026
Merged

[code mode] defer mcp tools from exec description#17287
sayan-oai merged 3 commits intomainfrom
dev/sayan/code-mode-deferred-tool-guidance

Conversation

@sayan-oai
Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai commented Apr 10, 2026

Summary

  • hide deferred MCP/app nested tool descriptions from the exec prompt in code mode
  • add short guidance that omitted nested tools are still available through ALL_TOOLS
  • cover the code_mode_only path with an integration test that discovers and calls a deferred app tool

Motivation

code_mode_only exposes only top-level exec/wait, but the exec description could still include a large nested-tool reference. This keeps deferred nested tools callable while avoiding that prompt bloat.

Tests

  • just fmt
  • just fix -p codex-code-mode
  • just fix -p codex-tools
  • cargo test -p codex-code-mode exec_description_mentions_deferred_nested_tools_when_available
  • cargo test -p codex-tools create_code_mode_tool_matches_expected_spec
  • cargo test -p codex-core code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools

Comment thread codex-rs/code-mode/src/description.rs Outdated
Comment thread codex-rs/core/tests/suite/code_mode.rs Outdated
Comment thread codex-rs/core/src/tools/code_mode/mod.rs Outdated
@sayan-oai sayan-oai force-pushed the dev/sayan/code-mode-deferred-tool-guidance branch from 6dac0a1 to 388d9d5 Compare April 13, 2026 13:24
@sayan-oai sayan-oai changed the base branch from main to dev/sayan/namespace-refactor-2 April 13, 2026 13:53
@sayan-oai sayan-oai force-pushed the dev/sayan/namespace-refactor-2 branch 4 times, most recently from 558bd7f to c3aa960 Compare April 15, 2026 11:00
Base automatically changed from dev/sayan/namespace-refactor-2 to main April 15, 2026 13:03
@sayan-oai sayan-oai force-pushed the dev/sayan/code-mode-deferred-tool-guidance branch from 388d9d5 to 818a569 Compare April 15, 2026 13:44
@sayan-oai sayan-oai marked this pull request as ready for review April 15, 2026 14:00
Comment thread codex-rs/code-mode/src/description.rs Outdated
@sayan-oai sayan-oai merged commit 9c6d038 into main Apr 16, 2026
33 of 36 checks passed
@sayan-oai sayan-oai deleted the dev/sayan/code-mode-deferred-tool-guidance branch April 16, 2026 16:01
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 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