Commit Graph

1330 Commits

Author SHA1 Message Date
Teknium
c65cb0a028 fix(cron): dashboard can update wrap_response, rejects coercible values; store stays under baseline
Greptile: Dashboard wrapping changes fail / Invalid inputs are accepted /
The input type excludes reset / The oversized store keeps growing.
wrap_response joins _DASHBOARD_UPDATABLE_FIELDS; CronJobCreate uses StrictBool;
cronjob() annotates bool | str; the catch_up and wrap_response tri-state
normalizers move to cron/jobs_tristate.py so cron/jobs.py is 3 lines under its
origin/main size.
2026-11-14 03:58:59 -08:00
Martyn Forryan
2eb001413e docs(cron): document the per-job wrap_response override
The cron user guide described only the global cron.wrap_response. Add a
per-job subsection covering the CLI flags (--wrap-response,
--no-wrap-response, --inherit-wrap-response), the cronjob tool values
(on / off / inherit) and what the dashboard API accepts, and note in the
developer guide where the decision and the strict normaliser live.
2026-11-14 03:58:59 -08:00
Maciej Lisiewski
6c025ab898 fix(plugins): pin liveness endpoint URL to loopback (salvage #125745) (#155387)
* fix(plugins): pin liveness endpoint URL to loopback, harden manifest liveness parsing

A manifest's liveness.endpoint_path was concatenated verbatim onto the
loopback URL read from the app's runtime server.json and re-parsed by the
probe, so a crafted tail like '@attacker.example/' rewrote the URL authority
and the initialize request carried the runtime file's bearer token to a
manifest-chosen host.

Now the declaration parser only admits a plain path charset (no '@', '?',
'#', whitespace, scheme, or '..' segments), the resolver re-parses the fully
composed URL and requires it to stay on a loopback host with the same port
and no userinfo, and _mcp_initialize re-verifies scheme/host/port before the
socket opens so the transport-facing endpoint() path is covered too.

Adjacent hardening in the same surface: liveness.path must be a rooted
filesystem path in both parse surfaces, server.json key overrides must be
simple key names, malformed pids (bool, >int32) degrade instead of crashing
os.kill, a non-mapping 'fields' value raises ValueError inside the fail-closed
contract instead of TypeError, and a manifest whose liveness fails validation
renders 'unknown' on the catalog card instead of 'present'.

* test(plugins): satisfy ruff PLR0402 in salvaged liveness test

Follow-up to the salvaged #125745 commit after rebasing onto main.

Refs #125744

* test(plugins): build hostile-endpoint fixture with a valid AppLocation tuple

AppDef.locations is tuple[AppLocation, ...]; the fixture passed a bare
string, which only worked because endpoint() never reads locations.

Refs #125744

---------

Co-authored-by: beardthelion <beardthelion@users.noreply.github.com>
2026-11-14 12:46:07 +01:00
Victor Kyriazakos
0a9717a4ed fix(gateway): a person's steer or redirect ends a plugin-injected turn's wait for background work
A plugin-injected turn that waits for the session's background review and
plugin forks stopped waiting only when a person's message was queued behind
it. A message accepted as a steer (steer mode or /steer) or as an
interrupt-mode redirect goes straight into the running turn and is never
queued, so the turn kept waiting, up to the full 120 s, before it
superseded the background work.

Every accepted steer and redirect passes through _fold_into_running_turn;
it now ends the session's plugin wait the same way a queued message does,
and the background work is cancelled as for any person's turn. Another
plugin's message still does not end the wait.
2026-11-13 17:24:06 -08:00
Victor Kyriazakos
adc181f27d fix(gateway): a person's message ends a plugin-injected turn's wait for background work
A plugin-injected turn waits up to 120 s for the session's running
background review and plugin forks before it starts. A person's message
that arrived while it waited queued behind that wait, so the person's
turn started up to 120 s late; a gateway shutdown sat out the same wait
past its drain budget.

The wait now ends at once when a person's input is queued for the
session behind the injected turn (checked on every admission's arrival,
and once when the wait begins), or when the gateway drains or the
profile retires. The background work is then cancelled the same way a
person's turn cancels it, and the FIFO order is unchanged: the injected
turn runs, then the person's.

The plugin LLM access guide states the rule and the shutdown behavior.
2026-11-13 17:24:06 -08:00
Victor Kyriazakos
0c9bfa304b fix(agent): a plugin-injected turn lets the session's running review and forks finish
A message a plugin injects started a turn that superseded the session's
running background review and plugin forks at once, the same as a turn a
person started: the user's own self-learning review ended with no result.

A turn the gateway runs for a plugin's FIFO admission now waits up to 120 s
for the review and the launched forks already running on that session, then
cancels whatever is still running. An interrupt of the session agent ends
the wait early. A person's turn is unchanged and supersedes them at once.
Running the turn alongside the review instead is not an option: they share
the session id, so their usage would be counted twice.

The plugin LLM access guide says plugins should not rely on an injected
turn to cancel background work.
2026-11-13 17:24:06 -08:00
Teknium
c711c2efe6 ci(plugin-catalog): maintainer allowlist for third-party tool downloads in the self-updater gate
The self-updater gate rejects any plugin script that both fetches from
GitHub and writes or renames files. rom-studio (#153798) trips it on
kit/kit.ts, which downloads the third-party poryscript 3.6.1 compiler
from its own release, checks a fixed sha256 and unpacks it into
kit/.cache. It never fetches or replaces rom-studio's own files, so the
pin stays the only update path (README rule 3).

Teknium ruled to allow it. A maintainer now lists such a file in
scripts/ci/catalog_self_updater_allowlist.json by repo, pinned sha, path
and the file's sha256: a re-pin, an edit to that file or a second
fetching file is gated again. The list lives under scripts/ci/, which an
entry PR may not touch (catalog_changed_entries.py), so a submitter
cannot add themselves. Rule 3 in both rule blocks names the exception.
2026-11-13 16:49:24 -08:00
Siddharth Balyan
b86c0b6878 fix(providers): reload an updated provider plugin in the running gateway
A provider plugin was imported once per process, and the forced plugin sweep
skips model providers, so an update never reached a running gateway. A plugin
importing part of its package on first use then ran one new file against
siblings loaded from the old tree (cannot import name ...), while the update
surfaces said nothing needed a restart.

The forced sweep now re-scans the profile's provider plugins; one whose tree
changed (catalog pin, else file mtimes) is dropped whole (package, submodules,
its profiles) and imported again. hermes plugins update reports activation like
install/enable, the gateway auto-apply tick reloads in-process, and a model
provider's activation summary says it was reloaded or why it failed.

Fixes #153300
2026-11-14 05:45:02 +05:30
Teknium
2fac320c17 docs(plugin-catalog): admission rule 20, no coin or token promotion
Catalog listings were being used to promote individual tokens (a listed
plugin's maker posting its contract address on X), and memecoin boards,
coin launchpads and airdrop farmers passed review on clean code alone
because no rule covered what a plugin is for. Rule 20 declines plugins
built around one non-mainstream coin, token or NFT collection and plugins
used to promote their maker's own token, while keeping stablecoins,
payments, multi-coin wallets and markets, tickers, safety checks and
Bitcoin/Ethereum/Solana-level assets welcome. Mirrored into the
catalog-submission guide (rules mirror test).
2026-11-13 16:05:56 -08:00
Victor Kyriazakos
1cec6709ae fix(gateway): plugin idle-task runs stop with gateway housekeeping
Idle-task workers were detached threads that always wrote the task's
state when the plugin's function returned, so a run still going when the
gateway stopped (or the multiplexer restarted in the same process) wrote
profile state after housekeeping had stopped.

Gateway housekeeping now polls idle tasks under a stop fence tied to its
stop event. Once housekeeping stops, no run starts under it; when the loop
exits it waits a bounded time (inside the housekeeping drain budget) for
its runs and returns. A run that ends after the stop records nothing: the
task's state stays as it was before the run, so the task runs again on a
later poll, and the run still releases its claim. Closing the fence waits
for a record in progress, so none lands after the stop. Plugin code cannot
be stopped; the idle-task contract now says so and states the guarantee.
Hosts without a stop (CLI/TUI startup, the serve maintenance tick) are
unchanged.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
d2fa5dcbc6 fix(idle): a dead owner's run claim is taken over at once
The idle-job run claim (curator and plugin idle tasks) recorded only the
owner's pid and was reclaimed only after an hour, so a gateway that crashed
or was killed mid-run kept the task suppressed for an hour after restart.

The claim now records the owner's pid, process start time and machine
(boot id + PID 1 start). A claim whose owner is gone, or whose pid now
belongs to a process with another start time, is taken over at the next
poll; a live owner's claim is never taken, however old. A claim whose owner
cannot be checked (a bare pid from an older Hermes, another machine, no
readable start time) keeps the hour rule. Takeovers and releases unlink the
lock under a cross-process guard file, so two claimants of a dead claim
never both win and a release never removes a claim another process took.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
aaf648e835 docs(plugins): mark fork_session and register_idle_task experimental
Both APIs may still change shape, so the plugin guide now says so and tells a
plugin how to stay portable: keep the fork handle in one small function that
returns plain data, and treat fork_session as optional. It returns None when
the request is refused, and under plugins.isolation: host it raises
PluginHostUnsupported, since the handle tracks a thread of the live session
agent inside the Hermes process.

The guide also states the idle-task contract: fn runs on its own thread and
the host does not wait for it, so a run should keep its own time limit, work
in small checkpointed batches and be safe to repeat.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
a7ac9bba45 fix(plugins): a slow plugin idle task no longer holds up the gateway's housekeeping
Plugin idle tasks ran synchronously on the thread that polled them. On the
gateway that is the housekeeping thread: it also stamps the runtime
heartbeat and runs the cron delivery drain, the misfire catch-up, the plugin
update check and state.db maintenance. An idle task that made model calls for
minutes stalled all of them, and after two minutes gateway status reported
the live gateway as wedged.

Each due task now starts on its own thread, carrying the poller's profile
home and secret scope, and the poll returns at once. The run claim still
keeps one run at a time across pollers and processes, and a run of this
process is never doubled even when it outlasts the claim's stale age. The
worker records the run and releases the claim when the task returns or
raises. The curator's own pass is unchanged.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
bfe4365cae fix(plugins): a session fork reaches its plugin's own tool when Tool Search defers it
Tool Search defers every plugin tool by default, so the session's tools[] carry the
tool_search / tool_describe / tool_call bridges instead of the tool, and a fork naming
its own tool was refused tools_not_in_session.

A requested tool is now in the session when its captured tools[] advertise it, or when
those tools[] carry tool_call and the name is in the session's deferred catalog (the
classification the session's own tool_call unwrap uses). For a deferred tool, core
appends one line to the prompt: call it through tool_call, with the tool's parameters.
tools[] stay the session's, byte for byte. Inside the fork tool_call is only a carrier:
the dispatch guard sees its unwrapped target, so a tool_call to an unrequested, foreign,
core or connector tool is denied, and tool_search / tool_describe stay refused.
handle.actions lists the carried tool.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
71acf56cc1 fix(plugins): a session fork holds only names that dispatch to its plugin's handler
Fork ownership came from the plugin registration ledger by exact name, but
the dispatcher serves some names before the tool registry: connector names
(connectors__<connector>__<tool>), the session's memory-provider tools, its
context-engine tools, agent-level tools, legacy aliases and the Tool Search
bridge. A plugin that registered such a name had it admitted to its fork
while the call reached a connector, memory provider or context engine.

pre_registry_route() in agent/inline_tool_executors.py now answers which
seam serves a name before the registry, using the dispatcher's own checks;
the sequential and concurrent paths read the memory-provider and
context-engine membership through the same helpers. The fork allowlist
admits a name only when that predicate returns None and the plugin owns
the live registration: at request time against the lease's session agent
(token unspent on refusal), and when the fork starts against both the
session agent and the fork that dispatches.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
142dd79a4a fix(plugins): a fork whose worker thread cannot start settles as error:spawn
_launch registered the job and marked it launched before building and starting
the worker, outside any exception handling. When spawn_context_thread or
Thread.start raised, the exception crossed fork_session's no-raise boundary,
the handle stayed running, the job stayed in the parent's registry and its
request exit was never published, so every later live turn spent the full
cancellation deadline waiting on a run that could never acknowledge. The
launcher now unregisters the job under the registry lock, publishes its
request exit and settles the handle error:spawn; fork_session returns that
settled handle.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
54fba0062e fix(plugins): a session fork holds only its plugin's own tools
A name deny list cannot classify tools it has never seen: another plugin's
a2a_call or meet_join starts a remote agent task or a detached worker, and an
MCP tool can trigger server-initiated sampling, all outside the fork thread's
tool whitelist and auto-denied approvals. The fork allowlist is now built from
ownership instead: the tools whose live registration is the requesting
plugin's (newest active ledger entry per name), plus core tools marked
fork-safe in FORK_SAFE_CORE_TOOLS (empty). A name dispatch reroutes before the
registry (inline agent tools, legacy aliases, the Tool Search bridge) never
counts as the plugin's own. Naming any other tool returns None with the token
unspent, and the dispatch guard reads the allowlist again when the fork starts.

background_review extra_tools is operator-configured and goes back to its
previous behavior; the consent text says the fork uses the plugin's own tools.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
68e7150ed2 docs(plugins): fork cancellation and timeout are cooperative; list every refusal outcome
The next-turn cancel and timeout interrupt the fork and the handle settles when its
worker exits, so a provider call that ignores the interrupt keeps the handle open.
refused:parent_gone joins moa, agent_provider and runtime_changed in the outcome list.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
18a2118b4f fix(plugins): inheriting a built-in auxiliary slot's route needs llm.allow_task_override
A plugin task could inherit_from any core auxiliary block and resolve to its provider,
model, endpoint and key, so a plugin without allow_task_override could still spend
through an operator-configured built-in route (background_review, curator, ...) by
naming its own inheriting task. Read-time resolution now carries a core base's route
fields (provider, model, base_url, api_key, api_mode, key env, reasoning_effort,
extra_body, fallback_chain) only when the owning plugin holds allow_task_override,
including through a chain of plugin tasks rooted in a core block; non-route policy
such as timeout still inherits. inherit_from accepts the picker tasks plus an explicit
list (background_review, curator) instead of every current and future core block.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
843e9188e0 fix(plugins): the next live turn cancels deferred and starting session forks
Only launched forks were registered on the parent, so the next turn's interrupt missed a
fork still queued for machine idle (the idle dispatcher launched it later) and one between
_launch's cancel check and its registration. Every fork is now registered on its parent
from the moment it is deferred or launched; the interrupt fences all of them, settling a
never-launched fork as cancelled, releasing its idle-queue slot and publishing its request
exit. _launch checks and registers under the same lock, and the interrupt records the turn
it fenced, so a fork of that turn reaching registration afterwards is refused.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
ff5f6014de fix(plugins): a session fork never holds a tool that starts another agent loop
delegate_task, message_agent, cronjob_manage and the Kanban moves that hand a task to a
dispatched worker run their loop outside the fork thread's dispatch guard: a delegate
child is built from the parent's toolsets and its worker enters through a copied context
that carries neither the thread-local whitelist nor the auto-deny approval callback.
fork_session now refuses a tools= list naming one (None, token unspent), the fork's
dispatch whitelist drops them however the job was built, and background_review
extra_tools ignores them with a warning.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
828a51d4d2 fix(plugins): inherit_from accepts any core auxiliary block, including background_review
register_auxiliary_task only accepted picker tasks (main_provider_setup._AUX_TASKS) or
plugin-registered keys as an inherit_from base, so inherit_from="background_review" was
silently dropped and a plugin fork's task= lane ran on the session model instead of
following auxiliary.background_review. Any dict block under DEFAULT_CONFIG["auxiliary"] is
now a valid base, resolved at read time like the others.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
3845dbb76c feat(plugins): ctx.register_idle_task runs a plugin job on the curator's idle schedule
A plugin with session-less background work (re-scoring its own data,
suggesting a cleanup) had to run its own timer. register_idle_task(name, fn,
*, interval_hours, min_idle_hours=2, first_run="defer") puts it on the skill
curator's scheduler instead:

- polled from every site that drives the curator (gateway housekeeping per
  served profile, CLI/TUI startup maintenance, the hermes serve maintenance
  tick) through one run_idle_jobs(): the curator, then the active profile's
  plugin tasks;
- the curator's gates via agent/idle_schedule: the min-idle check, the
  interval (floored to 1 h) whose first observation seeds last_run_at and
  defers one interval (first_run="immediate" opts out), and the O_EXCL claim
  file so a task never overlaps itself across threads or processes;
- state per (profile, plugin, task) in <plugin data dir>/idle-tasks/<name>.json
  (last_run_at, run_count, paused, last_summary, last_status, last_error);
  a manager polled outside its own home runs nothing;
- exceptions are logged and recorded, never raised into housekeeping;
- the registration is a PluginRegistration, so unload stops the polling;
- `hermes plugins idle-tasks [plugin] [--pause TASK | --resume TASK]`.

fn receives plain data (name, idle_for_seconds, last_run_at, run_count) and
reaches its ctx through its closure, so the payload also crosses the isolated
plugin host. No capability: the scheduler only calls the plugin's own
function; model calls inside it go through ctx.llm's existing gate.

plugins.py and gateway/run.py are over the file-size cap, so the mixin lives
in hermes_cli/plugins_idle_tasks.py and neither file grows.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
32f9c1f6b3 feat(plugins): ctx.fork_session runs a bounded background copy of the session agent
Hermes' own background review (fork the live agent after a turn, run a
bounded multi-step prompt with a narrow tool list, cancel on the next live
turn) is now open to plugins as ctx.fork_session(token, prompt, *, tools=(),
max_iterations=8, input_budget=None, task=None, timeout=None), gated by the
new consent-only capability llm.session_fork.

Reused, not copied:
- Lease: post_llm_call's side_question_token backs a side question OR a fork
  (side_question_lease.take_lease; same TTL, turn_moved_on, profile fence,
  no token for unattended turns, one redemption per turn). The payload field
  keeps its name for compatibility.
- Fork: build_cache_parity_fork(write_origin="plugin_fork:<id>") on a
  context-bound thread in the captured turn context; same-model forks replay
  the captured system prompt and tools[] byte-for-byte; routed forks get the
  history digest. Persistence stays fully detached.
- Guardrails: the thread tool whitelist is the requested names (each must
  already be in the session's tools[]); approvals auto-deny; the review's
  input budget (a plugin can only lower it) and iteration cap (<= 16);
  _BackgroundReviewRun admission so cancel_background_review_for_live_turn
  interrupts plugin forks with the review under one bounded wait;
  review_idle_queue deferral on the managed local runtime (enqueue takes a
  dispatch callable; a newer fork of the same plugin supersedes the queued
  one).
- Routing: task must be one of the plugin's register_auxiliary_task lanes,
  resolved like auxiliary.background_review.
- Usage and hooks: release_cache_parity_fork bills the parent session as
  plugin_fork:<id>; each fork loop request reports pre/post_auxiliary_call
  (aux_task="plugin_fork", plugin_id) instead of pre/post_api_request.

Tool handlers inside the fork receive turn_origin="plugin_fork:<id>"
(live calls get no new kwarg), so a plugin can refuse calls from the live
agent. The handle exposes done/cancelled/outcome/result/actions/wait/cancel,
never the fork agent. Fails closed (None) without the capability, on a bad,
expired, spent or foreign token, a tool the session does not advertise, or
a task the plugin does not own.
2026-11-13 15:30:30 -08:00
Victor Kyriazakos
674412b1fa feat(plugins): post_llm_call carries review_signals, the self-learning cadence
post_llm_call gains a read-only review_signals mapping: the skill and memory
nudge counters, both intervals, whether each review trigger fired this turn
and whether a due trigger actually forks the background review (enabled in
config, not cron, not a subagent).

A plugin doing its own after-turn work (Collective Wisdom's share
suggestion) can then follow the cadence the user already tuned instead of
counting tool calls itself.

The hook fires before the review decision, so the finalizer now evaluates
the skill trigger once (agent/review_signals.py::skill_review_due) and hands
the same boolean to the hook and to the spawn; the memory trigger was
already decided at turn start. The mapping is a dict subclass that refuses
mutation (one instance reaches every callback) and stays a plain dict on the
plugin-host wire and through copy/pickle. Computed only when post_llm_call
has a subscriber.
2026-11-13 15:30:30 -08:00
Maciej Lisiewski
ba850b39e4 Merge pull request #154637 from NousResearch/sec/46006-public-share-summary
fix(debug): public debug paste is an allowlisted summary; full logs only via --nous
2026-11-13 22:42:58 +01:00
John Paul Soliva
5778b814b3 fix(gateway): restored relay-backed sessions resume through the relay that fronts them
A relayed source keeps its logical platform and marks relay provenance with the
wire-invisible delivered_via_upstream_relay flag, which is never persisted. The
Relay is registered under Platform.RELAY. After a restart a restored source
matched no adapter in _delivery_adapter_for, so startup auto-resume skipped the
session ("adapter not ready") and left it resume_pending; restored heartbeats and
plugin message injection hit the same selector and were dropped.

_delivery_adapter_for now falls back to the Relay in the receiving profile's
adapter map when no native adapter serves the platform, using the
resolve_delivery_transport rule (native wins; Relay only when its transport
advertises the platform). Only the primary serves the Relay, so a lane received
by a secondary bot that is offline still fails closed.

The revival paths (auto-resume, heartbeat poll, plugin injection) warm the
Relay's per-chat egress routing from the restored source before dispatch, since
those caches fill only on live inbound and the connector declines replies
without the tenant discriminators. A reconnecting Relay also resumes the pending
sessions of every platform it fronts instead of matching Platform.RELAY against
their logical platform.

(cherry picked from commit af9afba4759a610005d08447a920eed316a19286)
[adapted onto main: retain detached delivery, receiving-bot checks and routed-primary native fallback]

(cherry picked from commit b42790d068066974ee5b19c32f5458d71844891d)
2026-11-13 15:40:52 -05:00
alt-glitch
389cb74194 docs(plugins): publish create, restore and finish by name
A module entry in plugin_api.json also publishes the module's imports (logging, os, sys,
Path). The list now names the three functions, and the docs example imports them by name.
2026-11-14 01:24:46 +05:30
alt-glitch
83186333c9 refactor(cli): the -w worktree of a chat session is three functions any launcher can call
The Ink launcher made, restored and finished the `-w` worktree with private code, so a plugin
that starts its own chat client could not offer `-w`, and a tree it made with `git worktree add`
can be removed by the stale-tree sweep. That code moves into `hermes_cli/session_worktree.py` as
`create()`, `restore(session_id)` and `finish(info, session_id, ask=...)`; the Ink launcher and
`hermes_cli/main_resume_args.py` now call them, with the same questions and messages. The module
is listed in `hermes_cli/data/plugin_api.json` and the generated public API page.
2026-11-14 01:24:46 +05:30
alt-glitch
9f6f0df93a docs(plugins): the chat-client example works without HERMES_HOME; publish the two functions by name
The example read os.environ["HERMES_HOME"], which a Hermes started as a console script
on the default profile does not set. It now calls get_hermes_home(). The section says the
launcher command needs plugins.isolation: in_process. plugin_api.json lists hermes_command
and print_exit_summary by name, so the module's imports are not published with them.
2026-11-14 01:24:46 +05:30
alt-glitch
8c35998e68 feat(plugins): a plugin's own chat launcher can get this install's command, the shell's client_env and the exit summary
A plugin that starts its own chat client had to copy three private pieces of the Ink launcher by
hand. The new module hermes_cli/chat_launch.py holds two of them: hermes_command() returns the argv
that runs this install, and print_exit_summary() prints the resume lines with the caller's command
name. The Ink launcher now calls print_exit_summary with "hermes --tui", so its output is unchanged.
hermes_cli.chat_launch and hermes_cli.gateway_chat:shell_client_env join the public plugin API list.
2026-11-14 01:24:46 +05:30
alt-glitch
f8f2cfba44 docs: session.list's cursor, query and the session-list-cursor-v1 capability
The gateway local sessions guide now tells client authors how the stored scope's `query`,
`cursor` and `next_cursor` work, which calls are refused, and that a later page may repeat a
row when the store changes between calls. The programmatic integration page names the new
fields and the capability.
2026-11-14 01:21:49 +05:30
Maciej Lisiewski
4ff2d29288 fix(debug): consent copy from main describes the summary, not full logs
The confirmation dialog, dashboard API row and /debug parity verdict that
landed with the consent gate (#94876) still said the public paste carries
full logs; after the allowlisted summary it never does.
2026-11-13 20:20:46 +01:00
Maciej Lisiewski
16c0e2a5b3 Merge pull request #154567 from NousResearch/sec/145968-memory-claim-cross-home
fix(memory): refuse a cross-home claim on a live provider instance (#146293)
2026-11-13 18:58:09 +01:00
Maciej Lisiewski
3ab3b20b48 Merge pull request #154503 from NousResearch/sec/126755-a2a-callback-ssrf
fix(a2a): put push callbacks behind the shared SSRF guard
2026-11-13 17:30:19 +01:00
BearHuddleston
69a1ad5c08 fix(bundles): refuse a macOS update ZIP of 1 GiB or more
v0.22.0 ships Electron 40, whose Squirrel.Mac reads the whole update
ZIP into one NSData. From 1 GiB, CFData's growth asks Electron's
allocator for 2 GiB, which refuses, and the app dies with SIGTRAP
partway through the download (electron/electron#55089, fixed in
Electron 44.7). Measured with the real signed v0.22.0 app on macOS: a
1,070,000,000-byte ZIP downloads, a 1,080,000,000-byte one crashes it
at 1,076,887,552 bytes. rc.2-v0.23.2 shipped a 1,447,529,425-byte ZIP
and its macos-packaged-arm64 upgrade job crashed exactly this way.

Recording a macOS build now refuses a ZIP of 1,073,741,824 bytes or
more and prints the margin otherwise, so an oversized build fails in
its own job instead of in the upgrade gate or on users' Macs.
2026-11-13 10:17:50 -06:00
BearHuddleston
e9607bf4e9 perf(bundles): leave Chromium out of the macOS bundle; install it on first use
v0.22.0 on macOS cannot update in-app to a bundle whose update ZIP is
1 GiB or more: its Electron 40 Squirrel.Mac reads the whole ZIP into one
buffer and dies past 1 GiB (electron/electron#55089). The rc.2-v0.23.2
ZIP is 1,447,529,425 bytes, and its Chromium alone is 177 MB compressed.

Chromium is already an optional default: `install.sh --skip-browser`
declines it, and the browser tool installs PM's pinned build once per
process when none is found (browser_launcher._maybe_autoinstall_chromium,
under security.allow_lazy_installs). On a sealed payload that install
lands in the writable store (tests/pm/test_store_extensions.py).

The macOS payload now leaves it out, so the first browser use downloads
it (195 MB). Windows and Linux bundles still ship it.
2026-11-13 10:17:18 -06:00
BearHuddleston
96e4107167 perf(bundles): ship the payload uv cache's venv-identical files once, as links
Some checks failed
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
Skills Index Freshness Check / check-freshness (push) Has been cancelled
Skills Index Freshness Check / check-catalog-cors (push) Has been cancelled
Docs Search Monitor / probe (push) Has been cancelled
Build Skills Index / build-index (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
v0.22.0 on macOS cannot update in-app to any bundle whose update ZIP is
1 GiB or more. It ships Electron 40, whose Squirrel.Mac reads the whole
ZIP into one NSData; past 1 GiB CFData asks Electron's allocator for
2 GiB, which refuses, and the app dies with SIGTRAP (electron/electron
#55089, fixed in Electron 44.7). Measured with the real signed v0.22.0
app: a 1,070,000,000-byte ZIP downloads, a 1,080,000,000-byte one kills
it. The rc.2-v0.23.2 ZIP is 1,447,529,425 bytes.

Most of that is the payload uv cache shipping a second copy of the
venv: 31,771 of its archive-v0 files (297 MB compressed) are byte for
byte the venv's installed files.

Off Windows, staging now replaces each archive-v0 file the payload venv
holds byte for byte with a relative link to the venv copy. Files the
installer rewrote (RECORD) or placed elsewhere (.data) stay. The uv
seed recreates links that stay inside the cache, as before, and copies
the bytes of a link that leaves it, so the machine cache keeps no link
into a payload an update will replace. MSIX packages hold no links, so
Windows is unchanged.
2026-11-13 10:16:38 -06:00
Maciej Lisiewski
7d94f141b7 fix(a2a): put push callbacks behind the shared SSRF guard
is_safe_callback_url compared the host text against private prefixes, so
integer/hex IPv4 literals (http://2852039166/) and DNS names resolving to
metadata or RFC1918 passed; urlopen then followed redirects the check never
saw and re-resolved the name for the socket.

Non-loopback callbacks now go through tools.url_safety: is_safe_url for the
pre-flight (resolves and checks every answer) and create_ssrf_safe_client for
the POST (connect-time re-validation, dials the vetted IP). Redirects are not
followed. Loopback stays allowed only in localhost-only mode, proxy-free.
create_ssrf_safe_client joins the published plugin API next to its async twin.

Fixes #126755
2026-11-13 16:56:09 +01:00
Maciej Lisiewski
ef34b140a6 test(memory): pin no-weakref claim release; drop dead _Recording check
Drop the never-instantiated _Recording subclass whose assertion could not
fail, end the slots test by dropping alpha's managers and rebinding to beta
(kills the strong-manager-ref and no-cleanup mutants), and say in the plugin
docs that the shared-instance refusal applies on any multi-profile host.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-13 16:54:40 +01:00
Maciej Lisiewski
13f0fd8e51 Merge pull request #154512 from NousResearch/sec/126294-media-redirect-ssrf
fix(gateway): re-check every redirect hop for Mattermost and Weixin media downloads
2026-11-13 16:21:27 +01:00
Maciej Lisiewski
d352a19670 docs(debug): document debug-share consent, parity verdict and 1-day --expire default
Refs #94876
2026-11-13 14:05:03 +01:00
Maciej Lisiewski
f69a049eae fix(gateway): serve the aiohttp redirect guard from gateway.platforms.helpers
The Mattermost and Weixin plugins imported tools.url_safety.ssrf_checked_aiohttp_get,
a core name outside the published plugin API, which raised two new module_to_core
crossings in scripts/boundary_lint.py. Move the helper next to platform_http_client
in gateway.platforms.helpers (already published), keep tools.url_safety's
async_is_safe_url as the per-hop check, and document it under the platform-adapter
public helpers. No baseline change.
2026-11-13 13:57:43 +01:00
Sahil-SS9
6600bde0d9 feat(plugins): ctx.redact_text() so plugins scrub secrets without importing agent.redact
Plugins that store or upload text (session sharing, edit capture) need Hermes's
own scrubber at its strongest setting, and today the only way is a private
import of agent.redact, which the catalog flags. Add a thin PluginContext
method: non-reusable sentinels for prefixed keys, masked credential
assignments, plugin-registered patterns included, security.redact_secrets
honoured unless force=True.
2026-11-13 00:56:05 -08:00
Teknium
4f2fd3b8c0 fix(plugin api): publish hermes_cli.urllib_security:open_credentialed_url
The redirect-safe opener (drops credential headers when a redirect leaves
the origin) is what plugins sending API keys should use, and the bundled
model providers already do; validate still warned on it as a private
import. List it in plugin_api.json with a short docs section, regenerate
public-api.md, and drop the three now-public crossings from the
boundary-lint baseline.
2026-11-12 22:33:52 -08:00
Teknium
4bad741311 fix(file_safety): published read check refuses device and /proc files
get_read_block_error is the path check plugins are told to call, but only
read_file consulted the device/proc table, so a plugin following the docs
could still read /proc/<pid>/environ (process secrets) or hang on /dev/zero.
The path-only table and is_blocked_device_path move into agent/file_safety;
get_read_block_error checks the literal and resolved path; read_file keeps
its symlink-hop walk and imports the table from there.
2026-11-12 22:33:52 -08:00
Maciej Lisiewski
232e4e7d6d Merge pull request #153681 from NousResearch/sec/91308-aux-openai-key-host-gate
fix(aux): gate OPENAI_API_KEY on OpenAI hosts for custom endpoints
2026-11-12 22:23:57 +01:00
BearHuddleston
3944af0ea3 fix(bundles): build the Webapp in source desktop bundles too
Some checks failed
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
Skills Index Freshness Check / check-freshness (push) Has been cancelled
Skills Index Freshness Check / check-catalog-cors (push) Has been cancelled
Docs Search Monitor / probe (push) Has been cancelled
`pnpm run dist:bundled` stages its payload through scripts/bundles/stage.py,
not the prepared desktop builder. Its automatic route compiled only the TUI
and dashboard, so a payload stamped `bundled` shipped no Webapp and
`hermes webapp` stopped at "This desktop app ships no Webapp renderer".

Install the Desktop workspace in the frontend snapshot, compile the Webapp
there and pass it to stage_native. The native staging child takes its
products as flags and only knew --tui/--web, so it also learns --webapp;
without that, handing it the Webapp exits 2 on an unrecognized argument.

The regression test runs stage.main through the real stage_native argv into
native.main and asserts the planted payload: red on the PR head (no
dist-webapp), red with stage.py alone changed (argparse exit 2).

Reported by @kvnloo on #154325, whose b294b532 changed stage.py the same way.

Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com>
2026-11-12 14:16:57 -06:00
BearHuddleston
e94a35ca6c fix(webapp): serve a desktop bundle's prebuilt renderer as shipped
`hermes webapp` and the Desktop's Web Access Start reuse a renderer only
when scripts/build/freshness.mjs certifies it, and a bundle's sealed
payload ships no scripts/. Even with the Webapp planted they took the
build lock in the install root (Permission denied inside WindowsApps; a
lock file written into the signed macOS app) and then tried to build
from sources the payload does not have.

A bundled payload (install stamp payload "bundled") now serves its
planted dist-webapp as it is, like the Nix package's HERMES_WEBAPP_DIST:
no freshness check, no lock, no build, and --force-build says it cannot
be rebuilt. The Termux .deb stamps payload "runtime" and is unchanged.
2026-11-12 14:16:57 -06:00
Maciej Lisiewski
75db00e04c docs(aux): OPENAI_API_KEY fallback now reaches OpenAI hosts only
Follow-up to the host gate: four more places still promised an
unconditional OPENAI_API_KEY fallback for custom endpoints.
2026-11-12 15:55:53 +01:00