Commit Graph

52365 Commits

Author SHA1 Message Date
Teknium
b178f6f6fc fix(state): retiring a deleted target strips its text from every mutation receipt naming it
f7dd0aedab stripped target_message/summary only from mutation receipts whose
result.session_id was a deleted id. A local owner's receipts are keyed by the
logical id, but rewind copies the rewound turn from the PHYSICAL target (a
reset child). Deleting just that child (legacy delete_session / dashboard row)
left the logical owner alive, so its gateway.mutation.v1 rewind receipt still
held the deleted turn and an exact retry returned it.

Retirement now matches a receipt by every session id its result names
(session_id, target_message.session_id, target_session_id,
previous_target_session_id), and also nulls a user-set title (rename/sidebar),
which otherwise outlived a full delete in its receipt.

Raw state.db / -wal bytes still hold the deleted rows until SQLite reuses the
freed pages; main's delete_session behaves the same (secure_delete off, PASSIVE
checkpoints) and that is left as a policy decision.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6073624820
(cherry picked from commit 0a4b3e550b7f2192d363bf2e5661d51713a052a0)
2026-10-09 02:10:47 -07:00
Teknium
c4d1ba0e2f fix(cron): run prompt recovery inside the cron writer lock
Post-update cron prompt recovery (#82990) read jobs.json, patched the
in-memory copy, and atomically replaced the whole file without joining
cron.jobs._jobs_lock. Atomic replace prevents torn bytes, not a lost
update: any cron edit committed between recovery's read and its publish
(a new job, a removal, a schedule edit, a legitimate prompt rewrite) was
silently erased or reverted. Inherited from hermes_cli/backup.py and
preserved by the extraction.

Recovery now uses the unlocked read only as a cheap gate (healthy path
stays side-effect free), then pins the store and lock to the target home
with use_cron_store(), takes the canonical _jobs_lock, re-reads via
load_jobs(), restores only prompts that are STILL degraded for snapshot
ids, and publishes through the locked, merge-aware save_jobs(). The
conservative predicate (blank or name-collapsed prompt, no_agent skipped,
blank snapshot prompt restores nothing, unknown ids untouched) is
unchanged. A real-file regression races create/remove/schedule-edit/
prompt-edit through the production cron writer between the read and the
publish; it fails on r7-base and passes now.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464799967
(cherry picked from commit 4f903148be8a50ce2869c8e6f492b5be2d399ba1)
2026-10-09 02:10:47 -07:00
Teknium
932952d9d3 fix(rooms): bind room owner claim to the room insert transaction
Canonical groups.create called authorize_room(create=True) before the
roster/name/target validation and in its own write transaction. A
rejected create (e.g. empty member list -> invalid_params, or a storage
error during the insert) therefore committed a durable
gateway.hosted.owner.v1:<room> row with no hosted_rooms row, and every
other actor's later valid create of that id returned permission_denied.

authorize_room now accepts the caller's connection, and create_room takes
an admit(conn) hook that runs inside its BEGIN IMMEDIATE after payload
validation. groups.create passes the owner claim through that hook on
both the driver and metadata-only paths, so the owner row and room row
commit or roll back together. First-writer fencing is unchanged: the
claim still reads the owner row under the same write lock, so of two
concurrent valid creators exactly one wins.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464799967
(cherry picked from commit bf3690cab39c02660fa964fe36244eeaccc52ff6)
2026-10-09 02:10:47 -07:00
Teknium
c27aad5c87 fix(acp): offer and reopen a canonically reset ACP session by its retained owner
A canonical session.mutate(reset) on an ACP-owned local session advances the private local
receipt to a physical child but keeps policy/FIFO on the creation id. The picker normalized
compression roots only, so after a post-reset turn it offered the child as a separate newest
chat; loading it sent session.info for the child and policy restore failed
storage_unavailable, while the original logical row still worked.

The catalog now maps every physical id in a local receipt's lineage to its owner (one row per
logical conversation, newest segment shown), and logical_session_id applies the same mapping
to an id the editor already holds before session.info. Legacy reset histories have no local
receipt and stay independent chats; compression normalization is unchanged.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464152170
(cherry picked from commit 52d5abf4632b4a710cedf1d5bc8fe65c1a45288f)
2026-10-09 02:10:47 -07:00
Teknium
9faa487040 fix(state): housekeeping keeps the logical owner of a retained local reset child
A local reset (canonical session.mutate reset and SessionStore reset_local_target) keeps the
policy, FIFO and generation on the creation id and only advances the receipt to a physical
child. The root is ended (session_reset) and ages on its own, so prune_sessions and
delete_empty_sessions retired and deleted it while the child, its history and the policy
survived: the next submit was not_found and cold restore storage_unavailable.

retire_prunable, which every sweep shares, now skips every id a kept local receipt still
needs (its creation id and lineage) while the receipt's current physical target is not
itself being swept. Explicit whole-conversation delete is unchanged (delete_in_transaction
closes over the lineage), and an unrelated aged/empty session is still swept.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464152170
(cherry picked from commit a0068596c88e980ea857f90babc63bced5e04b20)
2026-10-09 02:10:47 -07:00
Teknium
21e5881086 fix(gateway): resolving an unknown turn commits the answer this owner captured
When every bounded settlement attempt fails (3cda1ec / 524316b retries a transient error
twice first), the drain fences the claim `unknown`, keeps the exact structured result in
authority.pending_results and pauses the FIFO. prompt.resolve_unknown then committed the
row terminal/interrupted and dropped that result: the model's finished answer was thrown
away although only its receipt write had failed, and the PR's own test asserted the loss.

resolve_unknown now prepares the captured result (prepare_result: same compaction and
redaction as normal settlement) and resolve_unknown_session_input commits it in the same
transaction as the terminal transition, with the result's own outcome (completed / failed /
interrupted). Only a row stamped unknown by this same owner epoch takes a captured result;
an unknown inherited from a previous owner (restart) still resolves interrupted exactly as
before, since no answer exists. Viewers receive the committed message.complete. An exact
retry of a resolution that committed a result returns the same receipt.

