Commit Graph

894 Commits

Author SHA1 Message Date
Teknium
b1ccce898b Merge origin/main (#38: 70 commits to c57331677d) into feat/unified-gateway-runtime
Conflicts: tests/hermes_cli/test_finite_chat_delegation.py and
tests/tools/test_completed_process_results.py, where main's lint sweep (0006a5e229) added
check=False to subprocess.run calls this branch had rewritten. Kept the branch's test bodies
and carried check=False onto their subprocess.run calls.
2026-10-10 17:47:35 -07:00
Teknium
27ca2a21f3 docs: official plugin links point at hermes-official-plugins
Home Assistant and Spotify moved into the NousResearch/hermes-official-plugins
monorepo (#136304).
2026-10-10 16:25:45 -07:00
Teknium
5d2f94b92c Merge origin/main (#37: 15 commits to 1f711b275f) into feat/unified-gateway-runtime
No conflicts. Brings in #136276 (update e2e sandboxes pinned to the main channel; the
source hand-off fixture installs its loopback transport once).
2026-10-10 14:30:21 -07:00
teknium1
84a244e6d6 docs(plugin-catalog): rule 11 — credentials come through Hermes, never from files
Plugins read declared secrets with agent.secret_scope.get_secret and use a
subscription sign-in only through credentialed_provider_request
(requires_auth), so Hermes attaches the token. They never read .env,
Hermes's auth.json, another tool's login or any credential store directly,
and never refresh, rotate or write OAuth tokens. Missing route = ask Hermes
for one. The plugin developer guide's own examples switch from os.environ to
get_secret to match.
2026-10-10 13:26:51 -07:00
Teknium
4070f011a2 feat(plugins): core-made Codex requests so plugins never hold the token
Plugins that need the user's ChatGPT/Codex subscription (hermes-live-voice mints
an OpenAI Realtime client secret) vendored their own reader + refresher for
~/.codex/auth.json. Codex refresh tokens are single-use, so that second refresher
races Hermes's locked refresh and can revoke the user's whole token family.

hermes_cli.plugin_provider_requests.credentialed_provider_request() lets core make
the request instead: it resolves the credential through
resolve_codex_runtime_credentials (Hermes's locked refresh, profile-scoped),
attaches Authorization itself, sends only to chatgpt.com / api.openai.com, never
follows redirects, and returns status/headers/body. Callers are attributed by the
plugin directory on the call stack and must declare `requires_auth: [openai-codex]`
in plugin.yaml; the declaration shows at install, in `hermes plugins show`, and a
catalog re-pin that adds it asks for consent. A plain importable function so
dashboard plugin_api.py modules can use it.
2026-10-10 10:43:32 -07:00
Teknium
837f50b3da Merge origin/main (#36: 11 commits to a62979dc36) into feat/unified-gateway-runtime
One conflict: agent/context_compressor.py imports. Main's a62979dc36 dropped the
now-unused _safe_int import; the branch's retryable_user_text import is kept.
2026-10-10 08:36:16 -07:00
kshitijk4poor
a62979dc36 fix(compression): a refused candidate's attempt record claims no effect
Review thread on #136050 (agent/context_compressor_telemetry.py, "Refusals
report unsaved effects"). The compressor records a candidate's effect
fields before the commit checks run. When the growth guard refused the
candidate, or a database failure rolled the transcript back, the aborted
record still reported its `messages_after`, `tokens_after`,
`tokens_reclaimed` and `items_dropped`. That claimed reclaimed tokens for a
conversation that stayed unchanged.

Drop those fields from any record that neither committed nor rewrote the
history. The input-side counts stay.
2026-10-10 20:18:10 +05:30
kshitijk4poor
760c93fef7 fix(shared-metrics): count an empty-transcript refusal under its own class
#135807 makes the empty-transcript refusal emit its attempt record through
the shared-metric lifecycle (on main that exit recorded nothing), but
`empty_transcript` was not in the closed `COMPRESSION_FAILURE_CLASSES` set,
so the `hermes.compression.count` row read `failed / other`. Add the class
to the contract, the v4 package schema enum and the metric docs so the row
says what happened.
2026-10-10 20:18:10 +05:30
mnajafian-nv
0a81c37ed0 fix(shared-metrics): keep a committed fallback's class on hermes.compression
finish_compression_attempt reported every committed attempt as
outcome=success with failure_class=none, so the metric could not tell a
clean summary from a commit that went through a fallback: a
deterministic summary (summary model failed, pre-LLM feasibility skip,
repeated stall, sustained overload) or the main model writing the
summary after a separate summary model failed.

A committed attempt still reads success (it did commit and break the
prompt cache), but now keeps the attempt log's own class when it has
one: summary_generation_failed, feasibility_skip,
stall_deterministic_fallback, summary_overload_degraded or
aux_model_fallback. summary_model_benched, the deterministic commit after
the summary model is benched for repeated fallbacks, maps to
feasibility_skip, which is the pre-LLM skip it is. Any other class reads
other.

No new enum values, so the v4 package schema is unchanged and a fallback
row still validates. Consumers that read failure_class != none as a
failure must now also check outcome: on a success row it means
"committed with a fallback".

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
2026-10-10 20:18:10 +05:30
Teknium
cfaafec502 Merge origin/main (#35: 133 commits to f925b01791) into feat/unified-gateway-runtime
Three conflicts:
- apps/desktop/electron/updater/checkout-source.test.ts: main's 354fe11d7e is the
  same releases/latest fixture fix this branch carried as c300c295c1 (#135944); main's
  version (it also drops the unused release-candidates route) is taken.
- agent/context_compressor.py: both sides added one import line; both kept.
- gateway/run_turn.py: main's 4c7ab8b2a0 added trigger="gateway_hygiene" to the hygiene
  _compress_context call this branch moved to gateway/run_turn_hygiene.py; the branch side
  of run_turn.py is kept and the trigger is carried onto the moved call.
2026-10-10 06:49:02 -07:00
Teknium
9a13c5e5e1 fix(tui): refuse shared-gateway setting writes by name instead of a bare invalid_params
On the shared owner the canonical `config.set` accepts only busy / verbose / yolo / model, so
Ink `/theme <v>`, `/skin <v>`, `/indicator <v>`, `/reasoning <v>`, `/fast <v>` and
`/personality <v>` each answered a bare `invalid_params`, while the generated parity table
listed them as working (`config.get, config.set`). Premise probe on a real authority: every
read answers (`theme auto`, `skin default`, `reasoning medium`...), every write
`{code: 4001, invalid_params, fields: [key]}`.

These are config.yaml / per-session settings with no frozen-policy owner verb yet (the parity
table's "port: per-session setting"), so the fix is the honest refusal the other canonical
commands already give: the bare form still reads the current value; a change prints
"/x is not available on the shared gateway yet" and sends nothing. The parity generator names
a refused client block as such (its served `.get` read kept) instead of "config.set".

Test: canonicalSlashCommands "setting writes ..." red on r10-base session.ts (`config.set`
sent), green after.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5475590057
2026-10-10 05:52:03 -07:00
Teknium
8a444a32ac fix(tui): keep process-global sidecar verbs off the shared owner; scope Ink /stop to its session
Ink /stop sent a sessionless `process.stop`; the authority answered -32601 and the legacy
fallback ran `process_registry.kill_all(source="process.stop")` on the shared owner, killing
every chat's, Desktop window's and served profile's background processes, persisted jobs
included. `/agents pause` (global spawn gate), `/reload-mcp` (every MCP server), `/reload`
(rewrites os.environ from the launch .env) and `agents.list` (every chat's commands) reached
the same process-global handlers.

- tui_gateway/ws_legacy_fallback.py: `process.stop`, `delegation.pause`, `reload.mcp`,
  `reload.env` and `agents.list` never fall back from an authority connection; the client keeps
  the authority's answer. `process.kill` keeps its fallback: that handler is session-scoped.
- gateway/session_ancillary.py: the owner serves `process.stop` itself under session:control,
  stopping exactly the processes `process.list` projects for the session (routing key + owner
  among session/agent/subagents), persisted ones of THIS session included (explicit stop).
  Managed workers answer unsupported_projection like the reads.
- Ink: /stop sends its session id and, when a turn is running on the shared gateway, interrupts
  it first (registry busy policy interrupt_then_dispatch, as classic and Desktop do);
  /agents pause|resume, the overlay's pause toggle, /reload-mcp and /reload say "not available
  on the shared gateway yet" instead of a version-skew error.
- The parity generator reports a client-side canonical refusal as refused (it called /bg, /btw,
  /save "canonical route"); table and gateway contracts regenerated.

Test: tests/gateway/test_session_process_scope.py drives a real authority over an authenticated
WS with four real child processes: red on r10-base ({'killed': 4}, all exited), green after.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5475590057
2026-10-10 05:52:02 -07:00
mnajafian-nv
b4d7711480 docs(relay): document the summarizer fields as free-form identifiers
summarizer_provider and summarizer_model carry the resolved summary provider
and model ids as they are, but the module docstring and the docs said every
categorical field comes from a closed set, and the field table did not list
them. A consumer reading that contract would treat them as bounded labels.
List both in the field table as free-form and narrow the closed-set claim to
the other categorical fields.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit ce2020dbf354785d47c3002f431afe60c1046fa3)
2026-10-10 04:27:27 -07:00
mnajafian-nv
814cde892a fix(relay): mark a micro-compaction in a rotated child on the turn it ran in
The micro-compaction publisher resolved its Relay parent from the
compressor's current session only. After a rotating compaction earlier in
the turn that session is a child with no Relay scope, so the pass the
finalizer runs before the turn ends lost its mark, while the attempt, prune
and provider-native publishers already fall back to the session the turn
started in.

The finalizer now passes that session to the pass, and its mark takes the
same fallback.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 3519c942fad6ba2dce3b4475ca7ff56a02c7410f)
2026-10-10 04:27:27 -07:00
mnajafian-nv
f0afd34a9d fix(relay): keep the empty_transcript class on its attempt mark
The attempt record now logs empty_transcript when a context engine returns no
messages, but the hermes.compaction failure_class set did not list it, so the
compaction.attempt mark read failure_class: other and lost the reason. Add it
to the attempt-only classes and the documented set.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 0bdf840844f35e95361ae89edcb1264d2767663c)
2026-10-10 04:27:27 -07:00
mnajafian-nv
8810cf24b2 fix(relay): record why an overflow compaction ran in overflow_reason
overflow_reason is a v1 field, but it was always null: both overflow
callers passed only trigger="overflow", although each already holds the
error classifier's verdict for the provider rejection it recovers from.
A consumer could not tell a 413 from a context-length rejection or the
Anthropic long-context tier gate.

Both callers now pass the classified reason through _compress_context
into the attempt seed, so the attempt log line and the compaction mark
carry it. The mark keeps it in a closed set (context_overflow,
payload_too_large, long_context_tier, else other) and leaves it null for
every other trigger. The Relay docs list the set instead of calling the
field reserved.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit c3ad6f7fb8bfcc8f9c350f3a4272029d63333c7f)
2026-10-10 04:27:27 -07:00
mnajafian-nv
0edc904913 fix(relay): mark a second rotating compaction on the turn it ran in
With compression.in_place: false every commit moves the agent to a
child session, and that child has no Relay scope until a Relay-managed
LLM call or the next turn opens one. A multi-pass preflight rotates
twice before any LLM call, so the second attempt's record named a
session with neither a live turn nor a session scope, and its mark was
dropped at DEBUG.

The publisher now passes the session the agent's turn started in
(_inflight_turn_session_id, which the turn start already records because
compression can rotate mid-turn). _resolve_target keeps the same session's
live turn and then its session scope first; only when both are missing
does it fall back to that turn, and only while it is the live,
instrumented turn of that session. A child that already has a scope
keeps the mark there, because that scope owns the child's next LLM
starts and so must receive the freshness reset. The record's session_id
still names the child.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit af5c1c9bfde91105e88535a9235ceca6bd662887)
2026-10-10 04:27:27 -07:00
mnajafian-nv
eaaf948965 docs(relay): list the gateway reset after compression exhaustion as unmarked
The Compaction Marks section lists the history and request rewrites
that emit no hermes.compaction mark, but missed one: when a gateway turn
ends with compression_exhausted, the gateway replaces the session with a
new, empty one through reset_session (gateway/run_turn.py,
_hmwa_compression_exhaustion_reset) instead of compacting it. Nothing
on that path calls compress_context or the other mark emitters, so
readers should not expect a mark for the reset.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit ded1094b77585eb9b4af910881cc98226de7f809)
2026-10-10 04:27:27 -07:00
mnajafian-nv
2159dc3e78 fix(relay): align the hermes.compaction v1 contract with what Hermes emits
Review of the first cut of the marks found four places where the record
said something the attempt did not:

- A split that failed after it had stored the compacted history
  (failed_not_indexed without a rollback) returns the compacted
  transcript, so the model sees it next, but the record read
  aborted/failed and was named compaction.attempt. Relay then never
  reset freshness and the compacted history was never recorded. The
  commit path now logs history_rewritten (whether the returned
  transcript replaced the input), and such a record is a committed
  compaction with failure_class session_split_failed and split_status
  failed_not_indexed.
- in_place and session_rotated read false/false on a commit without a
  session database. They are now set only when split_status is
  in_place_committed or rotated_committed, and null otherwise.
- trigger_class read auto for a record with no trigger or an unlisted
  one. It now reads unknown there; an unlabelled automatic caller
  (trigger_source auto) keeps trigger unknown with trigger_class auto.
- The v1 sets listed values Hermes never emits (kind request_truncation
  and window_reduction, scope request, trigger recovery, outcome noop,
  token_count_method provider_usage, split_status pending and unknown).
  Consumers treated them as live. They are dropped from the v1 sets and
  documented as reserved for later versions.

session_ownership_unreadable joins the attempt-only failure classes.

The Compaction Marks docs now list the four sources exactly, what does
not emit a mark yet (OpenAI Responses native compaction and its
pre-checkpoint pruning, image shrinking after a provider rejection,
request-only truncation), the closed sets and null policy, why a Codex
app-server compaction keeps the compaction name (Relay records no LLM
start for those turns, so the freshness reset only affects a later
Hermes-side call) and is never marked twice, and two known gaps around
rotating compactions.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 6e6bc81fc0e074c88d1d632e8110d7490e203015)
2026-10-10 04:27:27 -07:00
mnajafian-nv
a64501e60c feat(relay): emit compaction marks from the compression attempt record
Hermes rewrites a session's history in several ways (batch summary,
deterministic fallback, micro-compaction, proactive tool-result prune,
Codex thread compaction) but never told Relay about any of them. A Relay
consumer could not see what was compacted, why, when, how long it took
or whether it went through compress_context, and Relay never reset
LLM-history freshness after a rewrite, so LLM starts after a compaction
stayed projected to the current user turn.

