feat(tools): add named and dynamic execution targets - #80275
ribaricplusplus wants to merge 1 commit into
Conversation
Interlock with #82243#82243 makes the helpers advertised inside That creates a direct architecture edge: bridge schema/authorization can no longer be derived from one process-global |
b82ad1f to
f4fc3be
Compare
|
(Human written comment) I've been using this PR for a week with my Hermes without issues. I've mostly been using it with Hetzner servers. My Hermes can provision additional Hetzner servers for development, and it used this feature so that it's more convenient for the LLM to work on the server. |
What does this PR do?
Adds named and runtime-registerable execution targets so one Hermes session can route work across local, SSH, Docker, and other configured terminal backends without changing its global backend between calls.
The selected target and immutable runtime generation propagate through terminal commands, file operations, background processes, approvals, delegation, and nested
execute_codeRPC calls. Runtime targets can be registered, replaced, drained, and removed throughhermes targetswithout restarting an already-activated gateway.This is the deliberate, cleaned-up replacement for #67076. It contains one feature commit on pinned upstream base
cf64ca20c5ab99ebf7e8ca272c69edc7ea0636edand no unrelated fork commits. The mature feature delta was ported from crosslink-ch#2 and reconciled against the current upstream behavior on that pinned base.Related to #1855.
Supersedes #67076.
Type of Change
Changes Made
terminal.default_targetand a fixed-schematerminal.targetsmap while preserving legacy single-backend configuration.execution_targetacrossterminal, file tools,execute_code, and related wrappers. The unpublishedtargetrouting alias is not accepted.execution_targetto the value evaluated by hooks, guardrails, and approvals. Execution middleware may still rewrite ordinary arguments, but cannot replace, inject, remove, or mutate the routing selector after authorization.search_files.targetexclusively as thecontent/filessearch-mode selector;search_files.execution_targetselects the backend.hermes targets register,list,show,drain, andremove.Configuration example
Runtime registration example:
How to Test
Focused regression gate:
Manual route check:
execute_codeand confirm they inherit the selected target.Author Verification
Verification was performed on exact head
f4fc3be5d1049659c86a760026a48a1243461832against pinned basecf64ca20c5ab99ebf7e8ca272c69edc7ea0636edon a task-owned Hetzner devbox:1,155 passed, 0 failed, 11 Windows-only skips across 35 files.34,494 passed, 3 failed, 308 skipped; all 3 failures reproduce identically on the pinned upstream base in untouched files, so 0 candidate-only regressions.passed (whole-repository Ruff lint; 66 changed Python files parsed/compiled; lock, diff, conflict-marker, and public-selector audits).passed (npm ci && npm run buildwith CI-required npm 12 from the frozen archive).passed (same-process CLI registration became visible without restart; schemas remained byte-stable; removed alias rejected).passed (29 middleware/dispatch tests; post-authorization alpha-to-beta retargeting rejected before registry dispatch).passed (real loopback SSH terminal and file round-trip, nested execute_code inheritance, drain/removal, and producing-runtime cleanup).PASS; no blocking findings; frozen provenance, 71-path reconciliation, upstream-overlap seams, selector contract, authorization binding, runtime lifecycle, nested RPC confinement, and background-process metadata independently reverified; no files modified.The three full-suite failures are two
tests/test_mcp_serve.pyEventBridge timing/mtime assertions and onetests/test_hermes_state.pyFTS query-trace assertion. Both files are unchanged by this PR, and all three failures reproduce identically on pristine pinned basecf64ca20c5ab99ebf7e8ca272c69edc7ea0636edunder the same locked CI environment.Interlock with #82243
#82243 proposes making all internal tools available to
execute_coderather than only the current bridge subset. This PR remains compatible with the current subset-based bridge. If #82243 lands first, resolve the overlap by preserving its full availability model while retaining this PR's immutableexecution_targetand runtime-generation binding for nested RPC dispatch.