_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.
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/code_execution_tool.py::SANDBOX_AVAILABLE (constant True) and its
two `if not SANDBOX_AVAILABLE` branches; the duplicated gateway-lifecycle
comment in execute_code
- tests: test_windows_returns_error (only flipped the constant) and the
constant's monkeypatch in test_execute_code_lifecycle_guard_deadline
- tools/checkpoint_manager.py: the no-op `store = _store_path(base)` /
`_ = store` pair in _migrate_legacy_store; unused imports
clear_stale_tmp_packs, rmtree_readonly, Dict, List, Set, Tuple;
_list_project_refs (test-only) and its one assertion
- hermes_cli/cli_auto_maintenance.py::_run_checkpoint_auto_maintenance
(imported by cli.py, never called), its cli.py import, its orphaned
`threading` import and its no-op test monkeypatch
- tools/file_operations.py::ShellFileOperations._run_python_snippet
- tools/file_operations_lint.py: the '.py' entry in LINTERS (the in-process
LINTERS_INPROC['.py'] always answers first)
- test_profile_rename_checkpoints: assert the migrate-identity retry deletes the leftover old checkpoint ref (via _ref_tip), replacing the deleted _list_project_refs check.
- docs(checkpoints-and-rollback): auto-prune runs only on the gateway housekeeping tick; the CLI never runs it.
ensure_spill_dir(private=True) chmods an existing leaf to exactly 0700, which
strips group access a shared-group home (HERMES_HOME_MODE=2770) granted.
keep_group=True drops only the world bits; a new dir is still 0700 and spill
files are still 0600.
Refs #122024
Oversized execute_code stdout is spilled to disk so the model can page it
with read_file, but both spill emitters wrote raw output: the host-side
_spill_full_stdout spilled before _clean_output's ANSI strip + secret
redaction, and the session-kernel runner wrote cell stdout into its tmpdir
with a plain open() that follows symlinks. The result warning then directs
the model to read the file, so the on-disk copy kept credentials the inline
result masked.
- _spill_full_stdout now ANSI-strips and redacts (code_file=True) before
writing, and uses ensure_spill_dir + default-private
write_text_exclusive: 0700 dir, 0600 file, symlink-safe create/replace.
The stale bind-mount rationale is corrected: cache/exec is not in
credential_files._CACHE_DIRS and is never mounted into remote backends.
- The generated kernel runner spills via O_CREAT|O_EXCL|O_NOFOLLOW at 0600,
so a cell squatting cell_NNNNNN_stdout.txt with a symlink cannot redirect
the write onto a host file.
- _cell_result re-publishes runner-side spills through _spill_full_stdout
instead of advertising the tmpdir path. _sanitize_cell_spill confines the
read to a resolved direct child of the kernel tmpdir (dir_fd-anchored,
realpath gate, O_NONBLOCK, regular-file and size cap), so a forged reply
frame or swapped-in FIFO/huge file cannot block the host under kernel.lock
or redirect the read/unlink outside the sandbox. The raw tmpdir copy is
removed on every outcome, and the published cache/exec path survives the
kernel teardown that follows sys.exit() cells.
- On republish failure the warning names the host-side partial spill
explicitly rather than leaving a path it contradicts.
- Shared _sanitize_output_text helper replaces four open-coded copies of
the ANSI-strip + redact pipeline.
Tests: real-kernel e2e for both emitters (masked on disk, ANSI-stripped,
0600 in 0700), symlink-squat e2e proving a planted link is not followed,
sys.exit() teardown survival, FIFO/link/../ confinement, oversized swap
rejection, and fail-closed fallback semantics. The kernel e2e places the
secret past the runner's 1MB clip so the published file can only come from
the runner spill, not the host-side fallback.
The remote runner's `error` (last traceback line) skipped redact_code_output
while the same text in `output` was masked. New tests cover the non-secret
env-line gate, quote/inline-assignment shape and the redaction-off switch.
Refs #95509
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
An env-dump line is one assignment, so mask its full value (quoted or raw)
instead of _ENV_ASSIGN_RE's first \S+ word. The remote _clean_output now strips
ANSI and redacts before _truncate_stdout_text, as the local kernel already does,
so the head/tail cut cannot separate DB_PASSWORD= from its value.
Refs #95509
execute_code redacted stdout/stderr with code_file=True, which skips the
ENV-assignment pass, so a script printing .env-style lines
(MY_SERVICE_TOKEN=<opaque>) returned prefix-less credentials raw. The
terminal tool picks the pass from the command line; execute_code has no
command, so classify by output shape instead: whole lines of
[export ]NAME=value get the ENV-assignment pass, everything else keeps
code_file=True (MAX_TOKENS = 100, indented source, f-strings unchanged,
per #43025). Applied to the shared remote pipeline and the local kernel.
Fixes#95509
A cell that only prints or writes text quoting a gateway lifecycle command was
refused with no hint of what matched. Allow a cell whose parsed code provably
cannot start or signal a process (pure-module imports only, no process-like
attributes, every name a builtin or bound in the cell); every other cell is
scanned exactly as before. The refusal now names the matched text.
Fixes#146582
Nested calls from execute_code carried the outer session_id/turn_id but
not conversation_id, so pre/post_tool_call, transform_tool_result and the
tool middleware saw conversation_id="" for them -- the field the hooks docs
tell plugins to key per-conversation state on. Thread it through the same
sites as session_id/turn_id (handler, local CellAuthority, both remote RPC
routes). Adds a test driving both remote routes (persistent kernel and
per-call fallback) through handle_function_call.
Refs #145870
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Tool calls made from inside execute_code reached pre_tool_call hooks with an empty session_id: the RPC dispatchers called handle_function_call with only task_id. In a gateway serving several conversations from one process, a hook could therefore attribute a nested call to whichever conversation bound a turn most recently.
Thread the outer call session_id and turn_id from the execute_code dispatch through the handler, the local session kernel CellAuthority, and both remote RPC paths (per-call poll loop and remote session kernel), so nested calls fire hooks with the same identity as direct calls.
Closes#145870.
Address the review follow-up by testing local and remote RPC authorization directly, keeping sandbox failure hints tri-state-aware, and proving partial grants cannot dispatch unapproved tools.
enabled_tools=[] was conflated with enabled_tools=None via truthiness, so an
explicit empty grant broadened to every SANDBOX_ALLOWED_TOOLS stub instead of
denying all. Preserve tri-state semantics: None keeps the legacy default
(every sandbox tool), an explicit list (possibly empty) uses the exact
intersection, so [] and a non-overlapping list both deny all.
Fixes#84271
- execute_code: an oversized remote stdout spills into the agent's own
sandbox (as the generic result spill does) or is truncated inline; it is
never written to cache/exec.
- skills: one host feature consulted by the shared loader, preload,
auto-load, the skills index prompt, slash-command scans and skill_view /
skills_list for direct callers. No host skill file is read in a hosted scope.
- shell hooks: a host feature, off in a hosted scope at the callback and at
the one subprocess site. A refused hosted call is decided before Relay and
every request/execution middleware, so no host-side callback sees it.
- background processes: a hosted record is never written to the host
checkpoint (whoever triggers the write) and gets no host completion
receipt; its live state stays in memory.
- other per-call artifacts of allowed tools (terminal output spill, saved
blocked scripts, the verification ledger) are off in a hosted scope.
Hosted Hermes serves many tenants' agents from one process, and each agent's
commands, code, background processes and files must live in that agent's own
remote sandbox. Until now the environment a tool reached was keyed by task id,
session key or profile path, so nothing tied it to the agent the bound scope
names, and a hosted scope could fall back to running on this host.
The sandbox an operation reaches is now derived from the bound scope's
(tenant, agent) alone (tools/environments/sandbox_scope.py). In a hosted scope:
- every environment key is the agent's sandbox key, whatever task id a call
carries; the terminal.backend provider must declare serves_hosted_scopes
(built-ins are refused) and receives scope= and sandbox= at creation, with
task_id set to the identity's key;
- core wraps the returned environment in ScopedEnvironment, which refuses any
call made under another agent's scope (or none) and passes the bound scope
to execute/fetch_* when the backend declares it; a cached environment that is
not the agent's own is refused at lookup;
- terminal, execute_code (always the remote kernel), background processes and
read/write/patch/search go through that environment; file-tool bookkeeping
never stats or opens the requested path on the host;
- background processes carry the sandbox key they were started under, and
another agent's process is indistinguishable from a missing one (get, list,
prefix lookup, kill sweeps).
Environments gain start_process/attach_process/stop_process with a
bidirectional byte stream (ProcessStream), implemented for the local backend
and exec-prefix backends; a ProcessRef naming another sandbox is refused.
Credentials are typed as broker references only (CredentialRef); no broker
exists yet, so none are passed.
Local installs are unchanged: with no hosted scope bound every branch keeps
today's keying and backends. A conformance module with a recording stub
backend runs the isolation checks through the real tool registry, so a hosted
backend plugin can run the same checks against its own provider.
process_registry.py's handoff handler moves to process_registry_handoff.py to
keep the facade under its size cap.
A call such as search_files without `pattern` ran anyway and returned matches, and a
typo'd or invented argument was dropped with no signal, so the model assumed an option
had taken effect. One check now sits in front of every tool Hermes ships
(registry dispatch and the agent's inline executors; model_tools.py is untouched):
- a missing `required` argument is refused before the handler runs, naming the field
(with its allowed values when the schema enumerates them) and the valid parameters;
- an argument the schema does not declare still reaches the handler exactly as sent;
the result gains a `_warning` naming it. Nothing is stripped.
Slim redo of #142503. What differs from it, and why:
- scope is built-in tools only. MCP and plugin tools, and schemas that are open or
union-shaped at the root, pass through untouched: a third-party `properties` list is
not a promise about what the handler accepts.
- nothing is stripped, so handlers that read an undeclared key and execution middleware
that rewrites arguments keep main's contract.
- legacy call shapes and tool-owned guidance are declared by each tool at registration
(`compat_args`, `self_checked_args`) instead of a central table: skill_manage and memory
flat shapes, delegate_task's single-task shape, patch's V4A mode, terminal(code=...),
video_generate(video_url=...), and the handlers whose own missing-argument message says
more than a generic refusal can.
- the dynamic schema is only built when the registered one reports a finding.
Co-authored-by: Elisa Martinez Abad <elisam@nvidia.com>
Co-authored-by: James Nolan <jnolan@nvidia.com>
The dedupe replaced "Helpers require imports: `from hermes_tools import
json_parse, shell_quote, retry`" with a prose pointer. That line is the one
instruction the model can copy verbatim, and
tests/tools/test_execute_helper_contract.py executes exactly what the schema
teaches: with the line gone the probe ran without the import and failed with
NameError on CI (Python tests 1/3).
Restore the sentence and re-render the prompt-surface snapshot. Costs back a
few of the 80 tokens the execute_code dedupe saved.
search_files, memory, manage_connections, execute_code, browser_exec,
skill_manage and terminal repeated the same rule in the tool description
and again in a parameter description (or only restated the JSON schema:
"default: 50" beside "default": 50). Every model call pays for both
copies. Each rule now appears once, on the parameter it governs where
there is one. Parameter names, types, enums, defaults and required lists
are unchanged; with descriptions stripped the seven schemas are identical
to main.
Measured on anthropic/claude-fable-5.2 (provider prompt tokens, one tool
per request): search_files 732 -> 557, memory 885 -> 767,
manage_connections 1,563 -> 1,333, execute_code 1,165 -> 1,085,
browser_exec 1,187 -> 1,145, skill_manage 1,340 -> 1,313, terminal
919 -> 895. All seven together: 8,077 -> 7,381 (-696 per call).
memory: the user/memory store meanings moved from the description to the
`target` parameter, so the single-store narrowing now rewrites only that
parameter. A disabled store is still never named in the schema (new test).
browser_exec keeps page_info() and fill_input() in the helper list: the
"work text-first" sentence that also names them is absent from the
native-vision and Lightpanda variants.
manage_connections keeps its two short opening sentences: the tool_search
catalog line is the first sentence and must not be clipped.
memory also keeps "Reusable procedures belong in a skill, not memory" at the
end of its SKIP list although the WHEN paragraph says the same: with the
sentence gone a weak model stored a procedure in memory in 1 of 9 runs (0 of
9 on main).
Prompt-surface snapshot re-rendered.
Its only consumer is the idle reaper in terminal_tool_lifecycle, so it
belongs beside it. Like the rest of that module it reads the env cache
state (_calls_in_flight, _env_lock, _last_activity) from terminal_tool at
call time, so that state stays where tests patch it and no import cycle is
added; terminal_tool re-exports the helper and _execute_remote imports it
from the sibling. No behaviour change.
Refs #143547
_cleanup_inactive_envs reaped any key whose _last_activity was older than
lifetime_seconds (default 300 s). Only background processes refresh that
stamp, while a foreground command may run for 600 s, so a long build or
test suite had its Docker workspace container stopped (exit 137), its
Modal sandbox terminated or its SSH control master closed mid-command.
terminal_tool and the remote execute_code path now hold the env keys they
were stamped under (_call_in_flight, refcounted, released in finally) from
acquisition through the approval wait and execution; the reaper skips held
keys, and release restamps so the idle countdown starts at call end.
Refs #143547
Co-authored-by: Genesis Guerrero Martinez <2824293+gengue@users.noreply.github.com>
Since the spawn-per-call rewrite (d684d7ee7e) the persistence knobs were read
into config but never reached the environment: SSHEnvironment took no such
param and _create_environment dropped local_config. Every local and SSH
session carried cwd + exported env across commands regardless of the setting.
BaseEnvironment gains persist_env (default True). When False the per-command
wrapper still sources the login-time snapshot and still emits the cwd marker,
but skips the post-command export re-dump, so exports from one command do not
reach the next. SSHEnvironment/LocalEnvironment accept persistent=...;
_build_ssh_env forwards ssh_config['persistent'] and every local construction
path (terminal, file tools, execute_code, ensure_task_env) now forwards
TERMINAL_LOCAL_PERSISTENT via _local_config_from_config.
Defaults equal today's real behaviour: TERMINAL_LOCAL_PERSISTENT now defaults
to true (it was documented false but ignored), SSH keeps following
terminal.persistent_shell (true). Only users who explicitly set the knob to
false see a change: they get the isolation they asked for.
Docs: the Persistent Shell section claimed plain shell vars persist and that
local was non-persistent; rewritten to state exactly what carries over.
- memory tool: one row per operation (a batch counts each op); gate/validation
refusals are "rejected", store-level non-application "failed". Memory provider
tools are counted in MemoryManager.handle_tool_call with the op read from the
action arg or tool-name verb.
- curator: run_curator_review records one row per pass (dry run = skipped) with
the before/after diff bucketed; a scheduled pass whose claim is held by another
process counts as skipped. The home is captured before the review thread starts.
- delegate_task: _run_batch opens the call, each joined unit folds its results in,
and the last unit emits the call's single row, so group-split background calls
are not counted per unit.
- terminal / execute_code / browser: counted per call that reached the backend;
the backend is resolved from the owning profile at call time (terminal plan
env_type, code local/remote, browser CDP > Camofox > cloud provider > engine, or
"extension" when the extension controller served the call). Guard refusals and
Hermes' own _host_local commands are not counted.
Tests read rows back from the real store; each call-site group is red with its
source reverted.
* refactor(plugins): remove the Sep 2026 decomposition compat layer on schedule
The PLUGIN-COMPAT layer (2776813df3 + d63e380324 + 0a5164cebe) kept pre-#102117 import paths
alive for external plugins until 2026-09-14. That window closed two weeks ago; since then the loader
has already been skipping plugins that use the old paths. This removes the layer itself:
- 328 appended `PLUGIN-COMPAT` blocks (lazy `__getattr__` pointer tables, re-exported third-party
names, restored dead definitions) and the three re-export stub modules
(gateway/startup_watchdog, hermes_cli/observability/relay_runtime, tools/environments/modal_utils)
- COMPAT_MANIFEST.md, compat_manifest.json, scripts/check_compat_pointers.py and its lint step
- the reporting surfaces: CLI banner notice, `hermes plugins compat`, the `hermes doctor` section,
the post-update notice, the Desktop one-time dialog, the loader's pre-import skip and the
`plugins.allow_deprecated_imports` escape hatch
An external plugin that still imports an old path now fails to load with its ImportError as the
reason in `hermes plugins list`, the same path as any broken plugin.
hermes_cli/plugin_compat.py stays as three inert stubs (compat_report, removal_in_effect,
summary_lines): an already-running pre-removal `hermes update` lazy-imports them after the checkout
swap (tests/compat/old_updater_surface.json).
In-tree fallout, both already dead: hermes_cli/setup.py::_check_espeak_ng (no callers; its
`shutil` came from a compat block) and gateway/config.py::SessionResetPolicy ("retained solely for
the scheduled plugin-compat window"). Two test_run_agent patches targeted the removed
`run_agent.handle_function_call` pointer; they now patch `model_tools.handle_function_call`, the
seam production reads, like every sibling test in that file.
* chore: retrigger CI (zero-job startup_failure phantom)
* test: drop resolution allowlist rows for the two deleted which() sites
hermes_cli/setup.py::_check_espeak_ng (dead) and tools/skillevaluator_scan.py::scanner_available
(a restored definition inside a PLUGIN-COMPAT block) no longer exist; the stale-row gate requires
their allowlist entries go with them.
A script that calls hermes_tools.write_file/patch and never prints the
returned {"error": ...} got status=success with empty output, so the
model believed the write happened. In a cross-agent bench this cost 3 of
18 Opus runs 4-6 extra turns (write_file refused by the read-before-write
guard, then re-probing and re-emitting whole files). The result now
carries tool_errors for that cell, and the in-script write_file doc says
existing files must be read first.
Gate follow-ups on the remote lockdown:
- _execute_checked(env, cmd, what, **kw) in code_execution_rpc replaces
the three copy-pasted "execute, raise if returncode != 0" blocks
(per-call setup, kernel dir setup, file ship via
_remote_write(check=True)). env.execute always returns a dict, so the
isinstance/(r or {}) guards go; the error carries command output only,
never the payload.
- _ship_env_file_and_launch_prefix returned a half-built "( ... && "
that both callers had to close; a caller that dropped the ")" or
composed it differently would lose the load-bearing subshell. It now
takes the launch command, builds the shared env map (RPC dir, token,
PYTHONDONTWRITEBYTECODE, routed TZ) itself, and returns the complete
command; the kernel passes only HERMES_KERNEL_DIR/PYTHONPATH, which
drops its duplicated TZ block and lazy hermes_time import.
- _private_dirs_cmd(root, *subdirs): every caller spelled each path
twice for mkdir and chmod.
- _run_remote_cell publishes the cell request with one atomic
_remote_write instead of ship-to-.tmp then a separate unchecked mv,
saving a backend round-trip per cell.
_remote_write branched on getattr(env, "_stdin_mode", "pipe") and only
passed stdin_data on pipe backends, echoing base64 into argv elsewhere.
BaseEnvironment.execute already embeds stdin_data as a heredoc for
heredoc-mode backends (modal/daytona/vercel), and managed_modal forwards
it as stdinData; _write_to_sandbox already relies on that for every
backend. The branch duplicated base-class logic, and its defensive
getattr default meant a fake env with neither _stdin_mode nor a
stdin_data parameter raised TypeError on every RPC response write. The
poll loop swallowed the error, so no res_* file appeared and
test_code_execution_file_rpc hung forever (it passes on base).
Collapse to one path that always passes stdin_data, and teach the
file-RPC Shell fake to accept it and feed it as input. ScriptedEnv no
longer needs its _stdin_mode stub.
On shared remote backends the execute_code channel created kernel and
sandbox dirs under shared temp at the process umask (775 group-writable
under umask 002), wrote request/result files group-readable, and carried
HERMES_RPC_TOKEN on remote command lines where co-tenant users read argv
via ps for the whole run. A co-tenant could read tool arguments and
results, and on group-writable dirs forge RPC requests dispatched under
the user's approval context.
- All remote dirs are created owner-only (umask 077 + chmod 700, checked
fail-closed) and every Hermes file write is mode 600.
- The token travels in a sourced env file inside a subshell so the vars
never enter the backend's session-snapshot dump, and ships via stdin on
pipe-capable backends so it never enters argv at all.
- The RPC poll loop rejects non-int seq requests before dispatch instead
of replaying them every cycle.
- tool_result_storage gets the same owner-only treatment for archived
tool output.
(cherry picked from commit aef21731d7fb8a4e0a6ada4ff9889264df4a8893)
Resolved toward the branch: PM provisions uv/python (main's install.ps1 uv-shim
salvage + its test and workflow steps dropped), the shim re-exec stays retired,
package.json carries no electron-builder block (afterExtract identity stamp wired
into electron-builder.config.cjs instead; after-pack.mjs keeps signing only),
Desktop workspace-deps helpers stay retired. Main's scratch-dir bootstrap
(export_scratch_tmp_env) is taken and re-run after profile resolution.
Hermes now routes scratch space through HERMES_HOME/cache/scratch (exported as
TMPDIR), so every production path that still spelled out /tmp bypassed that and
kept teaching the agent the habit. Fallbacks in tool_result_storage,
code_execution_tool, process_registry, the ACP child HOME, mini_swe_runner's
local cwd, and the CI/profiling scripts now use tempfile.gettempdir(); shell
installers fall back to $TMPDIR (then HERMES_HOME) when mktemp is missing, and
repro/eval shells use `mktemp -d -t`. User-facing help text and sample payloads
(hermes send, approvals test, hooks test, voice-mode WSL hints, meet_bot debug
line) no longer suggest /tmp.
Container-side paths (mini_swe_runner docker cwd, sandbox base env, remote
sync tarballs) keep the literal because they name the sandbox filesystem,
not the host.
- HOST_INTERPRETER_KILL_REJECTION is one constant in cron/lifecycle_guard;
terminal_tool_guards and the execute_code lifecycle guard both use it,
so an image-name kill inside a cell now names the proc_* / explicit-PID
route instead of the generic "cannot restart or stop the gateway" text.
One invariant test with the generic path as control.
- gateway/restart.is_supervised_gateway_launch: the callee already maps
None to os.environ; pass environ straight through.
Reconcile plugin declarations and validation through PM's atomic generation publication; preserve external runtimes, target markers, and conflict refusal. Keep one source-update completion owner and port upstream lifecycle changes to the PM desktop/runtime paths.
execute_code ran the same unbounded _is_supervised_gateway_process() probe
ahead of every cell, so the wedge #111922 bounds in terminal_tool still hung
an execute_code call (and its cron slot) forever: share the cell's deadline
and fail closed with a retryable error when the probe renders no verdict.
Moving the terminal pre-exec guard onto a deadline worker made it blind to
/stop, which keys on the tool thread's ident: record the acting-for tid in a
contextvar (copied into the worker by run_bounded_sync) so is_interrupted()
on the worker honours the tool thread's bit too.
Floor the guard's share of the deadline at 30s so a short command timeout
does not turn the guard's own cold-start cost (imports, git probes under
load) into a refusal — tests/tools/test_terminal_error_redaction.py was red
on the branch for exactly that.
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
Four copies of the 40/60 head/tail algorithm with a near-identical notice
(terminal_tool_result, mcp_tool_content, code_execution_tool,
environments/base_output) collapse into tools/tool_output_truncate.py, so the
ratio and the `... [<LABEL> TRUNCATED - N <unit> omitted out of T total] ...`
marker are defined once. execute_code keeps byte mode + spill path and only
shares the notice/split. Visible change: the terminal notice now uses
thousands separators like the other three (`9,000 chars` not `9000 chars`).
kanban_specify._truncate: comment claimed escape stripping the body never did;
comment now says what the plain clamp is for.
doctor_live and kanban_decompose carried byte-identical
`try: load_config() or {}` wrappers; local_models wrapped load_config in
_quiet; each is now a direct load_config_readonly() call (read-only callers;
the canonical already fails open and returns a mapping). Tests that patched the
local wrappers patch hermes_cli.config.load_config_readonly instead.
tools/code_execution_tool._load_config read the RAW file, so a managed-pinned
`code_execution.mode` and the DEFAULT_CONFIG keys were invisible at tool
discovery — it now reads load_config_readonly() (behavior change: the managed
overlay applies to execute_code's mode/timeout). onboarding.mark_seen and
credential_lifecycle's config mirror scrub parsed config.yaml with a bare
safe_load; both are read→mutate→write round-trips and use read_user_config_raw,
the documented write-back primitive.
Under `gateway.multiplex_profiles` one gateway process serves every profile
under ~/.hermes/profiles/NAME/; each routed turn runs with a context-local
HERMES_HOME override while `os.environ` still holds the DEFAULT profile's
values. Anything evaluated once at import, or memoised in a single unkeyed
module slot, therefore freezes the LAUNCH profile's value and leaks it into
every other profile's turns. This lands the tools-side half of that class:
- tools/process_registry.py, tools/environments/{modal,singularity}.py:
`_checkpoint_path()` / `_snapshot_store()` resolve `get_hermes_home()` at
call time (same seam as `tools/skills_tool._skills_dir`, so the existing
`monkeypatch.setattr(CHECKPOINT_PATH)` test sites keep working). Completes
the checkpoint_manager / sticker_cache half cherry-picked from #56315.
- plugins/platforms/feishu/feishu_comment_rules.py: `_MtimeCache` is now
path-keyed (accepts a Path or a zero-arg resolver, one (mtime, data) slot
per resolved path) with `invalidate()`; `_rules_file()` / `_pairing_file()`
resolve the routed profile's files. Proposed in #63962.
- tools/tool_output_limits.py, tools/browser_tool.py, tools/browser_camofox.py:
the process-lifetime config caches are dicts keyed by `hermes_home_key()`;
the `_X_resolved` flags and the lifecycle reset keep their shape.
tools/file_tools.py drops its private `file_read_max_chars` memo and reads
the already mtime+path-cached `load_config_readonly()`.
- hermes_time.py: `get_timezone_name()`; when `is_multiplex_active()` the
env `HERMES_TIMEZONE` (bridged from the default profile's config at gateway
startup) is ignored in favour of the routed profile's config.yaml. Both
sandbox TZ sites (code_execution_env/_tool) now use it.
- tools/cronjob_tools.py, tools/tts_tool.py, tools/skill_manager_tool.py:
the static schema text is profile-neutral and `dynamic_schema_overrides=`
rebuilds the `display_hermes_home()` / create-dir hint per
`get_definitions()`, so a routed profile's model sees its own paths.
Refs #95685.
Co-authored-by: Nathan Shan <nathanielcrush51@gmail.com>
(cherry picked from commit 6d3fc6b07b3155c6196b1fd61a829283f1d7855c)
Merge upstream b1f003e186 while preserving PM runtime ownership and
Python 3.14 worker startup, Windows signing, and macOS wait recovery.
Keep retired runtime modules deleted. Port upstream updater preflight
checks into the checkout strategy and preserve live build logging.
Carry checkpoint filename handling and process recovery into the current
module layout. Regenerate locks and adapt incoming platform test markers.
Focused Python and JavaScript tests, desktop and root-test typechecks,
conflict-path lint checks, lock validation, and retired-import checks pass.
The full test suite and packaged release builds were not run.
Slim adaptation of #83772 to the current schema and failure-hint table.
Generated helpers are module exports on every execution path, not globals.
Correct schema, recovery hints and CLI tip rather than injecting names or
changing the execution boundary. Two registry-driven invariants reproduce
both misleading instructions on main and execute the corrected guidance.
Additional tool fix discovered during campaign #104904.
Original diagnosis and correction: @yuzilongleif-collab (#83772).
Co-authored-by: yuzilongleif-collab <235949691+yuzilongleif-collab@users.noreply.github.com>
Merge upstream 5e645791ac.
Retain the PM feature-flag owner and add upstream connection options.
Use the deny-only window-open policy while trusted external links keep
the existing IPC path. Keep both session-import and external-link copy.
Preserve captured timeout output when adding terminal yield handoff.
Quickstart tests patch the explicit upstream model-assignment owner.
Migrate incoming legacy OS markers to the branch's platforms gate.
Desktop renderer and Electron typechecks passed. Targeted Electron tests
passed (42 tests), Python conflict checks passed (26 tests, 3 skips),
and the plugin-compat import checker passed. CI owns the broad merge gate.
Prepare dependency generations before selecting them. Keep shipped tool
bytes separate from writable additions, and store facts beside their entries.
Validate proposed plugin sets before config publication. Restore the previous
config if the facts write fails.
Consolidate duplicate updater, backup, setup, and voice helpers. Repair
launcher selection, dependency consumers, download ownership, update feeds,
and native Windows process and file handling.
Verification: 206 changed/prior-failing Python files reported 4630 passed,
one failed, and 330 skipped. Fix the remaining Hindsight fixture boundary.
The final targeted rerun reported 234 passed and two skipped. The store
review regression batch reported 83 passed and one skipped. Desktop
TypeScript checks, 56 selected Electron tests, 24 release tests, and the
removed-import/compatibility guards passed.
This is an integration checkpoint, not full audit acceptance. The complete
Python suite has not run on this fixed tree. Crash-atomic plugin publication,
generation cleanup, receipt correlation, and packaged lifecycle acceptance
remain open in docs/pm-audit-status.md.
The prompt backend-probe and execute_code each kept a private (key, default) table for
container_config and drifted from the terminal tool's: the probe omitted docker_network, so
under docker_network: false it started a bridge-networked container; execute_code omitted
docker_extra_args, docker_forward_env and docker_env, so a sandbox created from that path
lost the operator's settings. Both now call terminal_tool_backends._container_config_from_config.
Salvaged from #62023 by @sagitario-jpn (the probe docker_network fix), widened to the whole class.