Skip to content

Simplify tool executor and registry plumbing#22636

Merged
jif-oai merged 3 commits into
mainfrom
jif/simplify-tools
May 15, 2026
Merged

Simplify tool executor and registry plumbing#22636
jif-oai merged 3 commits into
mainfrom
jif/simplify-tools

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

The tool runtime path still had a typed output associated type on ToolExecutor, plus a core-only RegisteredTool adapter and extension-only executor aliases. That made every new shared tool runtime carry extra adapter plumbing before it could participate in core dispatch, extension tools, hook payloads, telemetry, and model-visible spec generation.

This PR moves output erasure to the shared executor boundary so core and extension tools can use the same execution contract directly.

What Changed

  • Changed codex_tools::ToolExecutor to return Box<dyn ToolOutput> instead of an associated Output type.
  • Removed the extension-specific ExtensionToolExecutor / ExtensionToolOutput aliases and exposed ToolExecutor<ToolCall> plus ToolOutput through codex-extension-api.
  • Reworked core tool registration around CoreToolRuntime and ToolRegistry::from_tools, removing the extra RegisteredTool / ToolRegistryBuilder layer.
  • Consolidated model-visible spec planning and registry construction in core/src/tools/spec_plan.rs, including deferred tool search and code-mode-only filtering.
  • Added ToolOutput helpers for post-tool-use hook ids and inputs so MCP, unified exec, extension, and other boxed outputs preserve the same hook payload behavior.
  • Updated core handlers, memories tools, and the related registry/spec/router tests to use the simplified contract.

Test Coverage

  • Updated coverage for tool spec planning, registry lookup, deferred tool search registration, extension tool routing, post-tool-use hook payloads, dispatch tracing, guardian output extraction, and memories extension tool execution.

@jif-oai jif-oai requested a review from a team as a code owner May 14, 2026 11:09
@jif-oai jif-oai changed the title chore: clean up things Simplify tool executor and registry plumbing May 14, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 14, 2026

@codex review

1 similar comment
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 15, 2026

@codex review

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: 3a98816bbf

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

Comment thread codex-rs/tools/src/tool_executor.rs
Comment thread codex-rs/core/src/tools/handlers/extension_tools.rs
@jif-oai jif-oai merged commit 6f1a01f into main May 15, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/simplify-tools branch May 15, 2026 09:47
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 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.

1 participant