tests/gateway/test_live_settlement_recovery.py: the existing discard assertion is replaced
by the new contract (terminal/completed, stored final_response, one completion frame). This
is strictly better: the operator action still unblocks the FIFO exactly as before and the
lost-row boundary still commits atomically; the only change is that a produced answer is
kept instead of discarded. Red on the previous head (both parametrizations):
('terminal', 'interrupted') != ('terminal', 'completed'); green after.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6073624820
(cherry picked from commit bc1a469e0f9f42e2b8ee99c30627de47fbd012d9)
2026-10-09 02:10:47 -07:00
Teknium
9dadd0be5b fix(gateway): queued-input cancellation writes off the owner event loop
cancel_queued ran cancel_session_input and the media collection pass synchronously on the
owner loop. A Delete on a queued card (prompt.cancel) while another process held the
state.db writer therefore stalled every session for up to the write patience, the same
class as the settlement-lock stall.

Both writes now run in a worker thread. The commit and its observer settlement form one
tracked task shielded from the caller, so a client that disconnects mid-write cannot leave
a committed cancellation with unsettled waiters (profile retirement joins tracked work).
The obligation/exact-retry contract is unchanged.

Test: test_settlement_lock_liveness.py::test_cancel_behind_a_held_writer_... (real held
BEGIN IMMEDIATE writer, 50 ms loop-progress control): before 1 failed (callback ran only
after the writer released); after passed, the cancelled waiter still settles once.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464152170
(cherry picked from commit 5d7351402c101c101817b76206d4dc9a164a469b)
2026-10-09 02:10:47 -07:00
Teknium
7fef5d8b6c fix(gateway): a contended settlement write no longer stalls the owner event loop
The settlement worker held the session's event_stream.lock (a threading RLock) across
finish_result's SQLite write and the terminal media cleanup. attach, receipts,
_publish_pending and every other loop-side reader take that same lock synchronously, so
while another process held the state.db writer (up to _WRITE_PATIENCE_S = 20 s) the whole
owner loop - every session and profile, timers, sockets, Stop and approvals - waited on it.

The write now runs outside the lock. The ordering the lock used to provide (no reader sees a
terminal row without its message.complete frame) is kept by LiveSession.settling: the
worker records the started claim under the lock before the write, and removes it under the
lock in the same hold that publishes the completion. Lock holders read pending rows and
receipts through _pending_rows / receipt, which present a recorded claim as still started,
so a snapshot taken during the write shows a running turn whose completion is still to
come. Terminal media cleanup moves after publication, outside the lock.

Test (real contended writer: a second sqlite3 connection holds BEGIN IMMEDIATE for 1.5 s,
an unrelated 50 ms call_later is the loop-progress control):
  test_settlement_lock_liveness.py: r7-base 2 failed (callback ran only after the writer was
  released, for attach and for _publish_pending); after 2 passed, attach snapshot still
  never shows the terminal row ahead of its completion, idle info still follows completion.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464152170