agent/compaction_events.py builds one flat, content-free
hermes.compaction v1 record per rewrite with closed enums (kind, scope,
official, method, trigger, trigger_class, outcome, failure_class) and an
other fallback, plus the effect counts and timings the attempt record
already carries. agent/relay_compaction.py emits it with the existing
scope.event API on the owning session's scope stack: under the live turn
of the same session, else under the session scope, else not at all.

A committed history or provider rewrite uses Relay's reserved
compaction mark name, which resets freshness for the session's agent
scope; every other outcome is a compaction.attempt mark. Records come
from the single attempt telemetry seam (so blocked, Codex-routed and
aborted attempts are covered), the micro-compaction telemetry record,
the proactive prune commit and Codex-native compactions Hermes observes.
No payload carries message, summary, focus-topic, error or path text,
and publishing never raises into compaction.

The marks are on whenever the Relay runtime is live; Relay exporters are
configured separately, so this adds no outbound path and no config key.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit dc5fd0875e7ec895b7826ee829bfc1b7f082de97)
2026-10-10 04:27:27 -07:00
mnajafian-nv
43fda4b388 fix(compression): report committed effects without leaking metric state
Finalize effect counts from the transcript that crosses the commit boundary, including retained partial-compression tails and boundary anchors. Explicitly discard bypassed shared-metric state so a later refusal cannot consume stale attempt metadata.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit ddf3b229a9e2fdee651f36afbec974717d334f76)
2026-10-10 04:27:27 -07:00
mnajafian-nv
7ae7fac09c fix(compression): log one attempt record when an engine returns an empty transcript
The candidate guard refused an empty transcript from a context engine and
returned without an attempt record, so that compress_context call logged
nothing and the shared metric never counted it. Every other refusal in the
guard logs its own class.

