1159 Commits

Author SHA1 Message Date
kshitijk4poor
ddf69149ed fix(memory): keep refused saves a 400 across the plugin host; hooks survive SystemExit
- plugin_host_wire: an error crossing the host now carries the nearest builtin base
  class, so a ValueError subclass (json.JSONDecodeError) raised by a hosted provider's
  write_config_fields is still a ValueError in core and the dashboard returns 400, not 500.
- notify_memory_provider catches SystemExit as well as Exception: a provider hook that
  exits no longer skips rename's alias, active-profile and identity updates.
- Docs and docstring: a key missing from the target profile's .env reads as unset; the
  hooks never fall back to the caller's environment.
- Memory panel GET maps a provider read failure like PUT does (ValueError -> 400).
- One helper for submitted secrets; the Honcho placeholder rule moves into its storage
  branch so the field loop no longer branches on storage kind.
- Tests: wire round-trip of error classes, SystemExit hook, missing-secret fail-closed,
  and the failing-hook test now asserts both hooks ran.
2026-11-05 13:08:14 +05:30
kshitijk4poor
e090092285 feat(memory): profile lifecycle and config-storage seams for memory providers
A catalog memory provider (Honcho today) has no way to own its per-profile setup or its
dashboard config file, so core carries that code for it: profile create/rename edit Honcho's
host blocks and the dashboard has a Honcho-only storage kind that imports the plugin's private
modules. These seams let a provider do that work itself; core's Honcho code is untouched here
and is removed in a follow-up once the plugin implements them.

- MemoryProvider.on_profile_created(profile_name, hermes_home) / on_profile_renamed(old, new,
  hermes_home): called from create_profile (CLI, dashboard, Desktop/TUI) and rename_profile for
  the provider the profile's effective config selects, with that profile's home and its own
  .env secrets bound. A failing hook or unreadable config is logged and never fails the create
  or rename. No-ops by default.
- storage=STORAGE_PROVIDER in config_schema.py, with read_config_fields(hermes_home) /
  write_config_fields(values, hermes_home): the provider owns its file layout. Core keeps
  value coercion, placeholders, write-only secrets, the memory.provider switch and the 400 on
  a refused write, and saves secrets to .env only after the provider accepted them.

_record_profile_rename moves to profile_identity.py (profiles.py line budget).
2026-11-05 13:08:14 +05:30
Teknium
f97e97234e docs: regenerate the command parity table (the TUI now handles /rewind locally) 2026-11-04 23:06:14 -08:00
Teknium
1a71782f17 feat(cli): backtrack picker — Esc Esc / /rewind to edit & resend or fork from an earlier prompt
Classic CLI gains a Codex-style backtrack picker. Esc Esc on an idle, empty composer with no
overlay (or /rewind) lists earlier prompts newest first with a preview and turn number.

- Enter: prefill the prompt for editing. Nothing is cut until the edit is submitted; the
  submission rides to the process loop as a BacktrackResend, which re-validates the picked
  turn (same session, same text) and then runs the same durable rewind /undo uses. Esc Esc,
  Ctrl+C, an empty submit, or submitting a slash/! command cancels and cuts nothing.
- f: fork. Runs the existing /branch path, then rewinds only the CHILD to just before the
  picked prompt and prefills it; the parent's rows stay active.
- /rewind N and /rewind fork N do the same without the picker.

Esc Esc with a draft still discards it; mid-turn Esc Esc is unchanged.

undo_last's rewind body moves into CLISessionMixin._rewind_to_user_ordinal (shared by /undo
and the picker; same compaction-carrier handling, agent patching and memory rewound hook).
The picker lives in a new hermes_cli/cli_backtrack.py mixin; cli_tui_mixin.py is untouched.
CommandDef rewind is cli_only (desktop: terminal); desktop registry and parity table regenerated.
2026-11-04 23:06:14 -08:00
Teknium
79f28901db docs(gateway): adapter guides and plugin allowlist name resolve_gateway_approval_card
An outside adapter following the guide kept the answer-the-oldest bug, and one using the new
helper drew a private-import warning at admission. Review follow-up.
2026-11-04 21:40:32 -08:00
kshitijk4poor
a285c4f4ba chore(config): finish the auxiliary.skills_hub removal
- locales/_keys.desktop.json: drop settings.model.tasks.skills_hub.{label,hint}.
  The committed key list mirrors the English catalog
  (apps/desktop/scripts/i18n-keys.test.mjs runs `--check`), and the rows were
  removed from en_aux_tasks.ts.
- zh-Hans configuring-models still had the Skills Hub row claiming that
  `hermes skills search` uses the slot; the developer-guide provider-runtime
  lists (EN + zh) still named "skills hub operations" as an aux task.
- Pin the removal: no built-in surface (DEFAULT_CONFIG, the `hermes model`
  picker, the dashboard REST allowlist, the web and desktop rows) offers the
  slot, and a config that still carries an auxiliary.skills_hub block loads.

Refs #40703, #142403
2026-11-05 02:36:29 +05:30
kshitijk4poor
90c19e3196 docs(aux): tighten the aux-slot wording and drop session-search summaries
- configuring-models: the config-reference link no longer promises YAML
  keys for every slot (the reference lacks several of them); Review and
  Voice Chat rows phrase their advice as advice, not as defaults, and
  stop implying an `auto` review is not independent.
- adding-providers (EN + zh): drop "session-search summaries" next to the
  removed web-extraction bullet; session_search has no aux LLM either.