(cherry picked from commit 07f10b0d37198d87664552a2d850a7e0559e549f)
2026-10-09 02:10:47 -07:00
Teknium
0f2fdc2757 test(install-e2e): a lock file keeps main's {"kind": "lock"} record on the volatile path
Main (#135261) records a lock file as {"kind": "lock"} without reading it; this branch's
earlier volatile-sidecar path (7d86a30b7e) recorded the same file as {"kind": "file"}.
Merge #30 put both in one function and the volatile path won, so main's
test_a_lock_file_is_a_sentinel_not_user_content went red in CI. The volatile path now
records locks as "lock" (still never read, still tolerated when they vanish), and this
branch's own held-lock test asserts main's contract.
2026-10-08 23:00:29 -07:00
Teknium
607a23e858 Merge origin/main (#30: 54 commits to 1744a19e0d) into feat/unified-gateway-runtime
8 conflicts, all from main's lint sweep (#135281 "Harder linter fixes" + the RUF series:
implicit-Optional, unused-unpacked-variable, next(...) for [...][0]). No other main commit touches
a conflicted file. Resolution: the branch side of each file plus main's exact autofix
(ruff 0.15.10, main's ruff.strict.toml, --fix --unsafe-fixes) on it. ruff.strict.toml takes main's
copy (the newly enabled rules). tests/cron/test_bot_chat_delivery_child_env.py stays deleted
(1cc9cb9199 retired its lane).
2026-10-08 21:38:54 -07:00
Teknium
8d6bde523b fix(gateway): the large-context switch guard measures from the persisted anchor with no resident agent
Every applied model switch evicts the session's cached agent, and an owner restart has none, so
`selection_context_for_agent(None)` returned nothing and the context_cache guard went silent: a
second switch right after the first (or the first after a restart) applied with no prompt even on a
250k-token session. With no resident agent the guard now reads the session's persisted usage anchor
(`persisted_anchor_tokens`, the same figure gateway hygiene uses) for the context at stake.

Red on the pre-fix source: the new test's switch applied (`KeyError: 'status'` on the applied
result); green after. Found live by the confirm lane.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 21:37:52 -07:00
Teknium
1552d8ffcb refactor(desktop): keep runExec under its complexity cap after the guarded /model branch
d0285a70798 added the typed-/model confirmation inline in runExec (CC 19 -> 21 > target 20,
scripts/check health blocking). The branch moves into a sibling closure,
confirmGuardedModelExec; behaviour unchanged (same dialog, same single resend).

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 21:34:22 -07:00
Teknium
f19df95e41 fix(desktop): wire the canonical model confirmation into the shared model-switch dialog
On a canonical local session the picker (config.set key=model, routed to session.mutate by
276c7d7bca) and a typed /model got the owner's status=confirmation_required answer back as a
plain ok receipt, so the guarded target silently did not apply. The protocol adapter now projects
that answer onto the handshake every Desktop surface already speaks (confirm_required +
confirm_message) and keeps the owner's token; the confirmed resend (confirm_expensive_model: true)
carries it as payload.confirm, once, under a new request identity. The picker's existing
surfaceModelSwitchConfirm dialog therefore asks; a typed /model now routes the same answer into
that dialog too. A declined dialog sends nothing; a spent token is never reused.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 21:34:22 -07:00
Teknium
645b1fe72d fix(tui): route the canonical confirmation_required model answer into the confirm dialog
The canonical /model (and the new-session-with-model path) read result.model and showed
"error: invalid response: model switch" when the owner refused a guarded target with
status=confirmation_required + a one-time token. The legacy config.set path already asked with the
confirm overlay; the canonical answer now opens the same overlay (Switch anyway / Cancel, the
owner's confirm_message as detail). Yes re-sends session.mutate once with payload.confirm=<token>
under its own retained request identity; cancel sends nothing. A confirmed send refused again is
reported (slashCmd.session.model.confirmStale), never re-asked in a loop. New TUI keys in every
*.tui.yaml; locales/_keys.tui.json regenerated.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 21:34:22 -07:00
Teknium
10e2b6226d fix(cli,acp): collect the owner's guarded-model confirmation on the classic chat view and ACP
Maintainer ruling: model-switch confirmation is unified across every surface, as on main.
501ea6c4d91 made the owner refuse a guarded target (cost / data policy / large context) with
status=confirmation_required and a one-time token, but PreparedMutations turned that into
"Model not switched: ... this client cannot collect yet" on both native surfaces.

- PreparedMutations.apply(confirm=...) takes the surface's prompt. Yes re-sends the same retained
  mutation once with payload.confirm=<token> (new request id, kept under the original key so an
  ambiguous reply to the confirmed send retries that exact request); no answers status=cancelled
  and nothing is re-sent. No prompt (non-interactive) stays a refusal carrying the guard text, and a
  confirmed send refused again (a turn or another switch landed first) is reported, never re-asked.
- Classic CLI chat view: /model asks with main's _confirm_expensive_model_switch wording and
  choices (Switch anyway once / Cancel; 1/2, y/n aliases) on the composer; only when stdin is a TTY.
  The status bar follows the applied model.
- ACP: set_session_model and a typed /model ask through request_permission (the mechanism
  approvals use) with Switch anyway / Cancel; deny, dismissal or a lost editor keeps the model;
  a declined set_session_model fails with model_switch_cancelled so the editor's picker reverts.
- New catalog key cli.model.confirm_choice_prompt in every locale.

Live (real gateway, fake HOME, loopback stub, model.switch_context_confirm_tokens=1): on
r6-integ-a `hermes chat --resume` + `/model local-stub-b` printed the guard text and "Model not
switched"; see RESULTS.md for the after run.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 21:33:56 -07:00
Teknium
5eb20d2696 fix(tui): this PR's Ink strings go through the i18n catalog
pastels §3: the shared-gateway client text added in this PR was hardcoded
English (`clipboard image failed: …` in useComposerState and every sibling
literal of the ui-tui diff vs origin/main). Route them through `t()` /
`useT()`: durable admission and legacy-delivery receipts (submissionCore),
the queue journal and server-row labels (useQueue, useSubmission), owner
image staging (imageAttachments), pending-input records, launch-contract
refusals (canonicalGateway), the interrupt failure (turnController), the
narrow-snapshot banner (branding), and the generic error / startup-query
lines (createGatewayEventHandler, in the previous commit). Keys live in the
new `canonical.*` namespace (en/canonical.ts), are in locales/_keys.tui.json
and in all 16 `*.tui.yaml` packs; existing keys are reused where the English
already existed (model switched, branched, invalid response, unknown error).

Left literal on purpose: lifecycle/log lines (`[lifecycle] …`), the
`gateway.start_timeout` payload's `python: 'gateway ensure'` identifier and
the 'What do you see in this image?' default prompt sent to the model.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 21:04:38 -07:00
Teknium
373dd6bc89 fix(tui): /title /undo /retry /usage /tools work on the shared gateway
On a canonical gateway Ink still called RPCs only the legacy tui_gateway
serves: /title -> session.title, /undo and /retry -> session.undo, /usage ->
session.usage (all unknown_method, rendered as "UI and backend out of sync"),
and /tools -> slash.exec (unsupported_command). `/new <title>` hit the same
session.title. Map them onto what the authority serves:

- /title X (and /new X): session.mutate operation=rename {title}, CAS on the
  revision from a fresh session.resume and, as Desktop's metadata mutations,
  no generation fence. Bare /title reads the stored title from session.list.
- /undo, /retry: session.mutate operation=rewind {target_message_id} naming
  the newest human user row (row_id, previous commit) of the same snapshot the
  revision/generation came from. /retry then resubmits the rewound turn's own
  text (main's semantics), so it also works on a resumed session.
- /usage: the authority keeps no session ledger, but each settled turn commits
  its usage with the admission; render the last completed admission's
  prompt.receipt include_result and say session totals are not available yet.
- /tools: toolsets are frozen at launch; show session.info launch_request
  toolsets and a localized "not available on the shared gateway yet" line.

mutateCanonicalSession is generalized to mutateCanonical(operation, payload |
snapshot => payload) keeping the lost-reply rule: a retry re-presents the
original CAS tuple and target instead of re-deriving one. Its own strings and
the new command lines are localized (new `canonical.*` catalog, all 16 packs).

Live (real gateway + real Ink in tmux, fake HOME, loopback provider): before,
all four errored "out of sync" and /tools printed unsupported_command; after,
state.db title = 'Probe Renamed', /undo soft-deleted both exchanges' rows
(active=0) and /retry re-admitted 'first question' (new active rows 11/12).

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 21:04:38 -07:00
Teknium
a7ac3a3a16 fix(gateway): canonical snapshots carry each row's durable row_id
`session.mutate operation=rewind` addresses its target by `target_message_id`
(messages.id), but `local_history` loaded the transcript without row ids, so
no canonical client (Ink /undo, /retry) could name a rewind target from a
snapshot. Load with include_row_ids and project the internal `_row_id` as the
public `row_id` — the TranscriptMessage field Desktop hydration
(`message.row_id ?? message.id`) and the legacy `session.history` already use.
The underscore key never reaches the wire.

Consumers checked: Ink canonicalResult spreads the row (extra key is inert);
Desktop hydration already reads row_id; ACP `_history_replay_updates` and the
classic gateway_chat_view resume print read role/content only; the hosted
`_history` and session.resume projections pass rows through.

test_session_mutation_model compared a branch's resumed messages to its
parent's by full dict equality. Branch copies the rows, so the copies have
their own physical ids; the assertion now compares the logical rows (minus
row_id) and additionally asserts the two id sets are disjoint.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 21:04:38 -07:00
Teknium
1744a19e0d ci(desktop): re-smoke an already-built package without rebuilding it
The native smoke only ran inside desktop-bundled-release, and it checked out
its test scripts at the same commit as the artifact it fetched. Changing a
test therefore meant a new commit, and a new commit meant a full signed
build (about an hour per platform) just to rerun the smoke.

Add workflow_dispatch: `sha` picks the staged artifact to fetch, and the
scripts come from the ref the dispatch runs on. Release callers are
unchanged.
2026-10-08 20:20:55 -07:00
Teknium
f470bf3a32 test(desktop): the MSIX plugin smoke runs with a user's environment, not the CI driver's
The smoke's CLI inherited the driver's HERMES_HOME / HERMES_RUNTIME_DIR /
HERMES_PYTHON, so PM built the plugin's environment on the driver's own
Python under C:\a\_temp\setup-pm and never touched the packaged
interpreter: the bug could not show. Clear HERMES_*/UV_*/PYTHON* and the
driver's tool dirs from PATH in the basic-user batch, and fail if the
install log still names the driver's PM home.
2026-10-08 20:20:55 -07:00
Teknium
eb699a158c fix(pm): MSIX plugin installs build on a writable copy of the bundled Python (#135236)
Enabling a plugin with Python dependencies, and `hermes pm install`, failed
in the packaged Windows app: uv lock/sync/pip check exit 101 with "Unable to
create process using ...\venv\Scripts\python.exe".

uv queries a venv by running its Scripts\python.exe. That redirector lives
outside the package and CreateProcess's the interpreter named by
pyvenv.cfg `home`. 6a031bf1b3 moved generations onto the packaged
interpreter, so `home` names a file under WindowsApps that a process without
package identity may not start (exit 101 is the redirector's
RC_CREATE_PROCESS). Restore the verified writable copy of the pinned Python
in the user store as the build interpreter for sealed Windows payloads.

venv_command (also from 6a031bf1b3) stays: Hermes still enters those venvs
on the packaged interpreter, so its own children keep package access to the
bundled git, rg and PM worker.
2026-10-08 20:20:55 -07:00
Teknium
cd522d80a2 test(desktop): the Windows MSIX smoke installs a plugin with Python deps as a basic user
The installed-package smoke only chatted, so nothing exercised PM building
a dependency generation inside the package. After the chat it now installs
a local plugin that declares a Python dependency through the package's CLI
execution alias with --enable --yes-deps and requires `plugins list` to show
it enabled.

It runs under a Safer NORMALUSER token at medium integrity: GitHub runners
are administrators, and Administrators can start files in a package
directory without package identity, which a normal user cannot. A probe
that the token is refused the packaged python.exe keeps the check honest.
2026-10-08 20:20:55 -07:00
Teknium
220460f6df test(cron): the owner execution tuple names the scheduler execution id
df12cce832 made session_cron.execute bind the scheduler's execution id (the admission's
request id, the id cron/executions knows) instead of the admission id, by design. This exit-cleanup
test still asserted the old admission-id tuple; it now pins the new contract. Its real subject
(Ctrl+C in end_session still closes the store and the agent) is unchanged.
2026-10-08 20:04:41 -07:00
Teknium
3b0dc776b6 fix(tests): the test runner kills detached processes a test leaves behind
`_kill_tree` SIGKILLs the per-file pytest process group, which misses any
child that left the group with `start_new_session=True` (an auto-started
`gateway run`, a setsid server). Those are reparented to init and run
forever: one host accumulated 215 orphan gateways (~52 GB RSS, up to 21 h
old), and every `hermes update` listed each as "another Hermes home — left
alone".

After every attempt the runner now SIGKILLs any process whose environment
still points into that attempt's unique temp root (PYTEST_DEBUG_TEMPROOT /
TMPDIR, or a HOME / HERMES_HOME a fixture created under it). The root is
unique per attempt, so the match names only that attempt's processes.
Linux-only (/proc); the process-group kill stays the fallback elsewhere.
2026-10-08 19:48:33 -07:00
Teknium
ffcd3621a9 ci: E2E suites run only on release builds
Pull requests and pushes to main no longer run any E2E suite: ci.yaml's detect gate
forces every e2e* lane off unless the run is a stable-release run (inputs.release) or a
manual dispatch, whatever the diff, the update-path classifier or the run-e2e label
selects. That covers the Python e2e and e2e-upgrade jobs, the Windows E2E and Windows
install + update journey in tests-os, and the Desktop core/update suites.

install-e2e.yml drops its pull_request (path-filtered `pr` route) and 12-hourly
schedule triggers; it runs from the stable-release gate (workflow_call) or by dispatch.
live-providers drops its nightly schedule and keeps the release-tag push + dispatch.

Why: a one-row change to left_core_migration.py held a PR for 40 minutes on the
Windows install + update E2E; the suites cost most of the larger-runner minutes and
the release gate already runs all of them strictly.
2026-10-08 19:48:31 -07:00
ethernet
908e4a4b44 Merge pull request #135242 from NousResearch/feat/onboarding-connectors-scroll-fade
Onboarding apps list fades at the edges when it scrolls
2026-10-08 22:17:34 -04:00
ethernet
94b1b6d422 refactor(desktop): drive FadeScroll's edge fade with scroll-driven CSS
FadeScroll tracked clipped edges in React state, with a scroll handler and a
resize observer, then rebuilt an inline mask on every change. Move that to a
`scroll-fade-y` utility: the mask's stops are scaled by two registered
<number> properties that the scroller's own scroll position animates
(animation-timeline: scroll(self y)), so an edge only fades while content is
clipped behind it and a list that fits is never dimmed. No listener, no state;
a browser without scroll-driven animations shows no fade.

From each edge inward the mask is `pad` of fully hidden content, then `fade`
of gradient, both optional props. The onboarding apps list sets pad to 1.5rem
so the gradient starts at the chips instead of spending itself on the empty
padding at the box edge. edgeMask/scrollEdges stay for the profile switcher.
2026-10-08 22:10:44 -04:00
Teknium
84edf214d7 test(upgrade): skip only known optional-extra SDKs in the HEAD-module import probe
IMPORT_PROBE skipped a HEAD-added module whenever its ModuleNotFoundError named
any top-level module outside the checkout's own packages, so a missing core
dependency (pydantic, httpx, ...) or a typo in a new module passed silently.
The skip exists for one case (acp_adapter.gateway_server needs the `acp` extra,
d2b1b8989b). It is now an explicit OPTIONAL_SDKS import-name -> extra map,
asserted against pyproject's optional-dependencies so a renamed extra fails
loudly instead of widening the skip.

Red/green (lanes/docs/probe_upgrade_import_rule.py executes the probe source
against a fake root whose only added module raises ModuleNotFoundError):
r6-base probe skips both `pydantic` and `acp`; fixed probe fails `pydantic`
and still skips `acp`.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:52 -07:00
Teknium
237347122b docs(kanban): the unknown-admission hold ends when the bound interpreter dies
kanban.md promised that PID death never re-executes an ambiguous (unknown)
attempt. Since 8950d41bd9 the crash sweep holds such a card only while the
owner-bound interpreter (`worker_bound`) may still run; once it is dead,
_reclaim_dead_workers releases the claim and the card returns to ready/review
under the crash budget. Probe (lanes/docs/probe_kanban_reclaim.py, real board,
owner ledger row `unknown`): bound interpreter alive -> not reclaimed, still
running; bound interpreter dead -> crashed=True, status ready.

The guide now states exactly that, including that a re-attempt can repeat
effects the lost attempt already had. Whether crash reclaim should instead keep
an unknown attempt blocked is a policy call recorded in RESULTS.md, not changed
here.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:52 -07:00
Teknium
ee7670c8b4 docs(cron): document the delivery_queued lifecycle and its write-back; add upgrade notes
cron-internals.md still called last_status "a closed set written only by
mark_job_run" (four literals) and said cron history never tracks later receipt
completion. At this head an agent run hands its send to cron/deliveries.db and
books last_status=delivery_queued / ledger queued; the gateway drain then settles
it through cron/delivery_outcome.py (delivered/suppressed -> ok, failed/unknown ->
delivery_failed + error), called from both sides and fenced on execution_id.

Probe (lanes/docs/probe_cron_writeback.py, real jobs.json + ledger + queue):
telegram target delivery_queued/queued -> ok/delivered after one drain; a
Bot Chat target queued by the owner also settles to ok/delivered while
last_delivery_queued keeps the receipt; a no_agent Bot Chat run stays
delivery_queued/queued (never on the queue).

- cron-internals.md: delivery_queued literal; new "Queued delivery lifecycle and
  write-back" section with the outcome table; the Bot Chat paragraph now says
  which paths are settled by the write-back (accepted, not answered) and which
  stay queued.
- user-guide cron.md: the same correction for "Queued is not completed".
- getting-started/updating.md: "Upgrading to the gateway-owned session runtime":
  the retired cron.bot_chat_delivery_timeout_seconds key (v51, also unversioned
  files), legacy cron/bot_chat_pending records, started work becoming unknown on
  the cutover restart (/discard), and the rollback FK caveat. cron-internals.md
  links to it.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:51 -07:00
Teknium
72b1eece9f docs: bring cli-commands.md back under its file-size ratchet
The root AGENTS.md rule: files at or below 2,000 lines, units already over may
only shrink. cli-commands.md was 2,043 lines on main and 2,127 at this head
(+84). The long form this PR added moves to the page that owns it, leaving a
summary and a link:

- the `hermes gateway ensure` contract (service identity checks, the POSIX
  home-permission policy, exit codes, readiness caveats) -> developer-guide
  gateway-internals.md#hermes-gateway-ensure, next to optional service
  installation;
- "Delegation in finite chat runs" -> user-guide delegation.md#finite-chat-runs,
  beside the one-shot child cap.

Now 2,042 lines (< 2,043 on main). Content unchanged except the summaries.
Root AGENTS.md is 11,952/12,000 chars (check_agents_md_size.py ok); the other
over-cap units this PR grows are code/generated files outside the docs lane
(lanes/docs/NOT_COVERED.md).

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5458083694
2026-10-08 19:09:51 -07:00
Teknium
0190774d73 docs(gateway): describe the launch options and slash commands the client actually has
The developer guides still listed skills, checkpoints, YOLO, hook acceptance,
pass-session-id, safe mode, ignored rules/user config, title selection,
create-if-missing, usage reports and API credentials as refused by `hermes chat`,
and said other slash commands reject. At this head gateway_chat forwards all of
those as frozen creation policy (`_POLICY`, advertised by runtime.describe from
session_policy.CREATE_FIELDS), and the view dispatches /discard, /branch, /model,
/compress (session.mutate) and /yolo (config.set). Probe
(lanes/docs/probe_chat_flags.py, real parser + validate_options): 13 accepted,
only -w, --image, --run-budget, -v, --no-restore-cwd, bare -c, --resume latest
and a nameless --create-if-missing refuse.

- gateway-classic-cli.md: accepted vs refused table with the reason and
  replacement per refused flag; slash surface; resume may repeat creation flags.
- user-guide/cli.md: same refusal list and frozen-at-creation list; /yolo.
- gateway-local-sessions.md: all six sources; the full CREATE_FIELDS launch
  contract instead of "still return invalid_params"; runtime.describe shape.
- session-storage.md: the gateway is the only canonical session writer; the four
  runtime-ledger tables (ON DELETE RESTRICT, unknown never replayed) and why
  `sessions recover` excludes them.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5458083694
Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:50 -07:00
Teknium
d1a08c9235 fix(config): retired-key steps no longer depend on a stamp that does not prove they ran
Two ordering gaps on the migration ladder (pastels §3):

- The retired cron.bot_chat_delivery_timeout_seconds step (v51) was missing from
  LEGACY_KEY_STEPS, so an unversioned config.yaml (seeded from an older template,
  or written only by targeted writers) kept a key nothing reads.
- Unreleased builds of this branch put the same cron-key step at 44, 45, 46, 47
  and 50 before it landed at 51. A home one of them stamped skipped main's step of
  that number for good, e.g. stamped 46/47 -> main's v46 MCP `disabled: true` ->
  `enabled: false` normalisation never ran, so the server kept running while the
  profile editor showed it off; stamped 50 -> main's v50 tirith keys stayed.

51 joins LEGACY_KEY_STEPS. The two steps a branch stamp could have displaced that
are pure retired-key/identifier rewrites (46, 50) now run on every migration pass
whatever the stamp (STAMP_INDEPENDENT_STEPS): each is a no-op once its key is
gone and never overrides a value a runtime consumes. Value-based steps such a
home also skipped (44, 45, 47) are deliberately NOT re-run: past the stamp their
trigger value may be the user's own choice.

Red on r6-base: both new cases fail (unversioned file keeps the cron key; a
50-stamped home keeps `disabled: true` and tirith_enabled). Green: 219 passed
across the config migration suites; a second pass writes nothing.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:50 -07:00
Teknium
f5c0b99ebf test: match plugin opens by path component, not a POSIX substring
The safe-worker audit hooks recorded a plugin read only when the opened path
contained "/plugins/". On Windows the audited path uses backslashes, so the
config and ordinary positive controls saw zero plugin reads and failed (2/3
parametrizations), while the safe-mode negative control passed vacuously.
Match on Path(...).parts instead, the same predicate on every platform; the
exec hook in the sibling tool-closure test gets the same fix.

Red/green: the old predicate is False for
C:\...\config\plugins\sentinel\__init__.py, the new one True; Linux suite
20/20 unchanged.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5458083694
2026-10-08 19:09:49 -07:00
Teknium
276c7d7bca fix(desktop): route the composer model picker to the canonical model mutation
The picker sends `config.set {key: 'model', value: '<model> --provider
<id> [--session]'}`. The canonical protocol adapter passed that through
unchanged, but the authority's config.set accepts only busy/verbose/
YOLO preferences, so every picker selection on a local canonical
session failed with invalid_params while a typed `/model <name>` worked
through `session.mutate`.

The adapter now prepares a picker value of exactly that shape as the
existing fenced `session.mutate` operation `model` (payload {model,
provider}, same retained request identity, CAS revision and execution
generation as the typed directive) and settles its receipt as `ok`.
`--session` is dropped: the canonical model mutation is always session
policy and never rewrites config.yaml. Any other flag (e.g. --global)
has no canonical field and stays on config.set, which the authority
refuses explicitly. Legacy (non-canonical) transports are untouched.

Not covered here (gateway side, lane acpapi / DECISION NEEDED): the
shared selection-guard confirmation exchange (helix4u item 2) and a
deferred next-turn selection while a turn runs; the authority still
refuses a mid-turn mutation with session_busy, which the picker now
reports instead of a misleading invalid_params.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6067585232
2026-10-08 19:09:49 -07:00
Teknium
a4593d8d6d fix(shared): forget a session's replay epoch with the cursor it numbers
JsonRpcGatewayClient kept replayEpochBySession forever: an entry was
added for every session whose events carried a replay_epoch and never
removed, even when the authority answered `snapshot_required` and the
client dropped that session's cursor. A long-lived Desktop or TUI
socket that cycles through many sessions (Bot Chats, cron, sidebar
browsing) accumulated one entry per session ever observed.

The per-session epoch only qualifies its lastSeenSeq cursor, so the
snapshot_required path now drops both together; the re-resumed
session's next live frame re-establishes them. The process-epoch reset
already keyed its "keep canonical cursors" rule on this map, which is
unchanged for sessions that still hold a cursor.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:48 -07:00
Teknium
c705fdf7ed fix(desktop): declare the ws dev dependency the wire tests import
Ten Desktop vitest files (canonical-protocol-wire, canonical-attach-
snapshot, discard-lost-prompt, source-backend, ...) start a real
WebSocketServer from `ws`, but apps/desktop never declared it: the
package resolved only because ink pulls ws in as an optional peer,
hoisted to the root (lock entry `peer: true`). An install that skips
that peer, or a future ink release that drops it, breaks those suites.

ws@8.21.1 (the version already locked) is now an exact devDependency of
apps/desktop. The lock change is the minimal one: the workspace's
devDependencies gain `ws` and the hoisted entry is no longer marked
peer-only. No new package is downloaded. (`npm install
--package-lock-only` with npm 10.9.8 also rewrites ~160 unrelated
dev/peer flags that drift identically on r6-base; those are left
alone.)

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:48 -07:00
Teknium
7b9eab388c fix(desktop): drop the retired pool's settings ids from the i18n gap ledger
The Desktop backend pool and its settings (settings.poolLimits.*) were
removed with the single-gateway cutover, but overlay-gaps.json still
listed four of its keys as known untranslated gaps for ar/ja/ru. The
ledger only shrinks when a key is translated, so a deleted English key
lingers forever as a phantom gap.

The four ids are pruned (OVERLAY_GAPS_UPDATE=1 regeneration; no other
entry changed), and overlay-completeness now also asserts the ledger
names no key the English catalog lacks.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:47 -07:00
Teknium
af8fa8040d fix(desktop): Delete on a server-queued card cancels its admission
Every queue card offers Delete, but it only called the local
removeQueuedPrompt, which deliberately refuses server-owned rows
(admissions in the authority's FIFO). Clicking Delete on a queued
admission did nothing: no prompt.cancel was sent, the card stayed, and
the turn still ran when its turn came.

Delete on a server-owned row now goes to the authority through the
session's owner socket (the same requestForOwnedSession routing Discard
uses): `prompt.cancel` for a queued admission, and the existing
`prompt.resolve_unknown` acknowledgement for a lost `unknown` turn. The
authority's pending fanout retires the card; an admission that started
in the meantime is refused and keeps running, with the refusal shown as
a notification (new composer.queueCancelFailed key in every locale,
locales/_keys.desktop.json regenerated). Local rows keep the local
removal.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:47 -07:00
Teknium
02036db5ed fix(desktop): pending-submission tracking never drops another window's entry
Every tracked direct submission and observed server receipt lived in
one localStorage blob that each call read, modified and rewrote whole.
Desktop windows of an origin share that storage last-writer-wins per
key, so two windows tracking a submission at about the same time kept
only the later blob: the other window's entry (and the display text
its queued card shows, e.g. the typed /command for an expanded skill)
was silently lost.

Entries now live under one key per (session, admission) — v2 — so a
write touches only the record it owns; reconcile diffs before/after and
writes or removes only the changed entries. The v1 blob is still read,
and a session's slice is migrated into v2 keys and dropped from it the
first time that session reconciles. Two existing tests that read the
raw v1 blob now read through readPendingSubmissions; their assertions
are unchanged.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:46 -07:00
Teknium
90dc3112a3 fix(desktop): a stale queue snapshot never repaints a started or retired admission
reconcilePendingSubmissions overwrote the composer queue projection with
whatever pending snapshot arrived last. Snapshots reach the renderer out
of order (a session.resume result racing the live session.info fanout, a
replayed info event), so a stale `queued` row arriving after `started`
repainted the card, and one arriving after the row left the pending set
(terminal) resurrected a card for work that had already run.

Each admission now only moves forward: queued < started < unknown
(owner restart) < retired. The per-session receipt journal keeps the
strongest status observed; a receipt weaker than it is ignored both for
the projection and for the journal. An admission that leaves the
pending set is kept as a text-less `retired` tombstone (newest 200 per
session) instead of being forgotten, so a late snapshot still listing
it is recognised as stale.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:46 -07:00
Teknium
dcdfacc0e3 fix(desktop): park a secondary whose local gateway ensure refuses permanently
104b4684/f7559466 stopped main from re-ensuring past an unsafe control
path, but the renderer's secondary reconnect ladder still classified
every other permanent ensure refusal as transient: an `incompatible`
verdict, an ensure client that produced no result (old `hermes` without
the protocol, missing profile), an invalid endpoint, or an unsafe path.
dialPoolBackend forgets the failed descriptor, so each backoff tick
spawned another `hermes gateway ensure` against the same install,
forever (probe: 60 getConnectionFor calls in 400 s of virtual time).

reconnectSecondary now parks such a scope at once (wantOpen=false, entry
kept), matched on the stable message heads main throws, through the
ipcRenderer.invoke wrapper. Any explicit open, focus/wake nudge or
Reconnect re-arms it after the user's repair, exactly like a
stall-parked scope. The primary is unaffected: main already latches a
local boot failure (backendStartFailure), so its redial never respawns.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:46 -07:00
Teknium
f9c83ffb9c fix(desktop): the ensure client outlives the gateway's own startup deadline
runGatewayEnsure killed `hermes gateway ensure` at 40 s, but the CLI's
startup deadline is 60 s (`--timeout` default, DEFAULT_ENSURE_TIMEOUT in
hermes_cli/gateway_runtime.py) and it always prints a protocol verdict by
then. A cold start that answered between 40 s and 60 s was killed, its
empty stdout parsed as "produced no result (exit 7) ... Update Hermes",
and the user was told to upgrade a healthy install.

The default client bound is now the 60 s protocol deadline plus a 15 s
grace for interpreter start and verdict output. Explicit callers
(restart: 120 s) are unchanged.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:45 -07:00
Teknium
3edb6e3e9e fix(desktop): a corrupt prepared-submission journal no longer blocks every send
The native per-origin journal threw the raw SyntaxError from JSON.parse
on a truncated or garbled file. Every send must journal before
prompt.submit, and update() reads first, so one bad file refused every
later send from that origin until the user found and deleted it.

read() now quarantines an unparsable or non-object journal: the file is
renamed to <name>.corrupt-<ms> with its bytes intact and an empty
journal is returned, so the next update writes a fresh file. ENOENT
stays empty and other I/O errors still throw. The lost entries were only
ever recoverable through an explicit user retry, never an automatic
replay.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:45 -07:00
Teknium
f2795ac8c5 fix(desktop): an admitted submission's spent identity survives a reload
The prepared-submission journal marked an admitted entry spent only in
module memory before removing it. When the removal failed after the
gateway's ACK (ENOSPC/EIO, swallowed so the delivered prompt is not
reported failed), a renderer reload dropped that mark and the stale file
entry became adoptable again: a later identical send reused the spent
submission_id and frozen payload, and terminal dedup acknowledged it as
if it were new.

