model_tools.py held two jobs. tools/schemas.py now builds the tool list sent
to the model: importing it loads the built-in and plugin tools (the moment
`import model_tools` did), and get_tool_definitions selects, rewrites per
session, cleans and defers. tools/calls.py runs one model tool call through
argument repair, hooks, middleware and the registry. Argument repair stays in
tools/arg_coercion.py: the inline executors import it at module top, and in
tools/calls.py that import would load every tool. The error cleaner joins tools/results.py.
Definitions move unchanged. Imports of tools.context and the schema cleaner
that were inside the moved functions go to module top as module objects;
both are loaded by then already, and a patch on, say,
tools.context.hosted_tool_refusal still reaches the code. The imports of
tools.deferral stay inside their functions: Tool Search loads the connectors
on the first tool list, and at module top `import model_tools` would load
them too. calls.py reads get_tool_definitions and _last_resolved_tool_names
through the schemas module, so a patch on either still reaches the call path.
tools/schema_sanitizer.py stays a file. Provider adapters and a provider
plugin import it at module top; inside tools/schemas.py, loading a provider
would load every tool.
Old names, until v0.27.0. model_tools.py is a file of re-exports: the names
releases up to v0.23.5 import from it inside functions, and the public names
pinned catalog plugins import (get_tool_definitions, handle_function_call).
Importing it still loads the tools. No product code imports model_tools now; its own
compatibility tests do, as do ten tests and four eval workers that import it
only to load the tools (the evals also run against older checkouts).
The call path's log lines move from the model_tools logger to tools.calls and
tools.schemas: `hermes logs --component` shows them under tools, not agent.
Argument repair logs as "model_tools", as before.