Review finding on this PR: the tool layer ran every video backend's sources
through the FAL helper, which also downscales to the managed FAL gateway's
3.5 MB budget. xAI, OpenRouter and DeepInfra have no such cap, so a large
data: URL the caller already supplied (or a big local file) was silently
re-encoded smaller (2048x2048 PNG -> 1536x1536 JPEG) for them.
Split the guarded path-to-data: conversion from the budget fit. The tool
layer always does the former; it applies the latter only when the active
provider declares `max_inline_image_chars` in capabilities(). FAL declares
the managed gateway's budget; the others send images at full size.
On the local terminal backend, video_generate handed the model's file path
straight to the provider. FAL and the OpenAI-compatible backends (DeepInfra)
put it in the JSON payload as-is and the remote API cannot fetch it;
OpenRouter refused it outright. Only xAI inlined local files itself.
Inline path-shaped sources as data: URLs at the tool layer through the same
guarded resolver image_generate uses for FAL (credential-store guard, image
sniff, downscale to the managed gateway's body budget). URLs and data: pass
through unchanged. The schema now says local paths are accepted.
Salvages the intent of #30194 (inline local paths as data: URLs).
Co-authored-by: Edgardo Lozada <elozadaf@users.noreply.github.com>
The Bot Chat runner is started as a file path, tools/bot_mode_dm.py, for
its three lanes: --run-delivery, --fan-out and --wait-reply. The interpreter
then puts tools/ first on sys.path, and the entry only added the checkout
root in front of it. A folder under tools/ named like an installed package
would be imported in that package's place: with a tools/mcp/ folder present,
import mcp in the child gave tools/mcp/ and not the MCP SDK.
The entry now replaces that path entry with the checkout root. No such
folder exists today, so nothing changes for a user.
The Feishu comment bot's five tools (feishu_doc_read and the four
feishu_drive_* tools) answered "Feishu client not available" on every call.
feishu_comment stored the Lark client in a threading.local on the thread
that starts the agent, and since ededa8c4f1 the agent runs each tool call
on a worker thread. The worker gets a copy of the caller's context
variables, not its thread-locals.
The client handle is now a context variable in tools/feishu_lark.py, set
and reset by token around the agent run. The handle's row in
gateway/turn_thread_reset.py goes, because nothing is keyed by thread any
more. The bot's reply was never affected: it is posted outside the tools.
tools/microsoft_graph_auth.py and tools/microsoft_graph_client.py register
no tool and only Teams code imports them, four of six imports from
plugins/teams_pipeline/. They move there as graph_auth.py and
graph_client.py, with their two tests under tests/plugins/teams_pipeline/.
- Importers change one import line where it stands; summary_writer.py
keeps its imports inside _build_graph_client.
- The Graph client's only core import, parse_retry_after_seconds, is on
the published plugin API.
- boundary_lint baseline drops the 8 rows for these imports; an import of
another in-tree plugin is not a crossing (module_to_core 833 -> 825).
- The Graph app registration guide and its zh-Hans copy name the new path.
- Nothing stays at the old paths; neither module is on a frozen list.
Measured: with teams_pipeline disabled, Graph delivery from the Teams
summary writer still works, but its first call now imports the
teams_pipeline package (17 Hermes modules instead of 2), because
plugins/teams_pipeline/__init__.py imports its CLI.
tools/ holds model tools. These six files register none: they snapshot and
restore a working directory for the agent loop, /rollback, /undo's
changed-files line and `hermes checkpoints`. They move next to the agent
loop that takes the checkpoints:
tools/checkpoint_manager.py -> agent/checkpoints/manager.py
tools/checkpoint_maintenance.py -> agent/checkpoints/maintenance.py
tools/checkpoint_pruning.py -> agent/checkpoints/pruning.py
tools/checkpoint_refs.py -> agent/checkpoints/refs.py
tools/checkpoint_undo_hint.py -> agent/checkpoints/undo_hint.py
tools/checkpoint_manager_profile_rename.py -> agent/checkpoints/manager_profile_rename.py
agent/checkpoints/__init__.py is a docstring only. Nine test files move to
tests/agent/checkpoints/. Every importer changes its import line in place,
inside the same function. Nothing stays at the old paths: none of the six
names is on the plugin API list, the shipped-release list or the
old-updater list.
Behaviour is unchanged. The four loggers keep their tools.checkpoint_*
names, so the lines stay under `hermes logs --component tools`. The folder
is not a root checkpoints/ package because the checkpoint store is
HERMES_HOME/checkpoints, which is the same directory as such a package on an
install whose checkout root is HERMES_HOME. agent.* is already packaged, so
pyproject.toml and the lists of root packages do not change.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py.
tools/ holds model tools. These two files register none: they are the
security scan that `hermes plugins install`, `update` and `validate` run
on a plugin tree, and every caller is a hermes_cli plugin command. They
move to hermes_cli:
tools/plugin_guard.py -> hermes_cli/plugins_install_scan.py
tools/plugin_guard_context.py -> hermes_cli/plugins_install_scan_context.py
Their three test files move with them to tests/hermes_cli/. Every importer
changes its import line in place, so no module is imported earlier or
later than before.
tools.plugin_guard keeps working. tests/compat/old_updater_surface.json
lists three of its names, because a `hermes update` from v0.21.6 to
v0.23.1 keeps running old code after the checkout swap and imports
tools.plugin_guard from the new tree (hermes_cli/plugins_cmd.py:209 at
v0.23.1). This is the first use of the compat table: one MOVES key, one
REQUIRED_NAMES row, and tools/plugin_guard.py written by
scripts/move/generate_shims.py. That file makes the old name the same
module object as the new one, so an old updater still runs the real scan.
tools.plugin_guard_context is on no frozen list and gets nothing.
Behaviour is unchanged. Neither file has a logger.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py; comments that named the old module stems were fixed
by hand; the two gateway contract files are regenerated from the
docstring that names the module.
The delegate_tool_* siblings imported names back from tools.delegate_tool
inside functions only so tests could patch `tools.delegate_tool.<name>`
(routes said so: "the facade is the patch seam"). That kept a facade <->
sibling import cycle and a function-level import at each read.
- child_run owns the heartbeat/stale-grace constants (only it reads them)
and imports _get_child_timeout, _get_subagent_approval_callback,
_get_worktree_isolation, _resolve_workspace_hint and terminal_tool's
set_approval_callback at module top.
- config drops `_cfg()` (a loop back to its own `_load_config`) and the
loop back for `_get_max_concurrent_children`, defined in the same file.
- routes, dispatch and continue import their config getters at module top.
- `_load_config` is read through `delegate_tool_config._load_config` by the
facade, continue, results and process_registry_notifications, so one
patch target reaches every reader, as the facade target did before.
- cronjob_tools, process_registry_notifications and subagent_lifecycle read
these names from their owner; the facade stops importing the names its
body never used, so a stale facade patch now fails instead of silently
doing nothing.
Tests move their patches to the module whose code reads the name. Two
worktree tests that patched `_resolve_workspace_hint` on the facade relied
on it reaching both the facade's prompt build and child_run's worktree
setup, so they now patch both readers. Every delegate_tool* module imports
cleanly as the first import in a fresh interpreter.
`_FAILED_TASK_STATES` listed "failure", `_batch_status` and the worker
completion validator accepted "success", and the worker claim tested the
ledger state 'finalizing'. Every child-entry and unit-status writer was
read (child_run, dispatch, resumable, routes, auto_resume, async_delegation,
cronjob_tools): none writes "failure" or "success", and 'finalizing' is
only ever an in-memory record status, never a ledger row. `git log -S` finds no past writer of either word as a
child status, so no persisted row on a user's disk carries one.
`_FAILED_TASK_STATES` is now derived from SUBAGENT_FAILURE_STATUSES plus
the three states only the failed panel shows.
ToolRegistry._toolset_checks, its four upkeep sites and _snapshot_state are
gone. The snapshot already overlaid every live entry's check_fn on that map, so
the map could only contribute an entry for a toolset that no longer has a
check_fn member. Such a toolset holds a tool without check_fn and is therefore
always available, and its only reader (banner.py, presence of check_fn on an
unavailable toolset) never sees it. get_toolset_requirements now derives
check_fn from the live entries (last one wins, as before); the
model_tools.TOOLSET_REQUIREMENTS dict at import is byte-identical before and
after (probe).
model_tools.TOOL_TO_TOOLSET_MAP had one reader, batch_runner, which used only
its keys; it now uses get_all_tool_names() and gets the same 73-name set. The
doctor printed TOOLSET_REQUIREMENTS[tid]["name"], which is always tid; it
prints tid. Doc references and the doctor's model_tools stubs follow.
TapsManager.load and TapsManager.list_taps were one method under two names (list_taps = load). Product code calls only list_taps (hermes_cli/skills_hub.py, tools/skills_hub_search.py); .load() on a TapsManager appeared only in tests. The method is now defined as list_taps and the alias is gone; the tests call list_taps.
tools/skill_manager_tool.py carried its own HERMES_HOME, SKILLS_DIR,
_SKILLS_DIR_AT_IMPORT and _skills_dir(), a second copy of the ones in
tools/skills_tool.py with the same body. No product code reads the
manager's attributes, and the dashboard swap that wrote them is gone, so
the manager now imports _skills_dir from tools.skills_tool (no cycle:
skills_tool does not import the manager). Tests now patch one attribute,
tools.skills_tool.SKILLS_DIR, to point both modules at a temp skills dir.
- Both unknown-backend errors build their list from _ENV_BUILDERS, the table that already decides which built-in backends exist, so the text cannot drift from it. The text is unchanged today.
- file_tools_paths asks terminal_tool_config whether a backend uses container paths. The copy of the container-backend set it kept for a failed import could not be reached.
- ProcessRegistry._log_delta_command (staticmethod alias of log_delta_command): its only
production use was the one internal call, which now calls log_delta_command.
- _load_hermes_env_vars in environments/ssh.py and docker.py: module rebinding kept only
for tests to patch; tests now patch load_hermes_env_vars on the same module.
- env_probe.get_environment_probe_line(force_refresh=...): documented as test-only; no
caller passes it (gateway/run.py, agent/system_prompt.py) and tests already reset via
_reset_cache_for_tests().
- managed_modal: touch_activity_if_due is imported at module top. The lazy import and the
try/except existed only for a test stub of tools.environments.base; touch_activity_if_due
already swallows callback errors itself. The stub now provides the name.
None of these names is in plugin_api.json or the frozen updater surface.
Delete CHECKPOINT_PATH and _CHECKPOINT_PATH_AT_IMPORT from tools/process_registry.py.
_checkpoint_path() returned the constant only when a test had patched it; production
never patches it, so every real call already took get_hermes_home() / "processes.json".
The constant was also an import-time read of HERMES_HOME. No other production reader,
not in plugin_api.json or the frozen updater surface.
Tests and evals/completion_backlog_probe.py now patch _checkpoint_path itself.
tools/connectors/live.reset_for_tests cleared the open-operation map
under its lock. Nothing outside tests called it (rg live.reset_for_tests
outside tests/: 0 hits). The twelve test fixtures that used it now clear
the module's real _open dict, which is the same reset.
_run_on_mcp_loop wrapped every scheduled coroutine in
_wrap_with_home_override and _wrap_with_dashboard_oauth_flow, which
re-set the caller's HERMES_HOME override and dashboard OAuth flow
inside the task. The comment justifying them said
run_coroutine_threadsafe copies the loop thread's context. It copies
the calling thread's: it schedules through call_soon_threadsafe, whose
Handle captures copy_context() on the caller, and the Task is created
inside that copy. Both values are ContextVars (hermes_scope._STATE and
mcp_dashboard_oauth._current_dashboard_flow), so they already arrive.
A probe that calls _run_on_mcp_loop with no wrappers, from three
threads each holding its own override and flow, in coroutine and
factory form, and reads both from a child task, saw every caller's
values on Python 3.11.11 and 3.14.7. All six call sites schedule
through _run_on_mcp_loop.
The test that only checked the wrapper's no-op path goes; a new test
asserts the dashboard flow reaches the loop. Running the file with
scheduling forced into an empty Context fails all three propagation
tests.
MCPServerTask listed 42 attribute names in __slots__, and two of its
mixins declared empty slots, but MCPServerRunMixin declares none, so
every instance already had a __dict__. The tuple saved no memory and
enforced nothing: _http_rejection and _editor_frozen_manifest were
already stored outside it. It was a third list of the fields to keep
in step with __init__.
A probe on the base showed every slotted name is set by __init__ and no
base class defines a class attribute of the same name, so moving the
values into __dict__ changes no lookup. The reconnect test's
try/except AttributeError guard existed only because of the slots.
_ship_file_to_remote was _remote_write(..., check=True) under another
name; its five call sites (code_execution_tool, code_kernel_remote) call
_remote_write with check=True directly. code_kernel_remote now imports
_remote_write, _execute_checked and _private_dirs_cmd from
code_execution_rpc at module top, which drops two function-level imports
back into the tool file.
_kill_process_group lived in code_execution_tool but its one caller is
SessionKernel.teardown in code_kernel, which always passed escalate=True.
It moves to code_kernel without the parameter (always SIGTERM, wait 5s,
SIGKILL), with signal and agent.deadline imported at module top. The
escalate=False branch was reached only by tests.
Tests patch _remote_write in both modules where they patched the wrapper.
test_code_kernel_owned_group stubs the teardown kill to a SIGTERM-only
tree kill for its precondition instead of passing escalate=False.
tools.checkpoint_manager read get_hermes_home() at import into
CHECKPOINT_BASE and kept _CHECKPOINT_BASE_AT_IMPORT so that
_resolve_checkpoint_base() could tell whether a test had patched it. The
constant existed only for tests; product code wants the live profile home.
_resolve_checkpoint_base() now returns get_hermes_home() / "checkpoints".
The one other reader, `hermes checkpoints clear`, checked the import-time
constant for "nothing to clear" while store_status() used the live base, so
under an in-process profile scope it could act on the launch profile's
directory. It now calls _resolve_checkpoint_base(). In a separate CLI
process the import-time and live homes are the same, so its output is
unchanged there.
Tests drop the 37 CHECKPOINT_BASE patches and use the per-test HERMES_HOME
that tests/conftest.py already isolates.
tests/hermes_cli/test_checkpoints_clear_profile.py covers `hermes checkpoints clear` for a profile
with no checkpoints in a process that loaded the module under another profile: exit 0 and
"Nothing to clear". It fails without this change (exit 2).
_get_hermes_config_resolved and _get_real_hermes_home kept four module
globals (_hermes_config_resolved[_loaded], _real_hermes_home_cached/_loaded)
that only tests set, two one-line resolver wrappers, and an exception
fallback that recomputed the same value. get_config_path() is
get_hermes_home() / "config.yaml", and the home fallback called the
identical os.path.realpath(str(get_hermes_home())) again, so it could only
fail the same way. Each getter is now one per-call resolve that returns
None on failure, as before. The function-level hermes_cli.config import
(an upward import from tools/) and three hermes_constants imports go.
Tests pin the config path by monkeypatching _get_hermes_config_resolved or
by pointing HERMES_HOME at tmp_path, which exercises the real resolution.
Four things in tool.py existed only for tests:
- the module-level _backend injection hook (its own comment: "backward-
compatible empty-session injection hook (older tests)") and its mirror
branches in _install_backend, _detach_locked, _get_backend and
_shutdown_backend_atexit. Production installs backends only through
_new_backend into the _backends cache, so with nothing assigning _backend
every branch was a no-op. The two tests that assigned it now patch
_new_backend, the seam the rest of the suite already uses; the atexit
tests seed _backends instead.
- reset_backend_for_tests, now tests/computer_use_fakes.reset_backend (the
same two calls: _shutdown_backend_atexit, _reset_screenshot_dedup).
- _noop_stub and _NoopBackend (pragma: no cover, docstring "Test stub"),
moved verbatim to tests/computer_use_fakes.py as noop_stub / NoopBackend.
- the _bounds_scale and _bounds_space_note lambdas, which only indexed
_bounds_hints; the tests index _bounds_hints directly.
None of these names is in hermes_cli/data/plugin_api.json (it publishes
tools.computer_use.backend only) or tests/compat/old_updater_surface.json.
runtime.BINARY_PACKAGES existed only so the test suite could check that each
binary the launcher execs comes from a package in PACKAGES; no product code
read it. The map now lives in tests/tools/test_bot_desktop_runtime.py, the
one test that reads it, and runtime.py keeps the Fedora WHY next to
PACKAGES.
lease._reset_for_tests had no product caller. tests/bot_desktop_lease.py
reset_lease() does the same thing against the real module (clear
lease._listeners under lease._lock, unlink lease.json/.lock/.json.tmp at
lease._path(None)), and the eight test files that used the seam call it.
browser_use_cli._FHS_BIN_DIRS + _floor_subprocess_path restated
browser_lightpanda._SANE_PATH_DIRS + merge_sane_path: the same eight dirs in
the same order, the same rule (drop empty entries, keep the existing order,
append each dir that exists and is not already present). A probe over four
input PATHs (empty, /usr/bin:/bin, an nvm-only PATH, one with an empty entry
and an already-present floor dir) gave identical output from both.
The one difference was the Windows guard in the copy, so merge_sane_path now
returns its input unchanged on nt. Lightpanda's only caller already returns
before it on nt, so nothing there changes. The PATH-order test now goes
through _base_subprocess_env, the behaviour the floor exists for.
install._running held exactly the keys of install._slot_files: claim()
added to both under _install_lock and release() dropped from both under
the same lock, so "key in _running" and "key in _slot_files" always gave
the same answer. claim() now checks _slot_files; the set is gone. The test
teardown releases held slots instead of clearing the set.
browser._is_root was a line-for-line copy of runtime.is_root
(hasattr(os, "geteuid") and os.geteuid() == 0), and browser.py already
imports runtime. One caller (executable()); no test patched the copy.
No product code calls it: every desktop tool reads emit()'s False return
(or emit_or_error) to report "desktop only". The only caller was
tests/tools/test_desktop_ui.py, whose two cases already assert the same
fact through emit(). Not in hermes_cli/data/plugin_api.json.
Both tools inlined the four-line body of tools.desktop_ui.passthrough_json
verbatim (json.loads the renderer answer and re-dump it, else wrap the raw
text as {"text": ...}). drive_preview and read_terminal already call the
shared helper. The bodies were identical, so the output is unchanged.
The invariant "a card tap may only deny until a renderer proves its card
shows the whole command" (#62359) lived at the call site: __init__ set
card_deny_only = False and _await_gateway_decision overwrote it with True
before publishing. The class default was the unsafe value, so any second
constructor would be born approvable. __init__ now sets True and the
overwrite goes. _await_gateway_decision is the only product constructor
(git grep "_ApprovalEntry(" outside tests), and nothing between the
constructor and the old overwrite reads the field, so every published
entry carries the same value as before.
Deny paths touched, and the tests that still cover them:
- card approve tap refused while Deny-only: tests/gateway/test_exec_approval_deny_only_renderers.py,
tests/gateway/test_approval_card_publication_window.py,
tests/gateway/test_exec_approval_cutting_text_prompt.py (long command offers only Deny)
- card tap authority: tests/gateway/test_approval_requester_binding*.py,
tests/gateway/relay/test_relay_discord_press_authority.py,
tests/gateway/relay/test_relay_approval_owner_admins.py
Test helpers that hand-build an entry for a card that was shown whole now
lift the mark with restrict_gateway_approval_card_to_deny(restricted=False),
the call a renderer makes in production; before, they relied on the False
default. Each test asserts what it asserted before.
_ApprovalEntry.acknowledged (slot and init in approval_gateway_wait.py) was
set by ack_gateway_approval and read by nothing: git grep for the
attribute (.acknowledged, getattr) over all .py finds only the init and the
write. The RPC replies {"acknowledged": ...} in tui_gateway/methods_prompt.py
and gateway/session_ancillary.py are built from ack_gateway_approval's
return value, and agent/managed_worker.py ignores it. ack_gateway_approval
keeps its signature and still returns whether the request is pending.
Deny paths touched: none. The field fed no allow/deny/withdraw decision.
tests/tui_gateway/test_protocol.py (ack reply), tests/tools/test_approval.py
and tests/agent/test_terminal_approval_batch.py cover the return value.
"Find the queued entry with this request_id" was written six times in the
gateway queue API. _card_target already did it under _lock; it is renamed
_entry_for_request and used by resolve_gateway_approval (request_id branch),
restrict_gateway_approval_card_to_deny, resolve_gateway_approval_card,
withdraw_gateway_approval, register_gateway_settle, observe_gateway_settle
and ack_gateway_approval. Each function keeps its lock and return contract.
Why the copies are the same: request_id is a fresh uuid4 per
_ApprovalEntry (data.setdefault), and none of the five _await_gateway_decision
callers puts a request_id in approval_data, so a queue holds at most one
match; the list-filter in resolve_gateway_approval and the first-match loops
pick the same entry. A falsy id never equals a uuid, and the helper returns
None for it, so empty ids still resolve nothing. A differential probe
(base vs this commit, 711 cases over queues of 0-3 entries, every
deny_only mix, hit/miss/empty/None ids, all nine entry points) found no
difference in return value, queue order or any entry field.
Deny paths touched, and the tests that still cover them:
- card tap blocked while card_deny_only: tests/gateway/test_exec_approval_deny_only_renderers.py,
tests/gateway/test_approval_card_publication_window.py
- card tap for a settled or other request resolves nothing:
tests/gateway/test_qq_approval_card_request_id.py, tests/gateway/test_approval_card_request_binding.py
- card tap authority check: tests/gateway/test_approval_requester_binding_policy.py
- /deny by request_id: tests/tools/test_approval.py
- withdraw wakes the waiter as cancelled, not as a user deny: tests/tui_gateway/test_protocol.py
The QQ test that patches the helper is renamed to the new name.
__all__ listed DOC_PROSE_EXTENSIONS and TEST_TREE_DIRS, which no other
module reads, and omitted catalog_cap and is_locale_catalog, which
plugin_guard imports. Nothing does `from tools.plugin_guard_context import *`
(git grep over the tree, tests, scripts and docs), and plugin_guard imports
every name explicitly, so the list was a wrong statement of the surface
with no reader.
Deny paths touched: none. Every scan helper keeps its name and body;
tests/tools/test_plugin_guard*.py cover the plugin install verdicts.
- approval_floors.save_blocked_payload: the same two-line comment was pasted
three times inside write_text(); it now says once why the save is UTF-8
with replacement.
- approval_smart: two comments said the same thing about the explicit
timeout and the call log; one remains with both issue refs.
- approval_human_wait: a reflowed banner comment repeated the module
docstring; the banner goes and its issue ref (#79719) moves to the docstring.
- approval.check_execute_code_guard: the docstring said the hardline-floor
sentence and See #30882 twice; one paragraph remains.
Deny paths touched: none (comments and a docstring only; no code token changed).
The docstring named tools/memory_tool.py as an importer (the importer is
tools/memory_tool_store.py) and said the strict scope covers skill
installs. Only memory_tool_store passes scope="strict"; skill installs are
scanned by skills_guard and never call scan_for_threats. The docstring no
longer names importer files and says strict is memory-only.
Deny paths touched: none (docstring only).
Removed List and Tuple from tools/threat_patterns.py: each name appeared
only on its import line, and no module imports them from threat_patterns.
Ruff misses this because F401 is off (ruff.toml).
Deny paths touched: none. The pattern table, scope filter and scanner are
unchanged; tests/tools/test_threat_patterns*.py still cover them.
check_wake_word_requirements mapped the provider to its pm extra with an
if-ladder (porcupine, the four sherpa aliases, else openwakeword) that
restated _PROVIDERS, whose comment already says unknown providers probe
as openwakeword. The lookup
_PROVIDERS.get(provider, _PROVIDERS["openwakeword"])[1] gives the same
extra for every alias, an empty name, None and an unknown name (probe
over all 11 cases).
tools/tts_tool.py resolved the profile's audio cache dir at import
(DEFAULT_OUTPUT_DIR = _DEFAULT_OUTPUT_DIR_AT_IMPORT = ...) only so a test
or "external patcher" that replaced DEFAULT_OUTPUT_DIR would win over the
per-call resolution _default_output_dir() already did. No caller outside
tts_tool.py reads either name (the website/scripts hit is an unrelated
local), neither is in plugin_api.json or old_updater_surface.json, and no
test patches DEFAULT_OUTPUT_DIR.
_default_output_dir() now just resolves get_hermes_dir per call (the
function-level import moves to the module top), so importing the module
reads no profile home. The profile-scope test sets HERMES_HOME instead of
reloading the module and still fails if the dir is frozen at import.
agent/transcription_registry.py and agent/tts_registry.py held hand
copies of BUILTIN_STT_PROVIDERS and BUILTIN_TTS_PROVIDERS, guarded by two
TestBuiltinSync drift tests. Their comments said importing the real sets
would be a circular import. It is not: the sets live in
tools.transcription_common and tools.tts_command_provider, which import
only each other, hermes_cli.process_identity and utils, and load no
agent.* module. Both copies equal the real sets today.
The registries now import the real sets; the copies, the stale comments
and both drift tests are gone. An import probe shows no cycle and no
heavy module (openai, numpy, httpx, faster_whisper, tools.registry,
tools.tts_tool all stay unloaded). After hermes_cli.plugins, the import
that registers plugin providers, the new modules cost about 3.5 ms once.
The provider -> pm extra map for edge/elevenlabs/mistral was written in
three tables plus literals: _PM_FEATURE_ALIASES (keyed by made-up
`tts.<provider>` ids whose only use was to be translated back), the
literals inside _BUILTIN_REQUIREMENTS, _SDK_ON_DEMAND (provider ->
credential) and tts_tool_lifecycle._LAZY_SDK_FEATURES. All four held the
same three extras (edge-tts, tts-premium, mistral).
_SDK_ON_DEMAND now maps provider -> (extra, credential) and every reader
takes the extra from it: the lazy SDK importers, _BUILTIN_REQUIREMENTS,
_ready_after_first_use_install and warm_tts_provider (through the
lifecycle module's existing _origin() lookup). A probe confirms each
importer closes over the same extra as before and every consumer sees
the same extra/credential pair.
text_to_speech_tool took a `provider` argument and always ignored it:
_apply_call_overrides returned the configured provider and only logged a
once-per-value warning (_warn_ignored_tts_provider_override,
_once_warnings). The model path never reaches it, because the registered
handler forwards only output_path, speed, instructions, voice_id and
find_voices. Every product caller passes text and output_path only
(tts_tool_speaker, web_routers/audio, cli_voice_mixin, voice,
base_auto_tts, the Discord adapter); an AST scan finds no provider= or
fifth positional argument outside tests. The function is not in
plugin_api.json or old_updater_surface.json.
The signature, the provider half of _apply_call_overrides, the warning
helper and its set are gone. The tests that called the function
directly with provider= tested only the removed argument; the schema
test and the registered-handler "provider arg does not reroute" test
stay.
The /api/audio/stt-lease route kept a process-global set of lease names
(acquire_stt_lease, release_stt_lease, stt_lease_holders,
_reset_stt_leases_for_tests). Release never unloads anything by design, so
the set's only output was the holder count echoed as `leases` in the
response. No client reads it: the desktop typed the field in
AudioSttLeaseResponse and syncSttLease awaits the call as a readiness
barrier, ignoring the body (rg `leases` under apps/, web/, ui-tui/ hits
only that type). The set was also shared by every profile in the process.
The route now calls warm_stt_provider() under the profile scope when
`active` is true and returns the same envelope without `leases`; release
is acknowledged and does nothing. The request model is unchanged, so
older desktops still send a valid body. The TS response type drops the
unread field in the same commit.
- Four tests through _handle_preview(action=close): the whole-pane payload, a bare domain normalised like open, the desktop-only error and an emitter failure. The tests that covered these cases exercised close_preview_tool, which is gone.
- One docstring word in cua_backend_session.
Co-authored-by: BearHuddleston <BearHuddleston@users.noreply.github.com>
tools/ holds model tools. These three files register none: they send a
message to a platform for `hermes send` and for cron delivery, through
gateway adapters and gateway config. They move to the gateway package:
tools/send_message_tool.py -> gateway/outbound/send.py
tools/send_message_senders.py -> gateway/outbound/senders.py
tools/send_message_targets.py -> gateway/outbound/targets.py
Twelve test files move with them to tests/gateway/outbound/. Every importer
changes its import line in place. Nothing stays at the old paths: none of
the three names is on the plugin API list, the shipped-release list or the
old-updater list.
Behaviour is unchanged. The logger name stays tools.send_message_tool in
the three files and in the QQ Bot sender that shares it, so the lines stay
under `hermes logs --component tools`. The boundary-lint baseline changes
12 keys and no count, because its keys carry the module path of the
underscore names five bundled plugins import.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py.
tools/ holds model tools. These three files register none and do cron's
work, so they move to the package that owns it:
tools/cronjob_job_args.py -> cron/job_args.py
tools/cronjob_prompt_scan.py -> cron/prompt_scan.py
tools/blueprints.py -> cron/skill_blueprints.py
Their tests move with them to tests/cron/. Every importer changes its
import line in place, so no module is imported earlier or later than
before. Nothing stays at the old paths: none of the three names is on the
plugin API list, the shipped-release list or the old-updater list.
skill_blueprints, not blueprints: cron/blueprint_catalog.py already holds
Automation Blueprints, a different thing. This file reads the blueprint
block of a skill's frontmatter.
Behaviour is the same except two strings. The report of a run the
injection scanner blocked names cron/prompt_scan.py. The one debug line
in skill_blueprints logs as cron.skill_blueprints, so it shows under
`hermes logs --component cron`. job_args and prompt_scan keep the logger
name tools.cronjob_tools.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py; the two gateway contract files are regenerated from
the docstring that names job_args.py.
Removed. A search for callers by name, attribute and string (Python, TypeScript,
docs, the plugin API list and the frozen old-updater list) finds no supported
path that reaches any of them:
- tools/send_message_tool.py: _handle_list, _handle_react and the action
dispatch in send_message_tool (every caller, including the external
hermes-snooze plugin, passes action="send")
- tools/bot_failure_reasons.py: is_auto_retryable
- tools/clarify_gateway.py: _notify_cbs, _coerce_text_response,
attempt_text_response_for_session, resolve_text_response_for_session
- tools/cronjob_tools.py: the unused task_id parameter of cronjob()
- tools/interrupt.py: is_thread_yield_requested
- toolsets.py: create_custom_toolset
- tools/tool_backend_helpers.py: prefers_gateway, REMOVED_BACKENDS,
removed_backend_note, normalize_modal_mode (callers use coerce_modal_mode)
- hermes_cli/config_value_checks.py: _validate_web_backends (only read the
always-empty REMOVED_BACKENDS map)
Tests that existed only for these symbols are deleted; tests that also
cover live behaviour now call the canonical live names
(attempt_text_response, _coerce_text_response_detailed, consume_yield).
The shared-bot route-gate tests that reached the gate through the deleted
react action now call _shared_bot_target_allowed directly, so the origin
rules (guild-only, thread-under-channel and user_id routes, Telegram topics,
the turn's sender in a shared channel) keep their coverage. The two error
hints and one comment that named send_message(action='list') now name
`hermes send --list`; the stale send_message row in the zh-Hans tools
reference goes.
Also:
- test_messaging_slash_command_fifo spies on clarify_gateway.attempt_text_response,
the name gateway/run_inbound.py calls, so its [clarify] case can fail again
- send_message_tool: an action other than 'send' returns an error that names
`hermes send --list` for listing targets
- multi-profile-gateways.md no longer says send_message sends reactions; the zh-Hans
simplex.md and tools-reference.md match the English pages
Removed. A search for callers by name, attribute and string (Python, TypeScript,
docs, the plugin API list and the frozen old-updater list) finds no supported
path that reaches any of them:
- tools/browser_lightpanda.py::_record_path
- tools/computer_use/tool.py::get_computer_use_schema
- tools/computer_use/schema.py::get_computer_use_schema
- tools/computer_use/cua_backend.py::CuaDriverBackend.launch_app (and its test)
- tools/computer_use/cua_backend_session.py::_CuaDriverSession.capability_version
and the _capability_version bookkeeping
- tools/computer_use/cua_backend_daemon.py::_CUA_DRIVER_BUNDLE_ID (callers use
CUA_DRIVER_BUNDLE_ID)
- tools/computer_use_tool.py::__all__ and the two imports only it re-exported
- tools/bot_desktop/runtime.py::_allocate_display (its test now calls
_pick_display, the live allocator)
- tools/bot_desktop/install.py::assert_not_running (its test checks release
via claim/release)
- tools/close_preview_tool.py (whole module) and tests/tools/test_close_preview_tool.py;
PreviewClosePayload docstring updated and gateway contract regenerated
Removed. A search for callers by name, attribute and string (Python, TypeScript,
docs, the plugin API list and the frozen old-updater list) finds no supported
path that reaches any of them:
- tools/openrouter_client.py (whole module; check_api_key had test callers only)
- tools/connectors/gateway/__init__.py: re-exports and __all__ (every importer names a submodule)
- tools/connectors/gateway/wire.py::WIRE_BATCH_MAX
- tools/managed_gateway_auth.py::managed_gateway_origin
- tools/discord_tool.py::_detect_capabilities
- tools/mcp_tool_health.py::MCPServerHealthMixin.ensure_healthy
- tools/mcp_oauth.py::build_oauth_auth, HermesOAuthClientProvider, _oauth_port
- tools/mcp_dashboard_oauth.py::DashboardOAuthFlow.profile (write-only field)
- tools/mcp_tool_events.py::EVENT_UTILITY_KEYS
- agent/tool_guardrails.py: mcp_filesystem_* entries in IDEMPOTENT_TOOL_NAMES
(MCP tools register as mcp__<server>__<tool>)
Tests that covered live code through a deleted symbol now call the live path
(MCPOAuthManager().get_or_build_provider, _fetch_capabilities,
build_vendor_gateway_url); tests that only exercised deleted code are removed.
Kept on purpose: _SSH_HINT_PROXY, its branch, the redirect_uri parameters and
build_provider_kwargs' ssh_proxy_hint. Nothing reaches them today, but they are the
proxy-user hint from d0afcb125ce; wiring it into MCPOAuthManager is a separate fix.
test_cache_is_keyed_by_token now covers _detect_capabilities_nonblocking (two tokens,
memory and disk). ensure_healthy leaves the SuspectableBackend Protocol, which no
backend implements any more.
- tools/voice_mode.py::listen_for_speech: back as it was, so a plugin that imports it keeps working instead of failing with ImportError.
- tests: TestListenForSpeech and TestListenForSpeechCapture come back, including the two VAD false-trip regression tests, and the fake voice module in the tui_gateway tests carries listen_for_speech again.
- tools/voice_mode.py::listen_for_speech: no caller outside its own tests
since full_duplex_listen took over barge-in; its inline copy of the
_capture_until_quiet loop goes with it.
- tools/transcription_tools.py::_is_local_stt_provider: drop the
stt_config parameter, which the body never read; both callers updated.
- tests: drop TestListenForSpeech and TestListenForSpeechCapture, and the
unused listen_for_speech attribute on the tui_gateway fake voice module.