removePreparedSubmission now takes the admitted id and writes a durable
tombstone (journal key -> spent id, separate localStorage key) BEFORE
attempting the journal removal. Every journal read hides an entry whose
id matches its tombstone, retries the removal, and clears the tombstone
once the entry is gone; a newer send under the same key carries a fresh
id and is never hidden. In-memory marks remain only as a fallback when
the tombstone write itself fails.

The existing prepared-submissions.test.ts calls are updated for the new
(key, id) signature only; their assertions are unchanged.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:44 -07:00
Teknium
cc7981a817 fix: a voice-origin busy correction consumes the TUI voice marker
submitParams only called takeVoiceTurn for non-control items, so when a
voice transcript arrived mid-turn and went out as session.redirect /
session.steer (the default busy path on the canonical gateway), the
marker stayed armed and the next identical typed prompt was submitted with
`voice_turn: true`, taking the auxiliary voice route. Reproduced at the
submission level on r6-base: redirect (no voice flag) followed by a typed
"hello" carrying voice_turn:true.

submitPrompt now takes the marker once at input ownership (its first
statement), whatever control method or early return follows; only a
prompt.submit whose text equals the marked transcript carries voice_turn.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5458083694
2026-10-08 19:09:44 -07:00
Teknium
3187905d07 fix: explicit TUI attach negotiates the canonical wire when the endpoint has an authority
HERMES_TUI_GATEWAY_URL attach returned before the canonical adapter:
isCanonical stayed false, runtime.describe was never read, and Ink sent the
legacy session.create {cols, model} without `source: tui`. A gateway-hosted
dashboard's /api/ws is authority-backed, so that create is refused. Live
probe (real gateway, fake HOME, real Ink GatewayClient with an explicit
URL): session.create -> invalid_params (fields: ['cols']).

