Skip to content

Introduce tool exposure for deferred registration#22489

Merged
jif-oai merged 1 commit into
mainfrom
jif/tool-3
May 13, 2026
Merged

Introduce tool exposure for deferred registration#22489
jif-oai merged 1 commit into
mainfrom
jif/tool-3

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 13, 2026

Why

Deferred tools were tracked with separate side-channel filtering after tool specs had already been assembled. That made the registry responsible for executing tools while the router/spec planner separately decided whether those same tools should be exposed to the model up front.

This PR makes exposure part of the tool handler contract so direct versus deferred availability travels with the executable tool registration.

Next step will be to simplify registration

What Changed

  • Adds ToolExposure to codex-tools and exposes it through ToolExecutor, defaulting tools to Direct.
  • Teaches dynamic tools and MCP handlers to mark deferred tools as Deferred at construction time.
  • Renames the registry object-safe wrapper from AnyToolHandler to RegisteredTool and uses ToolExposure when deciding whether to include a handler's spec in the initial model-visible tool list.
  • Refactors tool spec planning to derive direct specs and deferred search entries from registered handlers, removing the router's special-case deferred dynamic tool filtering.

Verification

  • Not run.

@jif-oai jif-oai requested a review from a team as a code owner May 13, 2026 13:32
@jif-oai jif-oai changed the title feat: introduce tool exposure Introduce tool exposure for deferred registration May 13, 2026
Comment thread codex-rs/tools/src/tool_executor.rs
@jif-oai jif-oai merged commit fdda59c into main May 13, 2026
29 of 31 checks passed
@jif-oai jif-oai deleted the jif/tool-3 branch May 13, 2026 16:16
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 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