Log it as an aborted attempt with failure_class empty_transcript; the shared
metric counts it once as failed under its closed-set "other" class.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 3f6a58fb3f2695a58d67fedb9f7410abff95ad58)
2026-10-10 04:27:27 -07:00
mnajafian-nv
c3af207f28 fix(compression): keep a late-unwinding attempt's own id, session and trigger
The attempt record read its identity from the agent's current-attempt fields,
which the next attempt overwrites when it begins. A stalled attempt that
unwound after its stall fallback had started therefore logged the fallback's
attempt_id, session_id and trigger_source, so two records claimed one attempt
and the stalled one disappeared.

Each attempt now carries its own seed on _Attempt and passes it to every
emit, so the record always describes the attempt that wrote it. Emits with no
attempt in hand (pool saturation) keep reading the agent's copy.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit a36db44d63888406702cab44d3ca29335727a6e2)
2026-10-10 04:27:27 -07:00
mnajafian-nv
490f4e4397 fix(compression): tell an unreadable session-ownership lookup from a lost one
_adopt_if_parent_rotated returns the same sit-out result for two
different exits: the lease found the parent already rotated by another
path (ownership lost), and the ownership lookup itself raised
("skipping compression this cycle", ownership unknown). Both were logged
as session_ownership_lost.

Each exit now writes its own record from inside the helper: a rotated
parent is skipped / session_ownership_lost, and a failed lookup is
aborted / session_ownership_unreadable, the same shape as the existing
cooldown_state_unreadable exit. Both records name the session the
attempt started in, not the child an adoption switched the agent to.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 83dfe1eaf6e630198734a65d8c13a26945ff43d9)
2026-10-10 04:27:27 -07:00
mnajafian-nv
4280f8b00e fix(compression): describe an aborted attempt from its own seed
An attempt record that is written before compress() seeds this
attempt's telemetry, or after a pre-commit restore, did not describe
that attempt:

- snapshot_stale and the early commit_fence_cancelled exit run after the
  attempt-start clear, so the record had no trigger_source;
- a commit fence refused after the summary restores the compressor's
  pre-attempt state, which puts the previous attempt's dict back, so the
  record carried the previous attempt_id, trigger, method and reclaimed
  tokens with this attempt's failure class;
- pool_saturated fires before any attempt begins, but still took the
  previous attempt_id from the agent.

_begin_compression_attempt now keeps the attempt seed (attempt_id, the
session the attempt started in, trigger) on the agent as well, since a
restore replaces the compressor's copy. When the compressor's telemetry
is not this attempt's own, the emitter starts the record from that seed
with method none and no token counts, and ignores the compressor's
fallback flags, which belong to the same earlier attempt. A refusal with
no attempt begun gets a fresh id and trigger unknown. Bypassed exits read
the same seed, so they also name the session the attempt started in
rather than a child it adopted.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit c29dba73a4c07c833951666f517a237e1e0fc65d)
2026-10-10 04:27:27 -07:00
mnajafian-nv
4c7ab8b2a0 fix(compression): name the automatic trigger and effect in attempt telemetry
The content-free attempt record is the one place that says why a
compaction ran and what it did, but it could not answer either question:

- Every automatic caller passed no trigger, so idle, turn-start
  threshold, engine preflight, pre-API, post-tool and gateway hygiene
  attempts all logged trigger_source=auto. Each call site now passes its
  own label; the shared metric still buckets them as auto.
