Skip to content

Make tool executor specs mandatory#23870

Merged
jif-oai merged 1 commit into
mainfrom
jif/tool-spec-mandatory
May 21, 2026
Merged

Make tool executor specs mandatory#23870
jif-oai merged 1 commit into
mainfrom
jif/tool-spec-mandatory

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

ToolExecutor is the runtime contract that keeps a callable tool and its model-visible spec together. Leaving spec() optional lets a registered runtime silently omit that half of the contract, and it also overloads a missing spec as an exposure decision for tools that should stay dispatchable without being shown to the model.

What

  • Make ToolExecutor::spec() required and update core, extension, and test tool executors to return a concrete ToolSpec.
  • Add ToolExposure::Hidden for dispatch-only tools. The legacy shell_command runtime in unified-exec sessions now uses that explicit exposure instead of hiding itself by omitting a spec.
  • Build MCP tool specs when McpHandler is constructed so invalid MCP specs are skipped before the handler is registered.
  • Keep tool planning aligned with the new contract for direct, deferred, hidden, code-mode, dynamic, and namespaced tool paths.

Testing

  • Added tool-plan coverage that invalid MCP tool specs are not registered.
  • Updated shell-family coverage for the hidden legacy shell_command runtime and the affected tool executor test fixtures.

@jif-oai jif-oai requested a review from a team as a code owner May 21, 2026 13:03
@jif-oai jif-oai changed the title feat: spec as non-optional Make tool executor specs mandatory May 21, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 21, 2026

@codex review

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 21, 2026

Windows failures are due to GH workers flake

@jif-oai jif-oai merged commit 516f134 into main May 21, 2026
42 of 44 checks passed
@jif-oai jif-oai deleted the jif/tool-spec-mandatory branch May 21, 2026 13:26
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 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