- zh fallback-providers intro still listed web extraction as a fallback
  side task; zh Review link text matches the delegation page title.
- integrations/providers: compression is not a tool, say "features".

Refs #147807
2026-11-05 00:15:14 +05:30
kshitijk4poor
5db2d448ac docs(aux): drop the last web-summarization aux mentions, scope the slot list
- The configuring-models table lists the slots the dashboard exposes, not
  every auxiliary task (goal_judge, memory_query_rewrite and others are
  config-only), so say that and link the canonical Auxiliary Models
  reference; "All auxiliary tasks" assigns the slots on the page.
- /review does not take a fallback_chain (it resolves credentials like a
  delegation pin), so the agent-loop and integrations fallback sentences
  name vision, compression and title generation instead of "every task".
- Remove "web extraction summarization" / "web summarization" from the
  aux-task lists in adding-providers, provider-runtime and
  integrations/providers, and the zh-Hans copies of those pages plus
  agent-loop and integrations/index.
- zh-Hans: drop "offloaded to smaller models" from the intro, which
  contradicted the Review row, and pin the {#setting-auxiliary-models} and
  {#auxiliary-models} heading ids the new links point at.

Refs #147807
2026-11-05 00:15:14 +05:30
kshitijk4poor
915261e61a docs(aux): user-facing Review/Voice Chat rows, no slot count, zh-Hans mirror
Follow-up to the Web Extract removal:

- Review row: `/review` is a full independent subagent, and its own guide
  (features/delegation.md "Review model") pins a strong model, so advise a
  separate (often stronger) model instead of a cheaper one; drop the
  "async delegation rail" internals and link the canonical section.
- Voice Chat row: drop the source-file path, say that reasoning is off on
  voice turns even on `auto` and that GPT-Live ignores the slot, link
  features/voice-mode.md "Voice chat model".
- Drop the hard-coded slot count: "11" went stale because nothing ties it
  to `_AUX_TASK_SLOTS`, and plugin-registered tasks add rows anyway. The
  intro gives examples and links the table instead of a partial list.
- Apply the same corrections to the zh-Hans mirror, which still listed
  Web Extract and 11 slots.
- Remove the remaining "web extraction" mentions from aux-task lists in
  the CLI aux picker prose, fallback-providers, agent-loop, integrations
  index and the --usage-file paragraph.

Refs #147807
2026-11-05 00:15:14 +05:30
Maciej Lisiewski
aac7f1b696
Merge pull request #148651 from NousResearch/ci/desktop-targets-one-source
refactor(release): define the desktop targets once
2026-11-04 05:41:25 +01:00
Teknium
d6c98faab0 fix(release): MS_STORE_HOLD opts a Store build back into Publish now
Committing the Store draft at publication makes every certified build go
live by itself, with no way left to keep one back for a chosen release time.
Setting the repository variable MS_STORE_HOLD=true makes the publication
pass commit the draft Manual instead: it is certified and then waits for
Publish now in Partner Center, with a warning that says so. A rerun of a
held submission is a no-op and never flips it to Immediate. Unset keeps the
auto-publish default.

Also quote the real v0.22.7 refusal (state 'PreProcessing') and update the
stable-releases developer guide, which still described the held commit.
2026-11-03 20:22:40 -08:00
Maciej Lisiewski
3b9c311ede
ci(release): drop the always-true darwin-arm64 guard on the QUIC step
The darwin matrix is Apple Silicon only, so the step's if: was always true
and its comment pointed at the removed macos-intel lane. The macOS bundle
update docs now say the publish job waits for the arm64 build and its smoke.
2026-11-03 23:54:58 +01:00
Teknium
8112254f8a chore(skills): drop optional skills that catalog MCPs, plugins and vendor repos cover
Removes 7 optional skills:
- notion, airtable: the official vendor MCPs are in the MCP catalog
  (OAuth, no Portal needed), hosted connectors exist, and each vendor
  keeps its own skills repo.
- shopify: hosted connector plus Shopify's own maintained `shopify`
  skill in Shopify/Shopify-AI-Toolkit.
- duckduckgo-search, searxng-search: both are bundled web_search
  backends now and web_search works keyless out of the box, so these
  fallback-only skills essentially never surfaced.
- honcho: Honcho left core for Plastic Labs' catalog plugin, which owns
  the `hermes honcho` commands this skill documented.
- mpp-agent: the verified Pay plugins (hosted and local) cover paying
  HTTP 402 / x402 / MPP APIs with a bundled skill.

makenotion/skills, Airtable/skills and Shopify/Shopify-AI-Toolkit become
default trusted taps (all MIT, vendor-owned) so the topic still shows in
`hermes skills browse`, matching the wandb/qdrant/pinecone precedent.
The `box` skill stays for now.

AIRTABLE_API_KEY leaves OPTIONAL_ENV_VARS (its only consumer was the
skill); NOTION_API_KEY stays because the Teams meeting pipeline's Notion
sink reads it, and its description now says so. Related-skill links,
docs examples and the zh-Hans catalogs drop the removed names.
2026-11-03 13:28:32 -08:00
Maciej Lisiewski
0ff303c37a
docs: no release builds an Intel macOS desktop bundle 2026-11-03 20:58:05 +01:00
BearHuddleston
7dc7e648ce docs(bundles): scope the uv wheel-link note to macOS and Linux
The shared-bundle-builds note and the stage_uv_cache docstring read as if
uv's wheel entries were symlinks on every target. On Windows uv writes
pointer files. The docstring's layout also covered only the pypi family;
URL, git and named-index entries carry an extra hash directory.

Reported in review by @unsupportedpastels.
2026-11-03 01:16:49 +00:00
BearHuddleston
b8e6687e63 fix(bundles): ship uv's wheel links as links in the payload cache
stage_uv_cache copied the build cache with shutil.copytree's default
symlinks=False. uv stores each cached wheel as a relative link into
archive-v0/, so the copy stored every unpacked wheel a second time and
the seed then merged those directories into the machine cache. On the
published v0.22.0 macOS ZIP that is 30,859 files under
uv-cache/wheels-v6 (278 MB compressed, 901 MB installed), and uv fails
with "Is a directory (os error 21)" when it publishes one of those
wheels again (#141891). Windows is unaffected: uv writes pointer files
there.

Keep the links. The signing walkers already skip symlinks, so each
binary is still signed once at its archive-v0 path. Also correct the
shared-bundle-builds doc and the staging comment: built wheel ZIPs ship.
2026-11-02 23:12:45 +00:00
mnajafian-nv
f301e86fe4 chore(relay): upgrade to 0.11.0
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
2026-11-03 00:14:24 +05:30
Teknium
343a5f7f58 fix(gateway): background completions that pile up behind a busy turn run as one turn
While a turn runs, every background process that finishes is admitted to the
session FIFO as its own queued turn, so ten finished jobs meant ten
back-to-back "[IMPORTANT: Background process ... completed]" turns after the
current one, each re-reading the whole context and answering one result.

A completion now folds into a completion still waiting at the very end of the
FIFO: the new admission carries both texts, every producer identity and a
"N background process results" header, and cancels the waiting row in the
same transaction (the `replaces` path heartbeat ticks already use). Only the
tail folds, so a prompt queued between two completions keeps its place; a
waiting row claimed first leaves the new completion to queue alone.
2026-11-01 14:17:45 -08:00
Teknium
bd47fe3b63 fix(telemetry): count busy messages that wait behind a running FIFO turn; cancelled rows read as dropped; per-profile home and closing-day peak
- A message the adapter sees as idle (its earlier message's adapter task ended while a queued
  turn runs as a FIFO turn, outside the adapter's session guard) is stamped by the runner's
  running-turn check at FIFO admission and settled there, so a busy chat counts every waiting
  message once. A queued row cancelled later (/stop, /new, refused head, edit) settles dropped
  through SessionAuthority._settle_cancelled.
- A row that is already terminal when admit_message re-reads it counts as reached only for a
  turn outcome (completed / interrupted / failed / steered); cancelled, rejected or deleted is
  dropped / never.
- The arrival's home is the routing identity's runtime profile, not the profile that last ran a
  turn in that chat id (two bots of different profiles in one channel).
- The day's peak of running chats is kept per UTC day, and a day closing after midnight folds
  its own peak before its row is written.
2026-11-01 13:50:05 -08:00
Teknium
a41d1dfca0 fix(telemetry): a busy message saved behind a pause or restart is not dropped; auto-resumed chats count toward their own profile's peak
A graceful stop/restart (runtime_draining) and the session_busy /
unknown_execution pause notices tell the user the message is saved while its
FIFO row stays queued, but the busy-arrival settle recorded dropped/never.
Park the arrival instead: it counts as queued if this process later runs the
row, and not at all across a restart (the existing doc promise). A row read
back as unknown right after commit already started, so it counts as reached.

The startup auto-resume loop claims chats from the launch profile's scope;
pre-assign each claimed chat to the home its turn resolves to, so a resumed
secondary-profile chat no longer counts toward the launch profile's peak.
2026-11-01 13:50:05 -08:00
Teknium
6f55623cc9 feat(telemetry): count messages that arrive while a chat's agent is busy, and the day's peak of busy chats
hermes.gateway.busy_arrival.count: one row per human message that reaches a
chat whose turn is still running (the shared runtime's busy dispatch),
recorded once its fate is known: queued (ran later as its own turn),
steered (steer or interrupt-mode redirect into the running turn),
interrupted (hard interrupt, then ran next), merged (folded into another
busy message of the same burst), dropped (/stop, /new, refused, queue cap),
with the wait from arrival to the moment it reached the agent.

hermes.engagement.day.count gains gateway_peak_busy_chats_bucket: the most
chats of the owning profile with a turn running at once that UTC day, kept
in memory from the runner's running-turn set at every turn boundary
(_persist_active_agents, moved to the agent-cache mixin so the gateway.run
facade does not grow) and folded into the profile's engagement day state.

Both are opt-in through the existing shared-metrics gate; no chat ids or
session keys leave the process.
2026-11-01 13:50:05 -08:00
Teknium
b7ab3f7d85 fix(telemetry): tool names a stable release shipped stay valid after leaving core
Spotify left core (#135389) and the five browser_vault_* tools folded into one
browser_vault after v0.21.6/v0.21.7 shipped them, which dropped spotify,
spotify_* and browser_vault_* from the shared-metrics contract (and spotify /
spotify_* from the v3/v4 schema enums). Pending rows older releases stored
with those names no longer exported as recorded: the drift re-bucket turned
toolset=spotify into custom and tool_name=spotify_search into unknown, and a
tool_unavailable row (no fallback bucket) was left out entirely.

They join RETIRED_TOOL_NAMES / RETIRED_TOOLSET_NAMES, the existing legacy set
for removed core names; recording still maps through the live sets, so no new
row carries them. The v3/v4 schema enums regain the removed values, and the
v4 tool_unavailable enum also gains the contract values it never listed
(browser_vault, set_theme, setup_beat, setup_choose, start_chat).

Tests: the retired-name packaging test gains spotify and browser_vault cases,
and the schema-equals-contract test covers tool_unavailable; both red on
origin/main.
2026-11-01 13:38:10 -08:00
Teknium
9ed1a7371b docs(hooks): what a pre_llm_call block stores, and that only a returned block blocks
The block sections now say the prompt is stored as the withheld placeholder
(later turns, compaction, session_search, memory providers and review read
only that; transcripts still show what was typed), that the hook runs before
turn-start compaction, and that a callback which raises or times out is
skipped, so the turn goes ahead. observer-hooks.md lists the block return.
2026-10-31 22:59:20 -07:00
Teknium
ad9229c843 feat(hooks): pre_llm_call can block a turn before any inference request
A pre_llm_call callback (Python plugin or shell hook) may now return
{"action": "block", "message": "..."} to veto the turn: no model call is made,
the message is the reply the user sees and the transcript keeps a normal
user -> assistant pair, and the result carries
turn_exit_reason=blocked_by_plugin_pre_llm_call. This is the supported seam for
DLP / privacy / policy plugins that previously had to patch core (#57364).

The vetoed prompt also stays on the host for that turn: no session titling call,
no external-memory prefetch or sync, no background memory review. Its user row
gets an api_content placeholder for the main-loop replay. That alone does not
keep the prompt out of later turns (compaction, session_search and memory
providers read the row's content); the next commit stores the placeholder as
the content.

First valid block wins; a Python block without a message is ignored (same as
pre_tool_call). Shell hooks accept both the Hermes {"action": "block"} and the
{"decision": "block", "reason": ...} shapes, mirroring pre_tool_call.
2026-10-31 22:59:20 -07:00
Teknium
0040f02b5c fix(plugins): clear catalog sweep 1028 scanner false positives and close three validator gaps
Install scanner (tools/plugin_guard*, PLUGIN_SCANNER_VERSION bumped once):
- hardcoded_secret: a PostHog project key (phc_, write-only ingest key) joins the
  Google installed-app secret as a public client key -> high (caution), only
  when every matched literal on the line has a public prefix (telesec
  telemetry.py:27 was dangerous). phx_ personal keys and any other token stay
  critical.
- proc_access: reads of /proc/self|<pid>/{cgroup,mountinfo,stat,status,...}
  (container placement, pid start time) land at low instead of high
  (hermes-lcm-x cpu_capacity.py was caution). environ, cmdline, mem, maps, fd,
  root/cwd, ns, bare /proc/self, any unlisted leaf and any write keep high.
  Generalises #144304's cgroup/mountinfo allowance and keeps the finding
  visible instead of dropping it.
- bytecode_file: a committed .pyc/.pyo (git ls-files; plus any bytecode outside
  __pycache__) is a high structural finding, the binary_file tier (rule 17;
  hermes-emotion shipped tests/__pycache__/*.pyc and scanned safe). Untracked
  caches the validate run writes are not flagged.

Validator (hermes plugins validate, warnings only):
- private imports: gateway.session_context.get_session_env is the documented
  route (plugins/index.md) and a plugin's fallback import of its own install
  path (plugins.memory.openltm._db) is not a core import.
- new warning for private-method calls on core handles (SessionDB, AIAgent,
  GatewayRunner, PluginContext) the plugin does not define itself
  (opencode-sync db._execute_write, runner._evict_cached_agent).
- desktop surface review warning for raw window.hermesDesktop calls and app
  markup selectors ([data-slot], [data-tree-*], [data-pane-host]) in CSS text
  or closest() (squad-hub, novel-reader, search-sources).
2026-10-28 23:07:47 -07:00
yliu325
b81e71addd feat(cron): optional per-job grace_minutes override
The catch-up window (how late a missed cron occurrence may run instead of being skipped) was
half the job's period, clamped to 120s-2h, for every job. A job can now override it outright:
0-1440 minutes, `0` meaning never catch up.

`grace_minutes` is a real 0, not "unset" — and the obvious write pattern would eat it:
`v in {None, "", False}` (the `workdir` update lambda) and `if value:` both treat `0` as
False in Python. Both doors therefore share `jobs_time.normalize_grace_minutes`, reads test
`is None`, and the renderer formats before testing truthiness.

The override moves the dispatch stamp too: `_classify_dispatch_lateness` and the dispatch
health metric read the same window, so a job the scheduler calls "late" is never reported
overdue by the dashboard.

Refused on `once`/`interval` schedules: the window describes a missed wall clock, and a
duration has none.

Split from the timezone commit so it can be reverted alone.
2026-10-28 19:40:40 -07:00
yliu325
bfa67878cd fix(cron): per-job timezone drives schedule compute and due-scan
A job may pin its own IANA timezone; its cron expression is then that zone's wall clock,
independent of the profile's configured timezone. Absent/None inherits the profile, so an
existing jobs.json keeps byte-identical behaviour and needs no migration.

The dispatch path needs the pin as much as the compute does. `compute_next_run()` resolves
the zone as job pin -> profile zone -> base offset, and every site that writes `next_run_at`
now passes it (advance, claim, resume, re-arm, recovery, and the quota/unreachable
planners); one missed site re-fires or skips a slot because the stored instant and the
expression would be read in different zones.

`_evaluate_due_job()` normalizes the stored instant into the JOB's zone, which hands every
downstream cron predicate the job's clock, and a pinned job skips
`_repair_timezone_shifted_cron` outright. That repair exists for jobs that FOLLOW the profile
zone across a zone change: on a pinned job its wall-clock comparison reads a due occurrence
as still-in-the-future and re-anchors past it.

Failing shape this fixes (profile America/Los_Angeles, job 0 9 * * 1-5 pinned to
America/New_York, scanned at 09:00 New York): `get_due_jobs()` returned [] and the job was
re-anchored to the next day, i.e. job zones east of the profile zone silently never fired.
The regression test drives the public store API and asserts both the fire and the absence of
the repair, and is proven red on main ([] and a rewritten instant).

Knobs live in the new sibling `cron/jobs_time.py`; `cron/jobs.py` stays over the file-lines
ratchet and only gained the call-site plumbing.
2026-10-28 19:40:40 -07:00
Teknium
0a93a2341f fix(vault): fill saved logins on Camofox pages through a browser page backend seam
browser_vault reached pages only through the task's CDP supervisor. Camofox (now a plugin) has no
CDP endpoint, so every fill on a Camofox tab ended with "Could not determine the current page
origin": the username from browser_vault list worked, the password never filled.

ctx.register_browser_page_backend lets a plugin browser carry the vault's origin read, form
inspection and fill script to its own page. Core keeps the secret contract: the exact-origin
pre-check and in-page re-check, the Bot Desktop takeover check, an in-page try/catch around the
secret script, and fixed failure text on that path. Registration follows the login-backend
provenance rule (bundled, or catalog verified/official at its pin) and is refused under
plugins.isolation: host.

Consolidates the core half of #127179 and #135204 (the Camofox halves already shipped in the
official plugin); the in-page wrapper follows #114414.

Co-authored-by: Jonathan Bruce <jonathan.bruce369@gmail.com>
Co-authored-by: clsferguson <cferguson@live.ca>
Co-authored-by: Benjamin PERRY <benjaminperry6@yahoo.fr>
2026-10-28 19:00:07 -07:00
Teknium
ca8e43aea7 fix(desktop-plugins): copy root-layout desktop halves; no false desktop success
A mixed package with plugin.yaml + __init__.py and a ROOT plugin.js is
reported by the install probe as carrying both halves, so a browser tab
(and native Desktop on a local backend) installs the agent half alone and
leaves the desktop half to the reconcile pass. Both reconcilers (the host's
desktop_plugin_halves.py and Electron's desktop-plugins-root.ts) only read
desktop/plugin.js, so nothing was copied while the dialog still said
"Desktop plugin <name> installed".

- One entry rule for every reader: desktop_source / desktopHalfSource (root
  plugin.js wins, else desktop/plugin.js), used by both reconcilers, the
  Webapp installer, findDesktopEntry, plugins.manage list's has_desktop_half
  and the plugin doctor's stale-copy check.
- A root-layout half publishes the package root as the installers do,
  without .git and __pycache__, held to the installer's plain-tree rule
  (no links, 64 MB cap); a refused tree is logged and not copied. The
  marker's source is the package root, so the prune follows it.
- The install dialog reports the desktop half only when the reconcile
  copied it or <root>/<name>/plugin.js is already there; an agent install
  that left no desktop half reports "Desktop plugin install failed".
2026-10-28 17:21:32 -07:00
Teknium
e1be6fcfe0 fix(config): config_keys come from the loader's discovery, count only for active plugins, never widen a section
Review findings on the config_keys seam:

- Discovery: drop the glob scan. config_keys is parsed onto PluginManifest
  (plugin.yaml, and extensions.com.nousresearch.hermes in a portable
  plugin.json) and read from the loader's own collect_directory_manifests +
  entry points + resolve_manifest_winners, so skip rules, precedence and the
  project-plugin gate are the loader's.
- Only active plugins count: gate_manifest must load the plugin (disabled wins,
  plugins.enabled opt-in, requires_hermes); memory providers count when
  memory.provider selects them.
- Bounded: a declared path is at least two segments deep and is ignored when
  DEFAULT_CONFIG already defines it; runtime keys are consulted only after the
  schema walk refused a key, so a plugin declaring [agent] no longer hides
  agent.max_turnz.
- No lru_cache: a plugin installed or enabled in a long-running process counts
  on the next config get/set (the lookup runs only for refused keys).
- computer_use.backend (read by the plugins/computer_use selector) and
  dashboard.kanban move to a core table with their readers; the selection
  sections derive from read_selection's own _SELECTION_NAME_KEYS.
- Tests use fixture plugins (enabled/disabled, hostile [agent], selected memory
  provider, portable plugin.json, project opt-in).
2026-10-28 13:09:00 -07:00
Teknium
e402afa783 fix(config): recognize runtime-read selection and plugin-declared keys in config get/set
`hermes config get browser.cloud_provider` / `browser.use_gateway` warned "not a recognized
config key" although the runtime selects the browser provider from them. The validator only
walks DEFAULT_CONFIG, and provider selections stay unseeded on purpose (a stored key is the
explicit pick), as do core-section keys plugins read.

- tools.tool_backend_helpers.selection_config_keys(): the keys read_selection() honours
  (<category>.use_gateway, browser.cloud_provider, stt/tts/image_gen/video_gen provider keys,
  web.backend/search_backend/extract_backend).
- plugin.yaml / dashboard manifest.json `config_keys`: a plugin names the core-section paths it
  reads; declared for retaindb, byterover, computer_use/cua, kanban dashboard.
- hermes_cli/config_runtime_keys.py consults both before the DEFAULT_CONFIG walk.

Found on Hermes Cloud staging.
2026-10-28 13:09:00 -07:00
Teknium
27801d1bec docs(plugin-sdk): say a sandbox change remounts the Webapp guest frame
The Webapp keys BrowserGuestFrame by its sanitized tokens, so a sandbox
change swaps ref.current and restarts the guest; a direct frame on native
Desktop keeps its element and applies new tokens at its next navigation
(live-checked in Chromium and WebKit). Plugins that keep the first frame
element need to know.
2026-10-28 07:25:35 -07:00
dokterdok
bd78ca4afa fix(webapp): preserve SandboxedFrame guest parity
Dispatch each guest load on the outer iframe as its own marked load
event, so onLoad gets a real React event and ancestors see guest loads.
The shell's own load is taken in the document's capture phase, before
React or any consumer handler, and the document is sent from there, also
while an Activity or Suspense boundary hides the frame; a frame mounted
hidden starts when first shown. Inside a shadow root, where a load never
reaches the document, the frame's own handler takes the shell load. Guest loads are routed by the shell's
window, so they arrive while hidden too.

Relay nested transferables both ways with an iterative walk, retry plain
once, and close ports when a message cannot be delivered, including one
that arrives before the guest frame exists.

Remount the shell when sanitized sandbox tokens change.

Mark a document sent only once it reached a shell, and send it again
only when it changed.
2026-10-28 07:25:35 -07:00
Teknium
764fa746ae fix(webapp): keep scripted SandboxedFrame data: HTML running under the page CSP
The Webapp page policy authorizes only the app's own inline scripts, and a
data: document inherits it, so a plugin's documented SandboxedFrame
`data:text/html` embed stopped running its script in browser tabs.

In the browser host only, SandboxedFrame now decodes HTML data: URLs and
hands the markup to a separately served guest shell
(/assets/webapp-guest.html), the same parent-messaged shell file previews
use, served with its own policy and the SDK sandbox allowlist as its
ceiling. The frame's sandbox attribute narrows that to the caller's
sanitized tokens (plus allow-scripts for the shell); the nested guest
document gets the caller's tokens exactly, so a script-less embed stays
inert and allow-same-origin can never apply. The shell relays messages
both ways, so `ref.current.contentWindow.postMessage` and
`event.source === ref.current.contentWindow` keep working, and onLoad
fires once the guest document (not the shell) has loaded. Native Desktop,
http(s) and non-HTML data: embeds keep the direct frame; the page script
policy is unchanged.

Live (built Webapp, real gateway, scratch HOME, Chromium): a SandboxedFrame
data: guest posts ready and answers a ping after onLoad on main and with
this commit; on the previous head it never ran.
2026-10-27 20:44:23 -07:00
Teknium
601b368267 fix(gateway): cold-session /compress engine gets compression.model_thresholds; document manual /compress for engines
Agent init assigns compression.model_thresholds to a plugin engine before
its first update_model(); the cold gateway path now does the same. The
context-engine guide states what manual /compress calls and which boundary
hook follows the commit.
2026-10-27 19:34:10 -07:00
Ben Barclay
e4374020bd fix(config-remote): adapt the remote backend to the seam as merged in #134362
puts back what that build deliberately left for the remote backend, on
main's seam shape:

- RemoteBackend implements main's protocol (read_user_doc, probe_readable)
  and is not a FileBackend; _route returns (backend, home) and explicit
  files go through _ExplicitFile, so the is_layer branches are gone.
- One bootstrap: _ensure_bootstrap_env / bootstrap_deployment select the
  backend from the process env, the launch home's .env and the managed .env.
  #134362's _dotenv_backend_override did not survive its file-only refactor,
  so nothing stacks; its rules are now tests (stale shell remote + .env file
  boots file; empty .env value resets to file; .env-only remote selects
  remote; an absent key keeps the shell value).
- The file-tooling gates main removed (backup/import/snapshot restore,
  config edit, migration write-back, config backups, profile clone and
  distribution install, raw config editor, xAI migration, gateway --config).
- profile_serve_signature uses the backend version for config.yaml.
- restore_config_model_settings_if_rewritten is a no-op without file tooling.
- PM's dependency runtime reads a home's selection from the local file it
  publishes to (config_backend.local_file_layer), so a remote deployment
  never needs the plane there or fails PM closed.
- Ratchet: _container_slots/_validate_quoted_containers move to
  config_value_checks, _count_cron_jobs to backup_restore, the gateway
  --config load to gateway/config_loader.
2026-10-27 17:33:48 -07:00
Ben Barclay
f15b518b25 fix(config-remote): review round 7 — grouped edits are one write, readers see only completed migrations
1. Grouped edits: new write_config_keys(path, {key: value}) sends related keys as ONE backend
   write (one CAS PATCH in remote mode), so a lock on any key refuses all of them.
   persist_model_selection, the TUI /focus setter and the thinking_mode setter use it; the TUI
   gets _write_config_keys (one raw round-trip save with the file backend). File-mode writes
   are unchanged (key by key, comment-preserving).
2. Migration reads: _postprocess has no single flight any more. A reader or writer that finds
   the published doc unmigrated runs its own private pass; the first to finish publishes
   (generation-fenced, st.postprocessed set only on publish). read_user_layer /
   read_user_doc_readonly snapshot only completed output (_snapshot re-completes when a poll
   lands in between), and write_changes prepares only against completed output. Waiting on the
   other pass instead could deadlock on _CONFIG_LOCK; private recursion is unchanged.
3. Docs: developer-guide/config-backend.md says the remote backend ignores the managed
   config.yaml while the managed .env still applies.
2026-10-27 17:33:48 -07:00
Teknium
f09d03dfe2 fix(cache): signatures stored and compared later always hash
Review of #145651, item 3: the hook-consent signature, free-tier inventory stamp, onboarding due
stamp and skills manifest are kept and compared on a later tick or by the next process, so they use
always_digest=True like the PR's other stored signatures; a racy digest turning empty no longer
costs one recompute after a fresh write settles.
2026-10-27 12:57:09 -07:00
Teknium
76f2fdb794 fix(cache): a rotated key, token or same-size edit is never served stale from a file cache
Every cache keyed on a file's stat signature had the bug the config caches had: a same-size
in-place rewrite in one coarse timestamp tick keeps mtime, ctime, size and inode, so the older
parse was served for the rest of the process. Move the helper to utils.file_cache_version
(file_signature + content digest while the file is under 2 s old; always_digest for signatures
compared much later, where the racy digest going empty would read as a change) and key every
cache that can hold a secret, token, pairing/allowlist, route or config on it:

- auth.py: global auth-store memo, Nous auth-status memo (was mtime only)
- gateway/pairing.py approved-users cache (a revocation kept access)
- run_profile_reconcile: served-profile signature (always_digest: a false change reconnects
  adapters) and the hook-consent signature
- webhook dynamic routes (route HMAC secrets), Feishu comment pairing/rules cache (mtime only)
- MCP OAuth tokens-file reload check (mtime only; always_digest: a reload tears the session down)
- config parse-failure record (always_digest), named-custom-provider memo, model aliases,
  gateway.standalone memo, profile model read, MoA preset, agent raw config,
  tui_gateway raw config cache, onboarding due stamp, free-tier inventory stamp,
  provider model-list credential fingerprint, git safe.directory key, skills prompt
  manifest

config_cache_version takes its stat through config_version, so its errors and seams are unchanged.
Left alone: the tool-definition cache key and the platform manifest stamp (a safe worker must
never open config.yaml or a plugin file; the MoA preset cache is skipped in one instead) and the
CLI MCP watcher seed (pinned to file_signature by a main test).
2026-10-27 12:57:09 -07:00
Teknium
5f02a8c19e fix(config): a same-size config.yaml rewrite in one timestamp tick is no longer served stale
Every config parse cache (load_config, read_raw_config, load_user_config_effective,
read_config_doc_readonly, the managed overlay) keyed on the stat tuple
(mtime_ns, size, ino, ctime_ns). On kernels without multigrain timestamps a
same-length in-place rewrite (port 3 -> 5, k-old -> k-new) in the tick of an
earlier read keeps all four, so the older parse was served for the rest of the
process: a rotated api_key never reached a follow-profile session and the
route stayed on the old endpoint. That is the CI flake in
test_rotated_key_reaches_follow_and_held_pick_on_a_fresh_owner_and_routes_are_never_mixed
(got port 3, expected 5).

Caches now key on config_cache_version(): the backend's version plus a content
digest while the mtime is racy (younger than utils.RACY_MTIME_WINDOW_NS, the
same "racily clean" rule the change watcher and roster already use), read
before the parse it guards. Settled files cost no extra read; config_version()
itself is unchanged, so change watchers and the parse-failure record see no
spurious change when a file settles.
2026-10-27 12:57:09 -07:00
Teknium
1c4cbb2222 Merge remote-tracking branch 'origin/main' into copilot-seams/integration 2026-10-26 00:40:32 -07:00
Teknium
e1d1e270c5 docs(providers): seed_pool_credentials values, per-home static_models; drop process_command_fallback (zh-Hans)
The developer guide names the data-only seed_pool_credentials arguments and states that
static_models are looked up per profile home. The zh-Hans copy still documented the removed
process_command_fallback field (ACP-R6-5).
2026-10-26 00:32:21 -07:00
Teknium
765933299d fix(compression): a prepared summary is never redone over a moved tail cut
With compression.prepare_ahead, compress() re-planned the tail cut and threw the
completed background summary away whenever the fresh cut landed before the
summary's boundary (the no-LLM prune made tail rows cheaper, tool-group
alignment moved the cut), then wrote a second summary inline while the user
waited. That breaks the one-summary rule: once the background summary exists it
is used, and everything after its boundary is the tail.

The splice check no longer consults the fresh cut at all. A summary is still
discarded only when the messages it covers changed (rewind, shape change, other
session, moved head). The pass planned its own window with a full tail, so the
tail is never empty. The now-unreachable inside_tail reason leaves the
(unreleased) prepared-compaction metric contract.
2026-10-26 00:10:23 -07:00
Teknium
b991bd203b fix(telemetry): exit flush applies each profile's own send consent and collection gate
Review findings 1 (critical) and 2 on #144850, plus the send-pass sibling.

A multiplex gateway or compute host exits from the launch profile's scope, and
the os._exit flush (like main's atexit hook, which has the same flaw) shut down
every profile's runtime under it: profile B (send: false) got the launch
profile's send=True reconciled into its store, an open-ended consent window and
a send pass over its outbox; a profile that turned collection off since its last
turn still had its open sessions written at exit.

- _Runtime.shutdown binds its own profile home (host.profile_key) for every
  caller (atexit, shutdown_runtimes, tests) and checks enabled() inside that
  scope first: a revoked runtime is deactivated, dropping its data unexported.
- _flush_and_export exports under the owner's scope, whoever triggered it.
- The send pass thread inherits that scope (spawn_context_thread): on main it
  ran on a bare Thread, so still_consented() re-checked the LAUNCH profile's
  consent (B's pass read A's send:false; a B revoke would not stop its pass).
- Tests: wait_until replaces the sleep-poll; one three-profile invariant test
  through the real gateway exit funnel.
2026-10-25 23:13:53 -07:00
Teknium
d773589f7c fix(compression): every prepared summary ends counted as used or discarded
Re-review findings:
- a summary take() handed to compress() that the compaction then aborted or no-opped before
  adopt() spliced it was counted nowhere; it is now counted once at the next touch as
  discarded/compaction_aborted;
- a session boundary landing after the pass published but before the waiting compaction woke
  read as a failed pass (a second discarded row); the wake now reads the entry and the cancel flag
  under one lock, so the boundary's row is the only one.
2026-10-25 22:55:11 -07:00
Teknium
5bdf1de16f fix(compression): count each prepared summary once, at the splice
Independent review of the telemetry found:
- a session boundary that woke a waiting compaction was counted twice (the boundary's discard
  plus the woken wait's 'discarded_while_waiting'); the boundary's row is now the only one and the
  dead reason code is dropped from the vocabulary;
- 'used' was recorded in take(), before a stale-attempt abort could still drop the summary; it is
  now recorded by adopt(), the splice itself, with the wait carried on the entry;
- the cancel reason is set under the lock, so a pass finishing in that gap reports the real reason;
- skipped_busy counts once per refused window instead of every tool batch.
2026-10-25 22:55:11 -07:00
Teknium
77af0690a8 fix(compression): one-shot runs start no wasted pass; releasing an agent cancels its pass
The live matrix on real processes found two ways a prepared-compaction pass was paid for and never
usable:

- `hermes chat -q` / `-z` runs end with their turn (the gateway evicts the agent right after the
  reply), so a turn-end pass there was always cancelled ~0.5 s later. One-shot sessions now join
  cron runs and delegated children in skipping turn-end passes.
- Releasing an agent without a session boundary (gateway cache eviction, a Desktop rewind,
  managed-worker retire, close()) left a running pass billed to completion. release_clients() and
  close() now discard it (shared-metrics reason `agent_released`).

Pass log lines now carry the session id, so concurrent sessions in one gateway are attributable.
2026-10-25 22:55:11 -07:00
Teknium
4ea24baeb1 feat(shared-metrics): count prepared-compaction adoption and outcomes
Opt-in shared metrics could not say whether anyone turns on
compression.prepare_ahead, or whether the passes it starts pay off.

- hermes.install.snapshot gains compression_prepare_ahead (on/off), read
  from the profile config with the agent's own truthiness. Pre-upgrade
  snapshot rows keep a legacy field set and the v4 schema field is
  optional, so they still validate and package.
- New closed-enum counter hermes.prepared_compaction.count (mark name =
  metric name, projected by the decision-mark table): event, origin,
  reason, failure_class (compression vocabulary), wait_bucket.
  record_prepared_compaction() takes raw values, normalises inside, is a
  no-op unless collection is on and never raises.
- Vocabularies live in shared_metrics_prepared_compaction.py (the
  contract sits at the 2,000-line cap); the contract imports it.
- v4 schema extended in place (additive), docs row + snapshot bullet,
  relay smoke asserts the snapshot field.
2026-10-25 22:55:11 -07:00
Teknium
3d8fe711ab fix(compression): a prepared summary never covers unpersisted history it cannot vouch for
Review follow-up (Greptile on 41ac847b3ee): caller-supplied conversation_history
that is never persisted carries no message_uid, so the structure-only check
accepted a dropped user/assistant pair once the transcript regrew to the same
shape, and the old summary replaced messages it never summarized.

Each message identity now also carries a text digest. A message whose uid is
present on both sides is still matched by uid alone, so plugin text rewrites
of persisted messages keep the summary; a message without a uid on one side
is matched by text.
2026-10-25 22:55:11 -07:00
Teknium
c2383a6806 feat(compression): one prepared summary per compaction, newer messages join the tail
Maintainer ruling on the prepared-compaction design, plus the review findings
(ours and Greptile's) on #144684:

- One pass per compaction. The extension passes (a new summary call every ~8k
  tokens of growth) and the "stale after one tail budget" check are gone: the
  summary splices at its own boundary and every message after it, however
  many, stays verbatim in the tail. No second summary is ever paid for.
- The splice check compares message structure, not text: role, tool call
  ids/names, tool result ids, plus the durable message_uid where both sides
  carry one. Plugins that rewrite text in place (redaction, pre-compaction
  notes) no longer throw the summary away; a dropped/inserted message or a
  rewind into the window (new message_uids) still misses. This also settles
  the fingerprint gap on input_text/output_text parts: text is not compared.
- A pass that recovered on the main model after the summary model failed now
  hands that over on a splice, as an inline call would: summary_model goes
  sticky to the main model, and the "configured compression model failed"
  warning reaches the user. The attempt telemetry carries the pass's aux call
  (model, tokens, duration, fallback) and a new prepared_summary flag.
- The first compaction that needs memory-provider context stops further
  passes for the agent; each would have been discarded and paid twice.
- Turn-end passes are skipped for cron runs and delegated children, whose
  sessions end with the turn.
2026-10-25 22:55:11 -07:00