- tokens after, message counts and how the summary was made were
  computed and logged as prose but never reached the record. A finished
  rewrite now records messages_before/after, tokens_before/after,
  tokens_reclaimed (signed; a summary can grow a short transcript),
  token_count_method=estimate_rough, method (llm_summary,
  aux_fallback_main, deterministic_fallback), items_dropped, and the
  tool_results_pruned / reasoning_items_pruned pass counts.
- Attempts that never reached the local compressor returned silently:
  the automatic breaker gate (before and under the lease), every Codex
  app-server exit, a lease that found the session already rotated, and
  an unreadable durable cooldown. Each now logs one record with a
  commit_status (blocked, skipped, failed, aborted, committed), a route,
  and a class such as blocked:cooldown. These stay out of shared metrics,
  which never counted them.

Test doubles for _compress_context gain the trigger keyword the call
sites now pass.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
(cherry picked from commit 1795993d1a01d91dd76e6ec824cb606f8a03b897)
2026-10-10 04:27:27 -07:00
Teknium
5ba559c9e4 fix(relay): keep migrated Relay configs off 0.10's OTLP auto-export
Relay 0.10 starts gen_ai trace/log/metric export on its own whenever an
active configuration meets an OTEL_EXPORTER_OTLP_* endpoint in the process
environment, and those spans carry prompt and response messages. The
legacy HERMES_NEMO_RELAY_ATIF/ATOF variables never exported OTLP, so the
generated relay-plugins.toml now pins opentelemetry.enabled = false.

Also restore the discovery-only test's DISABLED-state assertions: they
pass on 0.10 and only trip on a host with a machine plugins.toml.
2026-10-09 19:58:29 -07:00
mnajafian-nv
9280fef70c chore(relay): tighten 0.10 upgrade validation
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
2026-10-09 19:58:29 -07:00
mnajafian-nv
6caac042b1 chore(relay): upgrade to 0.10.0
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
2026-10-09 19:58:29 -07:00
Teknium
097fcaa1de fix(skills): every turn announces skill changes once, on every surface
#118661's note only fired on the stored-prompt restore path, which a long-lived agent (classic
CLI, TUI, Desktop) runs once per conversation: those surfaces never saw a mid-conversation skill
change. The check now runs from build_turn_context every turn against the prompt the turn
actually sends.

