- tui_gateway _load_cfg_raw: only FileNotFoundError means "no config".
config_version_or_none folded every stat error into None, so after a
cached absent config a transient EACCES matched the cached {} and the
next config.set could save it over the now-existing file. Any other
stat error is a FailedConfigRead again, which _save_cfg refuses.
- ConfigBackend.read_user_doc replaces read_user_layer/UserLayer: no
caller used the version it stat'ed on every uncached read; cached
loaders already ask config_version first.
- Reader lint scopes follow Python: a self.<attr> bound in one method is
seen by every method of the class, and a comprehension's target no
longer leaks into the enclosing function. The class rule found
pm/publication.py's compare-and-swap re-read of self.path, now marked
like its twin in __init__.
- pm read_home_selection: only a missing config.yaml means "no config". A symlink loop or
permission error used to look like "no file" (config_exists is Path.exists), so PM published a
dependency generation without that home's plugins; it now refuses like any unreadable config.
The stat runs before the YAML stack (FileBackend.version_path stats before importing utils),
so PM's bare runtime tree still needs no YAML for a home without config.
- check_config_yaml_readers: alias bindings iterate to a fixed point instead of two passes, so
`first = home / "config.yaml"; second = first; third = second` binds `third` too.
- ConfigIssue/_issue move to hermes_cli/config_issues.py, imported by the facade and its check
siblings, so config_value_checks.py / config_home.py no longer import the facade at all.
CI on the salvage was red on the code-health ratchet (over-cap facades grew; two blind excepts)
and on the pm observer fixture, whose isolated source tree carries pm/ + hermes_cli/ but no utils.
- config_backend imports become module-level in the facades (it imports only stdlib); gateway,
auth and telegram take config_exists through the hermes_cli.config import they already have.
- Pure helpers move to topical siblings, offsetting the growth: _csv_or_list_to_set ->
gateway/run_common.py, the dotted config-path pair -> hermes_cli/backup_restore.py, the
voice/timezone/web-backend checks -> hermes_cli/config_value_checks.py, _load_config_dict ->
hermes_cli/profile_memory_config.py (both callers are memory-provider code).
- _load_config_dict catches YAMLError/OSError/UnicodeError instead of Exception.
- _load_config_cache_hit probes readability with config_backend.probe_config_readable (a 1-byte
read through the backend's open) instead of a full parse plus a blind except.
- pm/plugins_state.read_home_selection checks config_exists before importing the YAML stack, so
a home with no config never needs utils.
- developer-guide/config-backend.md describes this build (file backend only).
Same approach as @benbarclay's 74421be709 in #122509, which does not cherry-pick onto current main.
The reader gate only bound plain `name = <config path>` assignments and never scanned pm/, so
direct local-file reads still passed it: `env_path, config_path = ...` then
`config_path.exists()` in tools/send_message_tool.py, and pm/plugins_state.read_home_selection
reading config.yaml with read_text().
The gate now binds tuple-unpacked elements, `self.<attr>` targets and for-loop targets; flags
unbound `Path.<method>(p)`, shutil copies and pm's byte readers (read_bytes_or_none,
file_digest); and scans pm/.
Routed through the backend: send_message_tool's missing-config check and
read_home_selection (same FileNotFoundError / OSError / YAMLError -> ValueError contract).
Marked as file tooling: pm's byte-level compare-and-swap publication/eviction rewrite and the
LKG backup copy, which operate on the local file itself.
Known limit: bindings flow into nested scopes, not across sibling methods, so a `self.x` bound in
`__init__` is not tracked in another method (pm/publication.PluginSelection.publish).
The local vault key sat in vault.key next to vault.json.enc, so any backup, synced
folder or copied ~/.hermes carried the ciphertext together with its key.
vault.key_storage: keychain (default stays `file`) puts a NEW vault's key in the OS
keychain via keyring (new lazy `keychain` extra, keyring==25.7.0), one entry per
profile, named by a non-secret vault.keyref. No reachable keychain (headless Linux,
extra not installed, plaintext/null keyring backends) falls back to the 0600 file.
`hermes vault key` shows where the key is; `hermes vault key migrate --to keychain|file`
writes the destination, proves it decrypts the vault, and only then removes the
source, so an interrupted move leaves a working vault and a rerun finishes it.
A vault whose key is missing (file or keychain entry) now raises a recovery message
and never mints a new key over existing ciphertext (before, a deleted vault.key was
silently replaced and the vault reported "key mismatch or corruption").
Opt-in rather than default: macOS can prompt for keychain access after Hermes'
Python changes, locked Linux keyrings prompt or are absent over SSH, cron while
logged out cannot read the key, and backups stop being self-contained.
A lazily installed SDK extra (anthropic, bedrock, ...) that the running process cannot adopt
raises "installed; restart Hermes to activate it". In the CLI-spawned `gateway run --idle-exit`
backend nothing ever restarts it: the next `hermes chat` (or the next prompt in the same session)
reattached to the same process and failed the same way until the idle window
(gateway.unmanaged_idle_exit_seconds, default 600 s) ran out.
pm.extras.ensure_import now records that pending restart (pm.environments_adopt.note_restart_pending),
and the unmanaged idle-exit watcher retires the backend within about a second once no agent work,
background work, admission, cron/kanban duty or messaging adapter holds it. Attached clients do not
hold it: they are the ones who need the fresh gateway, and they already wait out the `idle_exit`
drain and start a new owner, which boots into the new dependency generation.
Supervised gateways (systemd/launchd/Desktop's `gateway ensure`) never arm this watcher, so they
are unchanged: no self-restart without a supervisor that restarts them.
Carried from BearHuddleston's #93508 onto main. The Webapp relay and the
profile-incarnation fence stay out: carried code follows main's
named-profile rule and refuses a missing or deleted profile home.
- Webapp routes: one-use launch tickets, window handoff, and gateway
WebSocket tickets minted for the signed-in browser
- Browser surface policy and the SPA document policy
- A host terminal for the browser that survives reconnects
- Staged browser uploads and file tickets; file.attach takes a staged upload
- hermes sessions adopt
- Webapp bundle build helpers and the renderer freshness check
- Regenerated gateway contracts
Co-authored-by: emozilla <emozilla@nousresearch.com>
A plugin disabled for conflicting with an enabled one now comes back once
that plugin changes or leaves: the fingerprint is taken against the members
the update leaves enabled, and compared against the enabled members of the
next update.
Independent review findings on update-disabled plugins:
- Recorded plugins are tried only after the enabled plugins have built, one
at a time on top of them; an update that has to disable an enabled plugin
re-enables nothing, so a download failure can never swap two plugins.
- A resolver or build verdict records a fingerprint of what was tried (core's
dependency inputs plus the plugin's) and is not built again until one side
changes; a download failure is retried by the next update, and those go
first because they fitted beside the rest before.
- The update publishes against the config snapshot it decided from, and a
rejoin needs the record to still be there, so a user's mid-update choice
stands.
- Recorded reasons keep their readable start, not the tail of a uv error.
- An installed provider that fails to import is reported as such instead of
running recovery, and the startup notices dedupe per kind.
- A provider-only record is retried only while memory.provider still names
it, so a rejoin never installs a provider the user switched away from.
- An installed provider that still fails to load after startup recovery is
reported even when recovery printed an install notice.
- One spelling reader: plugin_spellings uses the shared native manifest
reader (plugin.yaml or plugin.yml), and the memory loader uses it too.
When an update had to disable a plugin it also cleared memory.provider, so
the memory provider stayed lost even after the plugin was re-enabled, and
nothing ever retried the plugin: one transient failure (a TLS proxy, a mirror
outage, a since-fixed resolver bug) left it off for good.
- The dependency union now honours plugins.disabled for memory.provider the
same way the provider loader already does, so eviction no longer has to
blank the selection. Re-enabling the plugin brings the provider back.
- The eviction is recorded in the home's config under
plugins.disabled_by_update (was it enabled, and why). Every later update
retries recorded plugins after the enabled ones and undoes exactly the
edit once a plugin fits again.
- A user's own enable/disable/remove takes the decision back: PM's selection
publication forgets the record for the plugin the user settled, and
`hermes plugins disable` on an update-disabled plugin now writes that.
- Spellings come from the plugin's own manifest instead of a plugin scan of
the PM process's home, so a profile's plugins are matched in that profile.
- A parked provider is reported, not re-installed: agent init tells the
user once why external memory is off (naming the update's reason), and
`hermes memory status` and `hermes doctor` show it instead of "plugin not
found" or "All checks passed". Doctor lists every update-disabled plugin.
Review follow-up on #131220: _spellings re-ran _discover_all_plugins for every evicted name. Scan once, lazily, and pass the entries to _plugin_aliases.
uv fails the whole workspace lock when any platform fork lacks wheels for a
dependency (uv >= 0.12.14). The generated plugin workspace inherited core's
environments, which admit every platform, so a Linux or macOS update evicted
mnemosyne (onnxruntime) and any torch-backed plugin over Android, a platform
the install never runs on, and cleared memory.provider with it.
Generalize the Android exclusion to the whole class: the generated workspace's
environments are narrowed to the sys_platform and platform_machine of the
interpreter uv installs into (emscripten, other OSes and other arches drop out
too). The interpreter is probed rather than this process, because PM can run
under a bootstrap Python whose sys.platform differs (older Termux interpreters
report linux). Core's committed lock keeps full platform coverage; it never
passes through the generator. Admission and update eviction both build through
lock_and_sync, so both are covered.
Replaces the unit tests over the dict rewrite with one invariant test on a real
generated workspace.
uv 0.13.5 (pm/lock pin) solves every platform named by tool.uv.environments,
Android included. A plugin-carried native transitive (torch behind nerve's
optional laya extra) has no Python 3.14 Android wheels, so the whole workspace
lock fails and hermes update evicts the plugin instead of installing it.
Generated workspaces install on one host, so narrow the solve to non-Android
platforms on non-Android hosts (Termux keeps today's behaviour). The core's
own lock is untouched and keeps full platform coverage.
The container image keeps PM's tool store inside the `tools` Python package
directory (/opt/hermes/tools: interpreter, Chromium, ffmpeg, node, uv). The
build snapshot copies every package root whole, so each generation built on
the data volume (a plugin enable, a lazy extra, the boot-time refresh) carried
~1.5 GB of binaries nothing builds from, and an enable briefly held two such
generations (~3 GB) before the old one was collected.
Skip the entries a store's facts.json records as published (plus hash-keyed
fetch caches) when copying core inputs. A directory with no store facts is
copied as before.
install.sh --skip-browser / --no-playwright and install.ps1 -SkipBrowser
now hand PM `--without agent-browser` again instead of `--without chromium`.
The downloaded installer is the newest script, but by default it installs
the stable tag, whose PM (v0.22.5) rejects `--without chromium` with
"--without accepts only optional default packages (agent-browser,
cua-driver)" and exits 1, failing the whole install. The new PM already
reads `agent-browser` as `chromium` (pm.defaults.RETIRED_DEFAULTS), so the
legacy spelling works against both the stable tag and main. Direct
`hermes pm install --without chromium` stays valid on the new PM.
An entry's env is derived from the package code, not its bytes, but pm
recorded it once at install time and served it from then on. A store built
before Chromium stopped exporting AGENT_BROWSER_EXECUTABLE_PATH kept the old
env, and build admission (verified_tools) compares the recorded env with the
code's, so the Desktop bundle job refused the restored cache: "chromium: tool
source failed verification: binary or environment".
prepare/_install's already-current branch now re-records the env when it
differs. The recorded digest still vouches for the bytes, so nothing is
re-fetched.
- pm: AgentBrowser class + lock entry gone; Chromium default=True and its env
exports only PLAYWRIGHT_BROWSERS_PATH (Playwright launches without an
executable path still need it). A recorded or passed --without agent-browser
maps to chromium (pm.defaults.RETIRED_DEFAULTS), and pm gc forgets the stale
agent-browser fact so its store entry is reclaimed.
- install.sh --skip-browser/--no-playwright and install.ps1 -SkipBrowser pass
--without chromium; undo hint is hermes pm install chromium.
- Docker bakes /etc/hermes/chromium-executable-path; stage2-hook validates it
and exports nothing; the sandbox-desktop image drops the agent-browser npm
install and keeps its Playwright Chromium.
The curl|sh and irm|iex installers bootstrap uv (and, on Windows, git)
before any checkout exists, so they carry those pins as fragments that
scripts/gen-bootstrap-pins.py derives from pm/lock.json. Both re-pin
paths wrote only the lock: `pm update uv` left the installers on the old
uv, and the bootstrap-installer drift check failed until someone ran the
generator by hand.
Run the generator after either path saves the lock. It keys off the
saved lockfile's own checkout, so a fixture lock outside a checkout
regenerates nothing.
Enabling or updating a plugin whose pyproject.toml declares `dependencies = []` (the official
agent-importers plugin) ran "Resolving / Installing Python dependencies" and built a new
environment generation although nothing gets installed, and every update of the plugin did it
again.
Workspace membership keyed on "has a pyproject", so such a plugin became a uv workspace member,
and members_stamp hashes a member's whole tree into the venv stamp: enabling it, or any change to
its files, made the recorded environment stale. A plugin is now a member only when it installs
packages (`PythonDeclaration.installs_packages`, the predicate dependency consent already uses
since the sibling fix for the empty consent step), so membership, requires-python checks and the
stamp all follow what the plugin actually puts in the environment.
Test fixtures that used a dep-less pyproject as a cheap stand-in for a member now declare a real
dependency (a local wheel through tool.uv.sources, resolvable offline, or a requirement where no
resolution runs); their assertions are unchanged. New: enabling a `dependencies = []` plugin
through the real admission path keeps the selected generation and recorded stamp, a later change
to its files keeps the venv current, and a plugin with a real dependency still joins.
Requirements builds (Termux deb assembly and wheelhouse gate, PM runtime
wheelhouse install) install the lock's export with uv pip install, which
re-resolves and rejects the overridden graph. Pass the lock: its manifest
overrides become --overrides and the closing check accepts them.
FORCE_COLOR/CLICOLOR_FORCE made uv pip check emit ANSI the report parser
cannot read, failing every install with an expected override mismatch.
An environment created with an output sink streams uv and keeps only
the last 2,000 characters, so a long `uv pip check` report could lose
its head: the "Found N" total and any unrelated failure printed before
2,000+ characters of override-covered lines. unexpected_incompatibilities
skipped the count check when the total was missing, so the surviving
lines read as fully explained and check() accepted a broken environment.
check() now runs pip check captured (it is a quiet step, so streaming
showed nothing anyway), and override exceptions are accepted only when
uv's "Found N" total is present and matches the lines parsed.
Pillow 13.0.0 fixes 28 advisories open against 12.3.0, three critical:
GHSA-8g5g-8vmr-9782 (heap overflow in ImagingJpegDecode),
GHSA-332p-7hrc-92wf (heap overflow saving TIFF to a buffer) and
GHSA-w889-685w-c8fh (Ghostscript argument injection), plus 16 high and
9 medium decoder/encoder memory-safety and DoS fixes. None has a 12.x
backport.
browser-harness 0.1.13, a core dependency and its latest release, pins
pillow==12.3.0 exactly, so the bump needs a uv override. The override
equals the direct pin (the existing contract for direct overrides).
browser-harness only opens, converts, composes, thumbnails and draws
images; its contact-sheet, masked-frame, thumbnail and click-overlay
output is pixel-identical under 12.3.0 and 13.0.0. pillow-heif stays
at 1.6.0 (requires pillow>=11.1.0); its HEIC round trip is identical
too. uv.lock changes only pillow.
An override installs a version the dependent's own metadata rejects, so
PM's install-time `uv pip check` failed every install (activate, pm
install/repair, fresh and bundle builds) with "browser-harness requires
pillow==12.3.0, but 13.0.0 is installed". check() now takes the uv.lock
the environment was installed from. pm/pip_check.py accepts a report
line only when that lock's [manifest] overrides name the dependency and
it is installed at the version the lock resolved. Missing packages,
other mismatches and any report it cannot fully parse still fail.
pm/pip_check.py is stdlib-only (with a tomllib-less fallback) because
the bootstrap runner loads pm.environment on older system pythons.
test_direct_overrides_preserve_the_declared_exact_version compared the
declared spelling (Pillow) with uv.lock's normalized names, so it found
no locked rows for the first capitalised override; it now compares
canonical names.
The termux pool lags nodejs.org, so one bionic 404 blocked a node bump for
every shipped target even though termux is off by default in release.py.
--skip-target drops the target from resolution; _pin_artifacts already
keeps rows for targets the decision does not cover, so the old pin stays.
str(HTTPError) is just "HTTP Error 404: Not Found", so a failed pin did
not say which upstream (nodejs.org, the Termux pool, a mirror) was
missing the file. Append e.url to the printed line and the receipt step.
certifi 2026.10.19 drops the emSign roots whose intermediate CA keys
were compromised. It was published 2026-10-20, inside the 3-day
`exclude-newer` lock quarantine, and holding a CA revocation for the
quarantine keeps the compromised root trusted for those days.
CA trust stores therefore get the one per-package exemption
(`exclude-newer-package = { certifi = false }`). The packaging contract
test now allows exemptions only for CA-trust packages and only as a
full opt-out, so any other package or a dated exemption still fails.
The pm/AGENTS.md and package-management docs state the exemption.
A plugin whose pyproject.toml declares `dependencies = []` reached the
Python-dependency consent question with nothing to list. Non-interactive
`hermes plugins install --enable` refused it ("dependency install skipped
(non-interactive)"), and in a terminal a default answer left it installed
but disabled, so official plugins had to drop their pyproject.toml.
The gate keyed on workspace membership, which every pyproject has. Ask
only when admission would put packages in the shared environment
(`PythonDeclaration.installs_packages`): applicable dependencies, a
buildable plugin package, extras, or dependency groups (uv sync
--all-packages installs a member's default groups). The install gate,
the active-replacement veto at publication and the update re-consent
all read it. PM membership and requires-python handling are unchanged.
Consent-test fixtures that used an empty pyproject to stand for "declares
Python dependencies" now declare one; their assertions are unchanged.
Every pinned tool artifact already has a content-addressed copy on
hermes-assets.nousresearch.com, and the downloader falls back to it when the
upstream is unavailable. That fallback was gated on the retry set
{408, 429, 500, 502, 503, 504} plus 401/403/404/410 and DNS failures, so a
CDN's origin-down codes (520-527) failed the install outright. On 2026-10-21
macOS ffmpeg's only upstream (ffmpeg.martin-riedl.de) returned 521 for an hour:
every macOS install/update leg died in setup, and so would every Apple Silicon
user's install, while the mirror held the identical bytes.
Any 5xx is the host failing, not its bytes changing, and the sha256 still
guards whatever the mirror serves. Retries against the same host are unchanged.
Every checkpoint git child runs selected_git_env() -> pm.ensure("git"). On
POSIX git is a declared registry gap ("uses system git by choice"), but the
client only learned that by spawning a PM worker, which raised
InstallError(..., "none") so the caller fell back to system git: ~1.1 s per
git call (plus ~8 s preparing PM's runtime in a fresh home). One
ensure_checkpoint made 15 such calls, one rollback.diff made 5. On a loaded CI
runner that pushed the gateway's /diff, /rollback and checkpoint-limit tests
past their RPC bounds. Main went red at cc6b1f299b, and the same sha is
green on a dispatched rerun.
_missing_or_refuse now answers a missing package's registry gap with the
worker's own refusal, without spawning one. Gaps are static registry data;
installed, non-gap, explicit and in-runtime paths are unchanged, and nothing
is cached (a selected managed git still applies per call).
Also pin the clock in test_room_log_pages_are_bounded_by_serialized_event_bytes:
it sizes the page budget from one event's JSON, and a wall-clock created_at's
float repr varies by a few bytes between events.
prepare showed 79-197 s of silence between the repo snapshot and the
pm-runtime venv (snapshot extract, pinned tool preparation, the copy +
re-digest of every tool into the payload store, store pruning). Name each
phase with its duration, and each copied tool, so the next run says which.
gateway_bootstrap.py mapped every RuntimeError and OSError from
activate_dependencies to `gateway unavailable: bootstrap_dependencies`, the
verdict gatewayClient.ts stops retrying on. A one-off I/O error on the install
state (the dependency lock, the facts file) therefore ended the TUI's gateway
for the life of the process.
pm.environments now raises NoCommittedEnvironment (a RuntimeError subclass, so
every existing caller is unchanged) from _require_own_dependencies, and the
bootstrap maps only that to the terminal verdict. Other errors reach the
ordinary failure path the client retries.
Review: alt-glitch on #139661, follow-up 2.
Refs #134889 (TUI-22)
Refs #139574
b11671 loads Nemotron 3.5 Bolt and its LiLiCorr draft. On an RTX 5090 it
decodes the Qwen3.8 27B at 103-104 tok/s against b11370's 97-98, with the
same memory, tool calls and image input. Every pinned release asset
exists, and no flag Hermes passes was removed.
The GGUF reader learns the block sizes of types 40-42 (NVFP4, Q1_0,
Q2_0); Bolt's file uses NVFP4.
_ensure_windows_gateway_venv_imports() addsitedir'd <root>/venv (or
VIRTUAL_ENV) whenever PM had no committed generation, without checking
which Python that venv was built for. PM launchers and
activate_dependencies pop VIRTUAL_ENV, so the fallback was the leftover
pre-PM <root>/venv: a cp311 tree loaded into a 3.14 gateway, which died
importing pydantic_core as soon as the Group Chat worker imported
tui_gateway.server. #122183's guard only covered the committed case.
Skip a venv whose pyvenv.cfg version differs from the running
interpreter. venv_python_version() now also reads `version_info`, the
key uv and virtualenv write, so a matching uv-built venv still overlays.
This stops the overlay from adding an incompatible venv. It does not remove a
foreign-ABI path put on sys.path from outside Hermes, and it has not been run on
native Windows, so #139085 stays open until a Windows retest.
The same check is proposed in #122330 by @janviernine (the earliest, which
also reads version_info), #122333, #122376, #123129, #123332, #123358,
#123409, #123974 and #123981.
Refs #134889 (KB-4)
Refs #139162
Refs #139085
Co-authored-by: janviernine <janviernine@users.noreply.github.com>