The WS listener's ready frame now advertises `session_authority: true`
when the connection is bound to a session authority (contract + generated
TS/OpenRPC updated). On that frame the client switches the connection to
the canonical adapter exactly like a local grant: runtime.describe, then a
single client-local gateway.ready that keeps the listener's skin, and every
request goes through canonicalRequest/canonicalResult. Endpoints without an
authority (standalone dashboard / serve) advertise nothing and keep the
legacy wire. Each explicit connection renegotiates on reconnect. Probe
after: canonical=true, session.create -> a `tui`-source session.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:43 -07:00
Teknium
2841c85e67 fix: canonical TUI honours the hermes --tui -v / -Q tool-progress launch pin
`main_tui_launch` exports HERMES_TUI_TOOL_PROGRESS (verbose for -v, off for
-Q) and the in-process owner read it, but the canonical client never sent
it: localCreationOptions has no tool_progress and the authority's
session.create contract has no such field, so the session ran at `all`.
Live probe (real gateway, fake HOME, real GatewayClient):
HERMES_TUI_TOOL_PROGRESS=verbose -> config.get key=verbose -> "all".

The owner already carries this exact setting as the session-scoped
tool-progress mode (`config.set key=verbose`, what /verbose writes; read by
TurnRunner and the managed-worker tool bridge). GatewayClient now applies
the validated pin to a fresh session.create before resolving it, so the
first turn already renders with it; a refused pin fails the create visibly
and an unreadable value refuses the launch instead of being dropped.
Probe after: "verbose". This also makes the classic CLI's `--verbose`
redirect (`hermes chat --tui -v`) a command that does what it says.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:43 -07:00
Teknium
21bd24e2c1 fix: TUI reconnect re-ensures a crashed gateway owner, never a stopped one
After the first launch every Ink bootstrap was discover-only (the
`localStarted` latch), so when an unmanaged owner died (SIGKILL, OOM) the
TUI looped "gateway absent" forever; the pre-cutover client respawned its
owner. Live probe on a fake HOME: ensure -> SIGKILL owner -> discover-only
bootstrap exits "gateway absent: not ready" on every reconnect.

