feat: extract shared tool executor interface#22359
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…trait # Conflicts: # codex-rs/core/src/tools/handlers/apply_patch.rs # codex-rs/core/src/tools/handlers/extension_tools.rs # codex-rs/core/src/tools/handlers/multi_agents/close_agent.rs # codex-rs/core/src/tools/handlers/multi_agents/resume_agent.rs # codex-rs/core/src/tools/handlers/multi_agents/spawn.rs # codex-rs/core/src/tools/handlers/multi_agents_v2/close_agent.rs # codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs # codex-rs/core/src/tools/handlers/shell/container_exec.rs # codex-rs/core/src/tools/handlers/shell/local_shell.rs # codex-rs/core/src/tools/handlers/shell/shell_command.rs # codex-rs/core/src/tools/handlers/shell/shell_handler.rs # codex-rs/core/src/tools/handlers/unavailable_tool.rs # codex-rs/core/src/tools/handlers/unified_exec/exec_command.rs # codex-rs/core/src/tools/handlers/unified_exec/write_stdin.rs # codex-rs/core/src/tools/registry.rs # codex-rs/tools/src/lib.rs
6199dbc to
436b20e
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Why
Codex still models model-visible tools and executable behavior largely inside
codex-core, which makes it harder to evolve the tool system toward a single reusable abstraction for built-ins, MCP-backed tools, dynamic tools, and later tools injected from outside core.This PR takes the next incremental step in that direction by moving the common execution-facing pieces out of core and separating them from core-only orchestration. The intent is to let shared tool abstractions improve in one place, while
codex-corekeeps the parts that are still inherently host-specific today, such asToolInvocation, dispatch wiring, and hook integration.This PR is mostly moving things around. The only interesting piece is this abstraction: https://github.com/openai/codex/pull/22359/changes#diff-81af519002548ba51ed102bdaaf77e081d40a1e73a6e5f9b104bbbc96a6f1b3dR13
What changed
codex_tools::ToolExecutor<Invocation>as the shared execution trait for model-visible tools.codex-coreintocodex-tools:FunctionCallErrorToolPayloadToolOutputToolExecutor<ToolInvocation>, whileToolHandlerremains the core-local extension point for hook payloads, telemetry tags, diff consumers, and other orchestration concerns.Verification
cargo test -p codex-toolsjust fix -p codex-toolsjust fix -p codex-corecargo test -p codex-coreprogressed through the updated tool surfaces and then hit the existing unrelated multi-agent stack overflow intools::handlers::multi_agents::tests::tool_handlers_cascade_close_and_resume_and_keep_explicitly_closed_subtrees_closed.