- What was told is kept on the agent for its prompt; a fresh agent (gateway, -q --resume) reads
  the newest note back from the WHOLE transcript instead of the last 200 rows, so a long session
  no longer re-announces an unchanged delta (review by @kvnloo).
- A compaction rebuild that now lists the announced skills stays quiet.
- Index rows split on ": ", so qualified plugin skills (plugin:skill) parse.
- The plugin go-live note drops its own skills list: the per-turn note covers plugin skills like
  any other, so a plugin install no longer announces its skills twice.
2026-10-09 19:31:10 -07:00
teknium1
ec78ae2211 feat(prompt): skills installed mid-session reach the model without a prompt rebuild (port cloudflare/cloudflare-os#267)
The persisted <available_skills> index is reused byte-for-byte across turns so
the provider prefix cache stays warm (#104414). A skill that lands after the
prompt was built (hub install, skill_manage from another session, org sync,
curator) therefore never reached the index the model actually routes on until
compaction rebuilt the prompt: skills_list is live, but the prompt tells the
model to scan the index, not to call it. cloudflare-os#267 found the same fault
in their chat-cached catalog ("a catalog states what a session can reach now,
which is not a fact a chat can hold").

Hermes' idiom for stored-prompt drift is a one-shot note behind the cached
prefix, not a rebuild, so agent/skills_index_delta.py stages the delta on the
same per-turn user-message channel the surface-switch note rides: the added
skills' own index lines (name + description, the routing signal), the removed
names, cumulative against the stored prompt and re-staged only when the delta
changes (read back from the api_content sidecar, so the gateway's fresh agent
per turn does not stack copies). An undone delta retires the stale note once.
The current index comes from the same cached builder the prompt did, so an
unchanged turn costs one LRU hit.
2026-10-09 19:31:10 -07:00
Teknium
4e7fbad8fe Merge origin/main (#34: 43 commits to 3eb7ed08d1) into feat/unified-gateway-runtime
Two conflicts:
- tui_gateway/server.py: main's a274d3388f (#135781) quoted the two _TurnScopes
  annotations in code this branch already moved and quoted; the branch side is kept.
- website/docs/developer-guide/relay-shared-metrics.md: main added channel_unresolved's
  config note, gateway_pause_failed and the blobless-preflight sentence to the
  hermes.update.run failure-class row; the branch's downgrade_refused entry is spliced
  into main's row after commit_point_refused.
2026-10-09 18:41:50 -07:00
Teknium
87b5e05620 docs(skills): note inline-shell scoping for nested, external_dirs and unreadable-lock cases 2026-10-09 18:18:41 -07:00
Teknium
96ab1749a4 docs(gateway): one-shot stdout is the reply plus the resume block, and exit 3 covers a crash-lost turn
gateway-classic-cli.md said "One-shot stdout contains only the final reply". A live
`hermes chat -q` on r9-base (fake HOME, loopback model) prints the reply followed by
main's `Resume this session with: hermes --resume <id>` block, and a `--resume <id> -q`
first replays the stored history; only `-Q` prints the reply alone. The section's own
Launch options paragraph already documents the resume block, so the two lines contradicted
each other. Exit 3 is also what `--resume <id> -q` returns after a gateway crash mid-turn
(live kill -9 probe), and the doc now names `hermes sessions discard <id> --yes` there.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5470880976
(cherry picked from commit 17c6c67c627d0e76cc676889f2d4dda957196810)
2026-10-09 17:31:26 -07:00
Teknium
46d7718a52 docs(telemetry): v4 takes additive values in place after its stable release
Owner ruling for gateway_pause_failed: extend package schema v4 in place
(additive only; ingest validates the envelope and every shape already sent
stays valid) instead of bumping to v5. The two sentences that said v4 was
extended only while canary-only now say so.
2026-10-09 14:36:08 -07:00
Teknium
f549ce3fbd fix(update): drop config_unreadable: an unreadable config.yaml also hides consent, so no row is ever sent
The exit is real (RuntimeError from require_readable_config_before_write), but the consent gate
reads the same config.yaml and reads it as collection off: a live run on a scratch install with
an unparseable config.yaml wrote no metrics store at all. A closed value nothing can emit only
widens the contract.
2026-10-09 14:36:08 -07:00
Teknium
2379b2e2eb fix(update): pre-apply exits that read exception/subprocess_failed name their reason
hermes.update.run rows with apply_mode=unknown still had three exits with no stop_class on main:

- The startup-syntax preflight (update_cmd_commit.read_target_files) runs `git cat-file --batch`
  under a 120 s limit. On a blobless install (install.sh clones --filter=blob:none) every changed
  blob lazily fetches in its own round trip, so a slow link times out and the uncaught
  TimeoutExpired ended the whole update as `subprocess_failed` after 2+ minutes (31 CLI + 23
  Desktop install-days). An unread batch now counts as unread files, which is the preflight's
  documented contract; the post-move syntax check stays the backstop.
- An unreadable/unparseable config.yaml (require_readable_config_before_write RuntimeError) or an
  invalid configured channel name (ChannelError) while picking the channel read `exception`. They
  now record `config_unreadable` (new) / `channel_unresolved`.
- A failed Windows gateway pause (_abort_on_error / ServicePauseFailed RuntimeError) read
  `exception`; it now records `gateway_pause_failed` (new).

Two closed UPDATE_STOP_CLASSES values, the v4 schema enum and the relay-shared-metrics doc row
change together; every legacy value stays valid.
2026-10-09 14:36:08 -07:00
Teknium
b1bba19558 fix(telemetry): the Windows hand-off's relaunched update child also reads its own claim as failed
On Windows the hand-off names the process it created as the marker's delegate, and
hermes_bootstrap's relaunch (subprocess.call) or the legacy .cmd's cmd.exe makes the updater
its child, so the delegate check now also accepts our parent. The docs sentence moves to the
hermes.update.run outcome row and names the checkout-lock case (another mutator holding it).
2026-10-09 14:22:08 -07:00
Teknium
975b62663a fix(telemetry): a Desktop hand-off's update refused by its own claim counts as failed
The hand-off quits the Desktop and launches `hermes update` as the marker's
delegate. When the update lock then refuses that claim (the pre-a28a5d03a9f
whole-second creation-time bug on macOS, still present on installs that cannot
pull the fix through the button), no other updater exists: the Desktop shows
"Hermes couldn't finish updating" and the user retries. The metrics row read
outcome `refused`, which the rollup treats as neither attempt nor failure, so
~320 Desktop update failures a fortnight vanished from the failure rate.

Record that one case (marker names this process as its delegate) as `failed`;
a refusal under another update's claim stays `refused`.
2026-10-09 14:22:08 -07:00
Mariano Nicolini
bcf216d461 feat(image_gen): describe Krea image inputs as style references so the model stops rewriting the style into the prompt 2026-10-09 15:36:14 -04:00
Teknium
408cc0d12e Merge origin/main (#32: 36 commits to cf23a1a5cc) into feat/unified-gateway-runtime
17 conflicts, all from main's lint sweep (ruff UP007/UP017/UP022/UP028/UP031/UP037/UP041,
FURB188/FURB192); 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). ruff.strict.toml takes main's copy. The pool-retirement live fixture stays
deleted with the pooled backend this branch retires.
2026-10-09 10:24:04 -07:00
ethernet
894a26a39e Merge pull request #135459 from NousResearch/fix/rc5-darwin-baseline
fix(release): stable releases pass signed-package acceptance when no upgrade baseline exists
2026-10-09 13:06:34 -04:00
teknium1
8bff64d6ed fix(memory): keep a runaway-recall ceiling when prefetch spilling is off
Without the opt-in, external recall is kept whole up to
max(10 x hooks.output_spill.max_chars, 100k chars) and still spills above
that, so one runaway provider can't overflow the context window and wedge
the session. Normal provider-budgeted recall (~16 KB for Honcho) is
unaffected.
2026-10-09 02:59:16 -07:00
Erosika
2327290b0d fix(memory): make external prefetch spilling opt-in 2026-10-09 02:59:16 -07:00
Teknium
30b63bda20 Merge origin/main (#31: 94 commits to d2639c0dc8) into feat/unified-gateway-runtime
No textual conflicts. ecf9655b5a moved the plugin-contract re-export in the Desktop SDK barrel;
the branch's profile-request type re-export now follows it so perfectionist/sort-exports holds
(CI lints the merge ref and failed on that order).
2026-10-09 02:45:01 -07:00
Teknium
97ec76fa7e docs: rollback section the downgrade refusals link to; regenerate the command-parity table
The store trigger and the updater refusal both point at updating.md#rolling-back-to-an-older-release,
which did not exist yet. The parity table picks up the Ink /status /save /bg /btw routing.
2026-10-09 02:13:02 -07:00
Teknium
1427a3a38c fix(update): refuse to move an install back past the gateway runtime once a state.db depends on it
jquesnelle item 6 asks that older code refuse a downgrade. Already-released code cannot be
changed, but this release's updater is the one that performs the move. `hermes update
--branch <old>`, a channel switch to an older release, and a pinned release commit all
pass through _refuse_before_commit_point before the tree changes.

update_downgrade_guard.downgrade_refusal refuses only when both of these hold:
  * the target does not descend from HEAD (forward updates never match) and none of its
    hermes_state*.py files defines the session_admissions ledger. This is one
    `git grep` against the object store, and the pathspec keeps a blobless clone from
    fetching the tree. Any git failure proves nothing and does not refuse;
  * the state.db of this profile or a sibling profile holds session_admissions or
    worker_executions rows. A read-only open; an unreadable store or one with no runtime
    tables does not refuse.

The refusal names each affected store and says downgrading is unsupported. It gives the
way back: `hermes gateway stop`, check out the older release, then put back each store's
pre-upgrade copy. It names the newest pre-update quick snapshot whose state.db predates
the ledger (`/snapshot restore <id>` on the older release). When no snapshot predates the
cutover it points at `hermes import <backup.zip>`. Nothing moves, and the receipt records
the closed stop token `downgrade_refused` (contract, v4 schema enum and metrics doc
updated together).

Verified against the real objects: with an r7-written store holding ledger rows, targets
v0.21.6 and origin/main are refused and HEAD passes.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6073624820
(cherry picked from commit 9688fff768cc595752b7f7bd9f4074274ef6b49f)
2026-10-09 02:10:49 -07:00
Teknium
60302f0054 docs(gateway): generated command-parity table for local sessions, with a drift test
Reviewers asked which commands each local client can run on the shared gateway; the only
answer was reading five code paths. scripts/gen_gateway_command_parity.py walks
COMMAND_REGISTRY (103 commands) and records, from the code itself:

- the gateway's slash.exec verdict for a local session (gateway/session_commands.py
  command_verdict: read / control / refused, with the read-only argument forms)
- the classic CLI view's route (hermes_cli/gateway_chat_commands.py VIEW_ROUTES)
- Ink's handler (canonical route / local / RPCs; a session-namespace RPC the authority does not
  serve is marked broken, other unserved RPCs reach the legacy sidecar)
- Desktop's surface (local spec table + the registry's desktop= dump; rpc specs fall back to
  slash.exec on -32601)
- ACP (slash_mutation)
- a note: toggles are "port: per-session setting", plus why handled-but-not-read commands
  (/agents /platform /sessions /debug /curator ...) are not local reads

website/docs/developer-guide/gateway-command-parity.md is the output (linked from the classic
CLI refusal line); tests/hermes_cli/test_gateway_command_parity.py fails when any verdict changes
without regenerating it. The classic CLI doc now lists the commands and flags this round added.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6073624820
(cherry picked from commit 2005bfc30683326b1216eebd2fed2d7c7768e630)
2026-10-09 02:10:48 -07:00
Teknium
ecb66f60dd feat(desktop): plugin SDK pet bubble (ctx.pet.say)
Plugins can now put a short plain-text line in the core pet's speech bubble
instead of locating the pet canvas in the app DOM and floating their own
overlay over it (pet-wallet, #135178).

- ctx.pet.say(text, { id?, tone?, ttlMs? }) -> disposer; ctx.pet.clear(id?);
  ctx.pet.visible (ReadableAtom<boolean>)
- host-owned rendering in PetBubble, in-window (plugin lines only) and in the
  pop-out overlay (lines ride the existing pet-state IPC push)
- plain text, 120-char cap, control/bidi chars stripped, plugin-name label,
  TTL 6 s default (1-30 s), 3 live lines and 10 says/10 s per plugin
- core error / waiting states keep the bubble; nothing shows without a pet
- every line a plugin has up is cleared on unload/disable/reload
- docs: API section, migration-table row for pet-wallet, SDK exports
2026-10-09 02:04:56 -07:00
web3blind
aad11beae0 fix(browser): fence captured CDP dispatch and retain late replies
# Conflicts:
#	tools/browser_supervisor.py
#	tools/browser_supervisor_capture.py
2026-10-09 02:04:29 -07:00