The reconnect now asks `gateway_bootstrap.py --recover`, which re-ensures
only when discovery says `absent` AND the owner's retained
gateway_state.json still claims a live state (running/starting/draining/
degraded) with no `desired_state: stopped`. `hermes gateway stop` and
planned stops persist `stopped`, so an explicit stop is never resurrected
(probe: stop -> --recover -> still absent, no pid file). The client grants
at most 3 recover attempts per 60 s, so a crash-looping owner is not
respawned forever; further reconnects stay discovery-only.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5460639040
2026-10-08 19:09:42 -07:00
Teknium
49771f7b2e fix: keep a retained --tui -w worktree while its session is resumable
C1's fix stops the TUI from deleting the -w checkout on exit, but the tree's
only lock is `hermes pid=<launcher pid>`, which is dead once the TUI exits.
A later launch's 24 h stale prune (_setup_tui_worktree ->
_prune_stale_worktrees) then reads the lock as dead, unlocks and removes a
clean merged tree even though the session's frozen cwd still points at it
(restore_policy refuses a missing cwd, so the resume breaks). Probe on
r6-base driving the real _launch_tui exit path + a real git repo/SessionDB:
tree reaped with a resumable session.

On exit the launcher now re-locks a retained tree as
`hermes session=<stored id> db=<state.db>`, using the session Ink wrote to
the active-session file. _worktree_lock_is_live (shared by the startup
prune and `hermes worktree prune`) treats that lock as live while the row
has messages or non-terminal admissions (read-only open; unreadable store
fails safe toward live) and dead once the session is gone or empty, so
clean trees with no resumable session are still pruned as before.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5462648005
2026-10-08 19:09:42 -07:00