Skip to content

Fix code-mode deferred app tool routing#22273

Closed
dylan-hurd-oai wants to merge 2 commits into
mainfrom
codex/fix-code-mode-deferred-app-tool-flake
Closed

Fix code-mode deferred app tool routing#22273
dylan-hurd-oai wants to merge 2 commits into
mainfrom
codex/fix-code-mode-deferred-app-tool-flake

Conversation

@dylan-hurd-oai
Copy link
Copy Markdown
Collaborator

Summary

  • route code-mode nested tool calls through the nested-tool router instead of the outer model-facing router
  • fixes code-mode-only turns where ALL_TOOLS advertises deferred app/MCP tools but invocation rejects them as not enabled

Test plan

  • cargo test -p codex-core --test all suite::code_mode::code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools -- --exact (3 consecutive passes)
  • cargo test -p codex-core (hit unrelated stack overflow in tools::handlers::multi_agents::tests::tool_handlers_cascade_close_and_resume_and_keep_explicitly_closed_subtrees_closed)
  • just fmt
  • just fix -p codex-core

@dylan-hurd-oai dylan-hurd-oai added the codex Label used by connector to tag PRs that have been reviewed by Codex label May 12, 2026
@starr-openai starr-openai marked this pull request as ready for review May 19, 2026 07:53
@starr-openai starr-openai requested a review from a team as a code owner May 19, 2026 07:53
Copy link
Copy Markdown
Contributor

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

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: cea2da0925

ℹ️ 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".

session: Arc::clone(session),
turn: Arc::clone(turn),
};
let router = Arc::new(build_nested_router(&exec).await);
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.

P1 Badge Preserve app tool filtering for nested calls

When CodeMode runs with Apps enabled and an app or app tool is disabled by config, this new router rebuild bypasses the per-turn MCP exposure filtering in built_tools that calls codex_app_tool_is_enabled. build_nested_router registers the raw list_all_tools() output instead, so model-authored JavaScript can now dispatch disabled Codex app MCP tools through tools[...]/ALL_TOOLS rather than having the already-built filtered router reject them; the nested router should be built from the same filtered/deferred exposure set while still allowing eligible deferred tools.

Useful? React with 👍 / 👎.

@starr-openai starr-openai force-pushed the codex/fix-code-mode-deferred-app-tool-flake branch from 006b4b3 to 364f514 Compare May 19, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Label used by connector to tag PRs that have been reviewed by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants