Commit Graph

3747 Commits

Author SHA1 Message Date
Teknium
08a7c25eec docs(skills): regenerate skill pages and the prompt-surface snapshot
Output of website/scripts/generate-skill-docs.py and
scripts/ci/prompt_surface.py render after the skill moves. The default
skills index loses 15 lines (14 skills leave the built-in set, three
become microsoft-office).
2026-10-28 21:24:43 -07:00
Teknium
6fdc365d4b refactor(skills): fold docx, powerpoint and xlsx into one microsoft-office skill
One built-in skill now covers Word, PowerPoint and Excel: SKILL.md
holds the shared documents-environment block, PDF export and the
cross-format pitfalls once, and routes to references/word.md,
references/powerpoint.md and references/excel.md for each format's
flags, procedure and traps. The scripts and their tests move unchanged
into one scripts/ and tests/ directory (62 tests pass). Every skill,
doc and tool message that named the old three now names
microsoft-office.
2026-10-28 21:24:43 -07:00
Teknium
183b5ddd5f chore(skills): move niche built-in skills to optional
These stop loading by default and become one
`hermes skills install official/<category>/<name>` away:
notion, airtable, box (hosted connectors cover them for Portal users),
opencode, design-md, gif-search, songsee, llm-wiki,
hermes-agent-skill-authoring, inspecting-hermes-desktop-dom,
node-inspect-debugger and python-debugpy.

Existing installs keep their copies: the skills sync already re-labels
a byte-identical copy of a moved built-in as an official optional
install. Onboarding first tasks drop the two skills that are no longer
bundled (llm-wiki, design-md), claude-design and popular-web-designs
point at design-md as an optional install, and doc examples use
skills that still ship.
2026-10-28 21:24:43 -07:00
Teknium
9347107cdb chore(skills): drop optional skills that official sources now cover
Removes 15 optional skills:
- huggingface-hub, trl-fine-tuning: Hugging Face's own hf-cli,
  trl-training and huggingface-llm-trainer skills ship through the
  default huggingface/skills tap, and the Hugging Face MCP is in the
  MCP catalog.
- whisper, stable-diffusion, llava, clip, audiocraft: core already
  covers them (local faster-whisper STT, image_generate, vision_analyze,
  the official ElevenLabs music and sound-effects plugins).
- pinecone, pinecone-research, qdrant, weights-and-biases: each vendor
  maintains its own skills repo; wandb/skills, qdrant/skills and
  pinecone-io/skills become default, trusted taps so the topic still
  shows up in `hermes skills browse`.
- guidance, outlines, instructor, huggingface-tokenizers: library
  cheat-sheets untouched since import; provider APIs do structured
  output natively and models write this code unaided.
2026-10-28 21:24:43 -07:00
kshitijk4poor
c73b595460 fix: register approvals.discord_prompt_timeout in the default config
The Discord adapter reads `approvals.discord_prompt_timeout` (default
300). The Discord docs tell users to raise it, but the key was missing
from DEFAULT_CONFIG. `hermes config` never showed it, and migration
never added it.

It is now registered with its 300 s default, next to
`approvals.timeout`. The reader, its clamping and its behaviour are
unchanged. config_defaults.py may not grow, so a three-line comment
that repeated the block comment above (why `timeout` defaults to 300)
is dropped. The approvals key table in the security guide gains a row
for it.

New invariant test: the default appears through `load_config`, and a
value written to the profile's config.yaml reaches both `load_config`
and the Discord views' reader. It fails before this commit.

Raised by review of #145948.
2026-10-29 09:45:17 +05:30
Teknium
43ee1b0872 revert(plugins): Desktop, Webapp and dashboard installs take every source the CLI takes
Maintainer ruling: Desktop and the Webapp must keep installing private
plugins. The https-only source rule this branch added
(guiInstallSourceRefusal in the native install IPC, gui_install_source_refusal
in plugins.manage install and POST /api/dashboard/agent-plugins/install)
refused git@/ssh:// private repos, http:// and file:// local folders. It
goes, with its tests, and the user guide says Install from Git takes any
git source `hermes plugins install` accepts.

The symlink / plain-tree / 64 MB refusal in publishDesktopTree, the
reconcile refusal report in the install dialog and the forced-reinstall
fix stay.
2026-10-28 19:53:28 -07:00
Teknium
12944611f0 fix(plugins): Desktop and Webapp agent-plugin installs clone https only
plugins.manage install (native Desktop, the Webapp) and the dashboard's
POST /api/dashboard/agent-plugins/install handed any identifier to
dashboard_install_plugin, so a click could clone a file:// folder, an
ssh/git@ source through the host's ssh-agent, or plain http://. Both GUI
doors now refuse a non-https custom source before cloning, through one
helper (gui_install_source_refusal). A catalog_name install clones the
catalog's own source and is unchanged; `hermes plugins install` keeps
every scheme it documents.
2026-10-28 19:53:28 -07:00
Victor Kyriazakos
a8b987aaa1 fix(bedrock): apply configured request timeouts to Bedrock clients
providers.bedrock.request_timeout_seconds and
providers.bedrock.models.<model>.timeout_seconds resolved correctly through
hermes_cli.timeouts.get_provider_request_timeout, but no Bedrock client was
built with the result. The cached boto3 bedrock-runtime client (ambient and
profile-scoped) was created with no botocore Config, so it kept botocore's
60s read / 60s connect, and the AnthropicBedrock SDK client was built with
_client_timeout(None), i.e. a fixed 900s read. The resolver (3143d32330)
landed after the cached Converse client (0cb8c51fa5) and was wired only into
the OpenAI-wire and native Anthropic builders; 611657487f documented Bedrock
as not covered instead of wiring it.

- _get_bedrock_runtime_client(region, model) resolves the model's timeout
  (model over provider) and passes Config(read_timeout=..., connect_timeout=60)
  only when one is configured; unset or invalid builds the exact
  no-Config client used before.
- Both client caches (ambient and per-profile-home) key on the effective read
  timeout, so models with different overrides in one region never share a
  client, and the same timeout reuses one client. Stale-connection eviction
  drops every timeout slot of the region.
- converse/converse_stream dispatch picks the client from the request's
  modelId, so a /model switch or a fallback to another Bedrock model uses
  that model's timeout. call_converse and the context probe pass their model.
- AnthropicBedrock: build_anthropic_bedrock_client takes the timeout; the
  bound client and the per-request client key carry the active model's
  value (connect stays 10s, unset stays 900s).
- Docs: replace "not currently wired for AWS Bedrock" with what is wired.

This closes a configuration gap only. A socket read timeout bounds each read,
not the whole call; retry policy and the stale detector are unchanged.
2026-10-28 19:51:15 -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
Victor Kyriazakos
cf6623e433 fix(gateway): resolve delegation mode from configured interim and keep the pinned mode across refreshes
A scheduled heartbeat muted interim messages by rewriting the turn's display
settings, and the agent build read that muted value to freeze the session's
delegation mode. Heartbeats run under the user's session key, so on a cold
agent cache a heartbeat built (and cached, and pinned) an inline agent for an
interim-on chat, and the user's later turns ran inline. The heartbeat rewrite
no longer touches interim: TurnRunner already drops interim messages for a
heartbeat turn, and the TurnContext keeps the chat's configured value, which
is what a fresh agent's delegation.gateway_mode reads.

A fresh agent restored its session's tools[] pin (schema bytes) but kept the
build-time inline flag, so the next rebuild from fresh definitions
(compaction boundary, /reload-mcp, Bot Chat refresh) re-derived the other
variant and flipped the chat mid-conversation. restore_agent_tool_prefix now
re-freezes the flag from the restored delegate_task, making the pin
authoritative.

Docs: inline turns past the notify interval still get the long-running
notice (display.long_running_notifications); the stability sentence now
names compaction, /reload-mcp and heartbeats, and the post-update exception;
a deferred delegate_task (tool_search.defer) stays background.

Tests: heartbeat-first turn with an agent cache (interim on stays
background, control, interim off stays inline), a composed cell with agent
cache + real SessionDB pin + heartbeat + restart, and pin restore followed by
a compaction or /reload-mcp refresh in both directions.
2026-10-28 19:35:16 -07:00
Victor Kyriazakos
fa2befeed7 fix(gateway): join delegations in the turn when interim messages are off
On a messaging chat with display.interim_assistant_messages off, a top-level
delegate_task still produced two messages: a "checks are running, I don't have
the findings yet" reply and, later, the real answer. Top-level model
delegations always run in the background (ea8a8b4af8), and the tool text tells
the model to "give a one-line status and END YOUR TURN" (c89f3b8800). That
status is the turn's final answer, not interim text, so no display setting
held it back.

New key delegation.gateway_mode: auto | inline | background (alias async).
auto (default) joins the children inside the turn on a messaging chat whose
resolved interim setting is off (global, display.platforms.<p> override or
platform default). The parent waits in the tool call, gets the results there
and sends one answer. API, local and webhook surfaces keep the background
path under auto. Chats with interim messages on are unchanged: same schema
bytes, same async dispatch.

How it works:
- The gateway resolves the mode from the turn's own profile-scoped config
  when it builds a session's agent (gateway/session_execution.py), and the
  agent's first tool build freezes it (like the one-shot pin).
- An inline session carries the joined delegate_task variant the one-shot
  path already uses: "results return in this tool call", no live-control
  parameters, no END YOUR TURN.
- Dispatch follows the delegate_task schema the session carries
  (session_joins_delegation), so schema and behaviour cannot disagree. The
  schema rides the session's tools[] pin: a config change applies from the
  next session (/new), as delegation.backend does, and a cache eviction or
  restart never flips a running chat.
- Inline children run on the existing synchronous path: attached to the
  parent, so /stop and an interrupting follow-up stop them; the per-child
  heartbeat keeps the parent's activity fresh for the inactivity watchdog;
  the async completion registry is not used. Nested and one-shot delegation
  are unchanged.

Refs #95522.
2026-10-28 19:35:16 -07:00
Victor Kyriazakos
31d5f1d44d feat(whatsapp): log delivery and read status of sent messages to gateway.log
Baileys reports the delivery status of messages Hermes sends
(`messages.update` with `update.status` in 1:1 chats, a per-recipient
`message-receipt.update` in groups), but the bridge only handled poll
updates there, so operators could not see whether a reply was delivered
or read.

The bridge now queues a `delivery_status` event for status changes of its
own sends (tracked IDs only, so messages typed on the linked phone are
never reported). The adapter logs one gateway.log line per change and
never dispatches it as an inbound message.
2026-10-28 19:34:11 -07:00
Victor Kyriazakos
e240d617e8 feat(sessions): refresh-prompts lets continuing sessions adopt updated prompt sources
A continuing session replays its stored system prompt verbatim on every turn
so the provider prefix cache stays warm. The gateway restores that prompt from
the session row on each fresh agent, and warm cached agents keep it in memory,
so SOUL.md edits, new or edited skills and project-context changes never
reach a long-running conversation until /new, which also drops the history.
Operators who push profile updates and restart the gateway had no way to make
existing conversations pick them up.

`hermes sessions refresh-prompts [--session ID] [--json]` records a refresh
epoch in the profile's state.db (state_meta, one counter orders profile-wide
and per-session requests). At the start of a continuing session's next turn,
_restore_or_build_system_prompt compares that epoch with the one stamped in
the session's model_config when its prompt was built. When the stored prompt
is older it follows the Bot Chat capability-refresh precedent in the same
function: tools[] pin restored first, skills prompt cache and snapshot
cleared, prompt rebuilt through _build_system_prompt (memory reloaded and
plugin sections re-rendered, as at a compaction boundary), cache break
recorded, on_session_start not fired, new bytes and epoch persisted so the
following turns restore them verbatim. One cache break per request.

Warm agents (gateway agent cache, TUI/Desktop) run the same check from
build_turn_context against the epoch they saw when their prompt was set, so
the verb works with the gateway running. A session first built after a
request is stamped with it and does not rebuild again.

With no request recorded, the stored prompt is reused byte-identically. The
only added work per continuing turn is one state_meta point read. No file
scanning, no config key, no watcher, no mid-turn mutation.

The tools[] pin is kept on purpose: the refresh is about instructions, and
tool changes already reach long sessions at the compaction boundary. The
cache break is recorded as the existing system_prompt_rebuild cause rather
than a new one, which would change the shared-metrics contract and schemas.

Related: #141154 (per-turn source hashing, alternative design), #74622.
2026-10-28 19:30:48 -07:00
Teknium
dc82bec3bd fix(skills): the sandbox document venv is built privately and published atomically
The no-Hermes fallback treated an executable bin/python as a finished
environment, but CPython creates it before ensurepip runs. A second
document task started in that window skipped creation, ran a pip that
did not exist yet, and its helper failed (8 concurrent fresh callers in
nousresearch/hermes-sandbox:desktop: 5/8 succeeded).

Each caller now builds into its own mktemp dir next to the target,
installs and verifies the imports there, then publishes it with
a symlink (os.symlink: atomic, fails if another caller already published); losers
delete their copy. A published env that no longer imports is replaced
with os.replace and removed. Same block in docx, xlsx, powerpoint, pdf,
excel-author, pptx-author and both OCR side environments.

Same 8-caller probe after the fix: 8/8 under dash and bash; 4
concurrent repairs of a broken env: 4/4, one env left.
2026-10-28 19:26:17 -07:00
Teknium
d202ddfda2 fix(skills): the tmux prompt wait needs no coreutils timeout
macOS ships tmux via Homebrew without GNU timeout, so the wait failed with 'timeout: command not
found' and the task was never sent. A bounded for/seq loop does the same 90 s wait in plain sh.
2026-10-28 19:26:17 -07:00
Teknium
30a8c50a6f fix(skills): document-skill setup works in the Docker sandbox; wait for the prompt before driving Hermes
- docx/xlsx/powerpoint/pdf and finance excel-author/pptx-author: when `hermes`
  is not on PATH (terminal in the default Docker sandbox image, which has no
  Hermes runtime) the shared setup block builds a venv under the sandbox home
  with the same pinned versions as the documents/documents-pdf extras, instead
  of calling `hermes pm environment` and leaving PY empty. Identical block in
  all six skills; the pdf helpers' missing-dependency hints point at it.
- pdf ocr-extraction: same sandbox fallback for the pymupdf and marker side
  environments; marker CLIs run from the interpreter's bin dir
  ("$(dirname "$PY")/marker_single"), which is not on PATH; helper examples
  use "$PY".
- hermes-agent skill: the no-tmux PTY recipe polls the log for the ❯ prompt
  before the first write (startup's terminal query flushes earlier input);
  tmux recipes poll capture-pane for the prompt instead of a fixed sleep 8.
- Regenerate the skill pages.
2026-10-28 19:26:17 -07:00
Teknium
4a8c01790a fix(skills): document skills share one PM-built side environment; pause before Enter in the no-tmux recipe
The six document skills each carried a copy of a venv bootstrap that ran
`python -m venv --clear` on a shared directory after an unlocked check, so two
agents could erase each other's install, and the pdf skill's optional installs
read a DOCS_ENV that was only set inside a branch.

`hermes pm environment NAME --extra E | --requirement R` exposes PM's existing
isolated environments (pm.ensure_environment) to shell callers: the identity
is re-checked under the environment's install lock, a rebuild lands in a new
generation published by an atomic selection, and the previous generation is
never deleted. It prints only the interpreter path on stdout. --extra reads
the extra's pins from pyproject.toml, so a Hermes update does not build a new
generation unless those pins change.

Every document skill now runs the same one-liner
(`hermes pm environment documents --extra documents --extra documents-pdf`)
when `python` lacks the libraries; the new documents-pdf extra carries
pdfplumber and pypdfium2. OCR libraries get their own named environments.

The no-tmux PTY recipe pauses 0.5 s between the text write and the Enter
write, like the tmux recipe, so the paste guard cannot read Enter as a newline.
2026-10-28 19:26:17 -07:00
Teknium
ad09ca5b44 docs(skills): regenerate skill pages for the document-skill and tmux recipe edits 2026-10-28 19:26:17 -07:00
Teknium
f4aa77a467 fix(browser): raw CDP applies the metadata floor in both guard branches; docs state what it covers
The cloud-metadata check on raw CDP ran only with the private-address
guard off, and only on a `url` param. With the guard on, an unlisted
method such as Network.loadNetworkResource fetched a metadata host or a
loopback URL from a public page, because only the page URL was checked.

Every CDP call now screens each `url` param and every http(s) literal
in its string params (function bodies, injected scripts, HTML) against
the metadata floor whatever the guard says. With the guard on, unlisted
methods also refuse private literals in their own params.

browser_exec still follows a page's own redirect or fetch to a metadata
address: the floor reads the URLs the agent writes, not the browser's
later traffic. security.md and browser.md now say that instead of
"refused on every route", and point at network-level IMDS blocking.
2026-10-28 19:07:59 -07:00
Teknium
62f79a434d docs(security): allow_private_urls guards cloud browsers and web tools, not the local sidecar
security.allow_private_urls: false refuses private URLs for web_extract, vision/media
fetches and cloud/CDP browsers, but browser_exec under a cloud provider routes them to
a local Chromium sidecar (browser.auto_local_for_private_urls, default true), and the
plain local Chromium with a local terminal skips the guard by design. Say so in the
security and browser docs, configuration reference, DEFAULT_CONFIG comments and
cli-config.yaml.example, and name auto_local_for_private_urls: false as the way to
refuse. Also correct browser.md's claim that redirects to private hosts are blocked:
routing is decided from URL literals, and a redirect stays on the cloud browser.
2026-10-28 19:07:59 -07:00
John Paul Soliva
35335aa726 docs(security): allow_private_urls never unblocks cloud-metadata endpoints
The opt-out section listed cloud-metadata destinations among what
allow_private_urls stops rejecting, and cloud metadata debugging as a use
case. is_safe_url keeps metadata endpoints blocked regardless of the
setting; say so in the EN page and the zh-Hans mirror.
2026-10-28 19:07:59 -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
e0c52c4fbf fix(plugins): catalog installs keep the inspected commit; older backends ask; partial installs need Force
Three follow-ups to the install dialog holding an install to the commit it showed.

- Catalog picks. The backend reloads the live catalog entry at Install, so a
  re-pin between the dialog's inspection and the click installed (and, through
  the one checkout, published the desktop half of) a tree nobody reviewed;
  the renderer sent no inspected_sha for catalog sources and neither the
  catalog install nor reuse of a disabled tree read it. Now the catalog
  install compares the commit it actually checked out with the inspected sha
  peeled through the clone (annotated-tag pins still install), a disabled tree
  is reused only at that commit (or its recorded tag pin), and catalog dialogs
  send it: the backend's inspect sha in the Webapp, the shown reviewed pin on
  native Desktop (whose Electron probe reads the branch tip). After a re-pin
  refusal the native dialog re-reads the catalog for the new pin. The record
  stays the catalog's pinned record. Electron's desktop clone uses the same
  reviewed commit and peels a tag pin.
- Older backends. A backend that refuses inspected_sha at admission is no
  longer retried without it behind the user's back: the dialog explains that
  this backend cannot guarantee the reviewed version is what gets installed
  (update it for that guarantee) and installs only on an explicit
  "Install anyway" (profile kept); Cancel installs nothing.
- Partial installs. Native Desktop on a remote backend could install the agent
  half at commit A, fail the desktop half (source moved), re-review to B and
  let a second Install put the desktop half down at B beside the agent half at
  A. That is now reported as a partial install (agent half in at A, desktop
  half not); Install stays disabled until Force reinstall, which replaces both
  halves with the version shown.
2026-10-28 17:21:32 -07:00
Teknium
e4b0ab2365 fix(plugins): retry only a real admission refusal; re-review a moved source
Two follow-ups to the install dialog holding an install to the commit it
inspected.

- An install is resent without `inspected_sha` only for an older backend's
  admission refusal: a JsonRpcGatewayError with code 4000 whose message
  opens with `validate_params`' prefix. Matching the text anywhere also
  matched a 5026 install failure that forwards a git server's clone error,
  so that server could get the reviewed commit dropped.
- A refusal because the source moved past the reviewed commit now carries a
  structured marker: the backend raises PluginSourceMoved and
  `plugins.manage` answers 5026 with `data.reason == "source_moved"` (agent
  install and `install_desktop`); Electron's desktop install returns
  `sourceMoved: true` when the reviewed commit cannot be checked out. The
  dialog answers it by dropping its inspection, reading the source again
  and naming the new commit; Install waits for it. Retry used to resend the
  old commit and fail the same way every time. A pin the user typed is not
  re-reviewed, and nothing from the stale review installs (the desktop half
  is skipped when the agent half was refused).
2026-10-28 17:21:32 -07:00
Teknium
2c64c7fdb7 fix(plugins): an install dialog installs only the commit it inspected
The dialog inspects a source and shows its commit, but the agent half
cloned the branch tip at Install time: a branch that moved in between put
down a tree nobody reviewed, and the desktop half copied out of that
checkout followed it. Native Electron's probe returned no commit at all, so
its desktop clone had the same gap.

- plugins.manage install takes `inspected_sha` (custom sources without a
  pin). The clone stays an ordinary branch checkout and is refused when its
  tip is not that commit: "The source changed since you reviewed it ...
  Re-open the install dialog". Not `ref`, which records a pin that refuses
  every later `update`; not a detached checkout at the old commit, which
  `git pull` cannot update. Catalog picks keep their pin.
- That install drops inspect's kept answer for the source, so re-opening
  the dialog reads the moved branch instead of the stale commit.
- Electron: probePluginRepo returns the commit it read; installDesktopPlugin
  takes it and installs exactly that tree (fetch + verify) or refuses.
2026-10-28 17:21:32 -07:00
Teknium
c95dfcb3ae fix(webapp): a tab installs a mixed package once; tag pins and read-only trees install
Review follow-ups on the Webapp desktop-plugin install:

- A package with an agent half was cloned twice from a browser tab: the agent
  install, then a second install_desktop clone into the folder the host's
  5-second scan also copies that package's desktop half into, so the clone
  could answer "already exists" or the two copies could be different commits.
  A tab's backend is the host that serves it, so the package lands where the
  tab's plugins load from: the desktop half now comes out of that one checkout
  through the host's reconcile, as native Desktop does with a local backend.
  install_desktop stays for desktop-only repositories.
- A catalog pin naming an annotated tag never matched the commit inspect
  reports. The clone now fetches the catalog's own pin (as the agent installer
  does) and requires HEAD to be the commit the dialog reviewed.
- The published folder no longer carries the clone's .git (nothing reads it),
  and removal / force replacement use rmtree_readonly, so a folder holding Git's
  read-only objects (a native or hand install) can be deleted on Windows.
2026-10-28 17:21:32 -07:00
Teknium
8c5895cec1 fix(webapp): a tab's desktop-plugin install takes only the reviewed https commit
Hardening on top of the contributor's Webapp install path (salvage #146132). A browser tab asks the
serving host to clone code onto it, so the host now decides what lands, not the tab:

- `ref` is required: the 40-hex commit the dialog showed (or the user's pin). The clone is checked
  out at exactly that commit and the halves are read from that checkout, instead of re-using a
  ten-minute inspection cache and installing whatever it named; a catalog install whose pin moved is
  refused. `forget_inspection` goes away with the cache dependency.
- https only: `file://` would copy any folder of the host, `ssh`/`git@` spends the host's keys,
  `http://` can be rewritten in transit. Native Desktop keeps those for a user at their own machine.
- The published tree may hold no symbolic link (a `desktop -> /anywhere` link in a repository
  published that host folder) and is capped at 64 MB.
- A standalone plugin's in-tree `.hermes-package.json` is dropped as Electron's installer drops it:
  only an installer writes the marker that pairs a folder with an agent package.
- `desktop_plugin_halves`: the helpers the installer shares become public names instead of
  wrapper functions around private ones.
- Renderer sends `ref: plan.ref ?? plan.probe.sha`.
- Tests: the contributor's installer/RPC/route cases now run through an https identifier at a real
  commit (only the clone's network leg points at the local repository); RPC cases folded into one
  round trip; two added invariants (https only, link escape), each proven red with its guard removed.
2026-10-28 17:21:32 -07:00
Decrux
abfe2876f3 feat(webapp): install a desktop plugin on the host that serves the tab
In the browser-hosted app, installing a desktop plugin dead-ended: the install dialog could inspect a
repository through the gateway (`plugins.manage inspect`, #145770) but had nothing to install with.
A desktop-only package answered "This package has nothing to install here." and the desktop half of a
mixed one was skipped with a toast, because the only clone lived in Electron
(`installDesktopPluginFromGit`). Since #145072 the Webapp *loads* whatever sits in
`<root>/desktop-plugins/`, so the last mile was missing: no way to put it there from the UI.

This adds `plugins.manage` `install_desktop` / `remove_desktop` — the backend half of that install —
and points the dialog at them when it is not running in Electron.

- `hermes_cli/desktop_plugin_install.py`: clones a repository's desktop half into the app-level
  `desktop-plugins/` root. Same resolution, folder name and package-marker rules as Electron, and the
  same staged-copy-then-rename publication under the root's writer lock, so a reconcile pass cannot
  copy a folder underneath it. The clone is held to the commit the inspection read, so a repository
  that moves after review cannot install a tree nobody looked at; `force` re-inspects (a forced
  reinstall means the repository moved). `remove_desktop_plugin` refuses a package's own half unless
  forced, and refuses a linked folder it would only half-delete.
- `plugins_cmd_inspect.forget_inspection`: drops the ten-minute answer cache, used by a forced
  reinstall.
- `desktop_plugin_halves`: `ROOT_WRITER` and `publish_desktop_tree`/`read_package_marker`/`mtime_ms`
  go public (the installer shares the root's lock), a standalone plugin publishes with no marker, and
  the Webapp's read router imports the root from the one place that defines it.
- `plugins.manage install_desktop|remove_desktop` + contract (`tools_mcp_plugins`), regenerated.
- Renderer: `desktopInstallSupported()` is also true in a browser-hosted tab, `cloneDesktopHalf` falls
  back to the gateway, and a backend that predates the action keeps the old "unavailable in this
  environment" wording. Uninstalling a disk plugin uses the same fallback.
- Docs: the Webapp install/remove paragraph now describes the working path.

Tests: 10 installer (real local clones: standalone vs package marker, force, sha pinning, path-shaped
names, linked folder, removal rules), 6 gateway RPC (incl. contract validation), 3 browser-modal cases
(desktop-only, both halves, old backend) beside the 6 existing ones, and one route test that installs
through the backend and then reads the plugin back over `/api/desktop-plugins/*` — the whole trip the
browser makes.
2026-10-28 17:21:32 -07:00
Teknium
f799cf71d9 fix(cron): extra fires key on explicit run-now intent only
An unforced provider claim ahead of the slot keeps advancing next_run_at
(test_claim_succeeds_once_then_blocks); the dashboard Run already passes
manual=True. Diagnostics catch-all logs its traceback; user docs say a
manual run keeps the scheduled one.
2026-10-28 13:08:26 -07:00
ethernet
780d5a3313 fix(auth): login surfaces share one interactive-provider query
Review follow-up (#146139). The native authorize route still counted
every session provider: with session-token beside one password/OAuth
provider an unnamed request 404'd instead of auto-selecting the only
interactive one, and with session-token alone (or named explicitly) it
fell into its start_login stub -> uncaught NotImplementedError -> 500.

registry.list_interactive_providers() is now the single query every
sign-in surface uses: native selection + chooser, the login page,
/api/auth/providers, auto-SSO and the /api/status native_pkce
advertisement (a token-only gate no longer tells Desktop to try a
browser flow it doesn't have). An explicitly named non-interactive
provider is rejected with 400 before any pending broker state exists.
The verify/refresh loops keep list_session_providers.

Tests: native authorize auto-select / token-only / explicit-name cases
and the native_pkce advertisement against the real routes (red without
the fix: the 404 and the 500 above); the dashboard.session_token_auth
opt-out read from a real config.yaml under a temp HERMES_HOME; the REST
bearer test now asserts an exact 200 + provider on /api/auth/me (the old
/api/session target was unrouted, so its 'not 401' passed on a 404).
Docs: the deployment check curls /api/auth/me, not /api/me.
2026-10-28 13:49:47 -04:00
ethernet
2edfd0d369 feat(auth): the deployment session token authorizes the gated dashboard
A token-only deployment (nix/agenix: backend.sessionTokenFile ->
HERMES_DASHBOARD_SESSION_TOKEN=file:<path>) had no way to satisfy the
June-2026 fail-closed gate: gated mode demands a registered
DashboardAuthProvider, the interactive prompt then writes basic-auth
credentials the deployment never asked for, and the provisioned token
itself is rejected on every gated leg (REST 401, /api/ws 403) — the
desktop's 'HTTP reachable but the WebSocket fails' incident.

The bundled session_token plugin closes that: it registers whenever the
session token is provisioned (skippable via
dashboard.session_token_auth.enabled: false) and verify_session
constant-time-compares the presented credential against it. Both legs a
token-mode client uses — the REST bearer path and the /api/ws ?token=
upgrade — run through that seam, so one provisioned token authorizes both.

It is deliberately not an interactive login: a new interactive_login
capability flag keeps it off the login page, /api/auth/providers, the
auto-SSO redirect and the native provider chooser (a token-gated /login
now renders a note explaining the credential channel), while
supports_session stays True so the gate's verify loops consult it.

Rotation semantics are pinned by tests: a saved client copy from before a
secret redeploy must fail closed, not half-work.
2026-10-28 13:49:47 -04:00
kshitijk4poor
0431192d69 fix(kanban): the protocol-violation streak never matches a worker's quoted output; docs match the release rule
Final-head review folds:

- _protocol_violation_streak's legacy text match now reads only the error head, before
  WORKER_OUTPUT_SEP (" Worker's last output: ", now one named constant shared by the writer,
  the streak and apply_attempt_note). Every crash quotes the worker's output, and a retry worker is shown
  the previous attempt's protocol-violation error, so an ordinary crash that echoed the phrase
  lengthened the streak. That drops the worker_lost-only exception added earlier.
- website/docs kanban.md said resolving an unknown admission "does not authorize another Kanban
  attempt". On this branch an unbound run whose owner settled the admission is released once its
  recorded pids are dead (or, with none recorded, once the claim expires): booked crashed, or
  reclaimed if the claim had lapsed, so the card can be retried. The paragraph and owner_reclaim_paused's comment now say so.
- owner_attempt_provably_over's docstring drops the incident count and its outdated premise
  (only killed owners), and the lapsed-claim comment matches the code.
- record_worker_loss reads policy.kanban_json directly: its policy is always a LocalSessionPolicy.

Test: a crash whose output quotes "protocol violation" leaves the streak at 0 (fails with the
whole-error match).
2026-10-28 17:06:43 +05:30
Gille
39b2158afc fix: preserve configured Discord timeouts and retire approval views 2026-10-28 15:28:40 +05:30
Adolanium
f9e923f190 feat(webapp): copy agent+desktop packages' desktop halves on the serving host
The desktop half of a unified package only reached desktop-plugins/ when
native Desktop copied it there (reconcileUnifiedDesktopHalves in Electron).
A host that Desktop only reaches over SSH never ran that copy, so the
Webapp never showed those halves.

hermes_cli/desktop_plugin_halves.py ports the reconcile with Electron's
on-disk contract: the same marker fields, first home wins, adoption of a
byte-equal marker-less copy, a byte compare for linked checkouts, staged
publication, and a prune only when the source is really gone. The Webapp
runs it where Electron does: when the loader asks for the root, and on
demand through POST /api/desktop-plugins/reconcile, which the browser
bridge's reconcileDesktopPlugins now calls after an install.

Closes #145540
2026-10-27 21:25:51 -07:00
Teknium
41010b6fef feat(hosted-rooms): read the Discussion budgets through the effective loader, keep defaults on a typo
Layered on the salvaged budget commit: the limits are read with
load_user_config_effective (the gateway-runtime loader: user file + managed overlay +
${VAR} expansion) inside the room owner's scope, and a malformed value is logged and
falls back to today's 3 rounds / 10 replies instead of failing the service construction,
which would take every room on that store offline. Docs say so.

Refs #144648 (WA-21)
Refs #145184
2026-10-27 20:24:05 -07:00
Nixon
afe3a9111f feat(hosted-rooms): make discussion budgets configurable 2026-10-27 20:24:05 -07:00
Ben Barclay
f292c4c357 fix(config-remote): the poll interval is a constant, not a HERMES_* env var
HERMES_CONFIG_REMOTE_POLL_SECONDS is gone: the interval is 300 s (the 30 s floor stays), so no
new non-secret HERMES_* env var is needed before config can be read. A plane-served interval is a
later cross-repo change. The environment-variables reference now lists HERMES_CONFIG_REMOTE_URL
and HERMES_CONFIG_INSTANCE_ID next to HERMES_CONFIG_BACKEND, with why each must be env.

Addresses teknium1's P2-2 on #122509.
2026-10-27 17:33:48 -07:00
Ben Barclay
fd059c01f4 fix(config-remote): review round 4 — leaf-level CAS intent for new sections, D32 guard on routed secret-source hydration, config-only in-memory migrations, bootstrap completes before other threads select, project .env in the early bootstrap, keyed TUI section/prompt/consent setters 2026-10-27 17:33:48 -07:00
Ben Barclay
6dd799b30a fix(config-remote): review round 3 — intent-preserving CAS retry, private in-memory migration, poller roster snapshots, dotenv+managed bootstrap before the first read, deployment carried into routed children, remote-safe profile create/rename, backend-versioned roster cache, keyed TUI edits, RPC answers on backend refusal, stage2 uses the runtime's selection, refuse values a pending migration would rewrite 2026-10-27 17:33:48 -07:00
Ben Barclay
f0def49876 fix(config-remote): stamp writerConfigVersion only when the profile level's stored data is current
Contract §5.3 (absent = unchanged): an unrelated write from a newer agent no longer
re-stamps a profile level that still stores pre-migration keys, so later readers keep
running those migration steps (D12, R6). A newer stamp is never lowered. The stub plane
now honours 'absent = unchanged' too.
2026-10-27 17:33:48 -07:00
Ben Barclay
69d037b349 feat(config): remote config backend (HERMES_CONFIG_BACKEND=remote)
plugins/config_backends/remote serves each profile's user layer from the
config plane: boot fetch inside load_hermes_dotenv with bounded retry and
fail-closed exit (D2), per-process ETag poller (D9), key-level diff writes
with CAS and one conflict retry (D10), client-side lock and secret-literal
checks (D7, D17), in-memory migrations (D12), managed config.yaml ignored
(D18), plane credential from auth.json or IdP client credentials only and
never from a secrets: source (D26, D32). Vendored gg conformance fixtures
run against the lock matcher, secret rule and _deep_merge.
2026-10-27 17:33:48 -07:00
Teknium
2a8413a52e fix(webapp): self-hosted sign-in admits whom it admitted on main, each as the machine owner
Maintainer ruling: an owner restriction on self-hosted OIDC adds no real protection, because
anyone the login provider lets in already gets the agent and terminal as you on main. Remove the
first-sign-in owner pin (owner_pin.py, dashboard-auth/self-hosted-owner.json) and the
dashboard.oauth.self_hosted.owner check; the self-hosted provider is back to main's code. Who may
sign in is decided by the login provider's app configuration, and the docs now say so.

The hosted-room daemon test signs in two different IdP accounts again (as on main); both act as
the owner and share one Group Chat list.
2026-10-27 17:32:49 -07:00
Teknium
8497ce9318 fix(webapp): a signed-in Webapp tab is the machine owner, the same identity native Desktop uses
Hermes is single-user (maintainer ruling): sign-in only gates whether a browser may open the
Webapp, it never creates a second identity. Every login (Webapp tab, loopback session token,
a dashboard login forwarded by a standalone backend, the dashboard's PTY child) now acts as the
host owner's OS subject (uid:<n> / sid:<sid>), on both routes:

- gateway route: AuthorityConnection and the REST session-mutation context build the principal
  through gateway.owner_identity.principal_subject.
- tui_gateway route: rows a login creates over hermes serve carry the owner subject instead of a
  <provider>:<user> label, so native Desktop and the TUI resume them.

Stored login stamps from older builds read as the owner's (read-time, nothing rewritten or
deleted): auth:v1 room owners and history bindings, and <provider>:<user> labels of a bundled or
registered dashboard sign-in on routeless local rows. Messaging ids (telegram:42), other OS users
(uid:N) and nous: stamps on non-Desktop rows stay foreign.

Owner-only sign-in: basic auth has one account and the Nous Portal refuses other accounts for the
registered agent client; self-hosted OIDC admitted every IdP account, so it now admits one:
dashboard.oauth.self_hosted.owner, or the first account to sign in, pinned in
dashboard-auth/self-hosted-owner.json.
2026-10-27 17:32:49 -07:00
Teknium
cdbcbe86ea fix(pm): orphan-state retention comes from the store owner, and each removal re-checks under the install lock
installs/ is shared by every profile of a data root, but retention was read from the active
profile: a named profile without the key applied the 14-day default to state the root kept
forever (0). Read worktrees.install_state_retention_days from the config of the root that
owns installs/ (scoped via the home override, through load_config_readonly).

Candidates were all decided before any removal; a state launched (lease taken and released)
while an earlier large orphan was being removed was then deleted. Each candidate is now
re-validated (checkout still missing, provably deleted or idle past retention by a fresh
_last_used, no live lease) while holding its install lock, which stays held through removal.
2026-10-27 16:03:18 -07:00
Teknium
ba48bbcd8b fix(pm): reclaim dependency state of missing checkouts after 14 days unused
orphan_install_states only reclaimed installs/<key> when the recorded checkout
was provably deleted (under the data root, or directly in an existing
.worktrees/ dir). A checkout anywhere else (~/.cache/review-*/head, a scratch
clone outside the data root) kept its ~0.5 GB / ~27k-file state forever once
deleted: ~235 of ~300 states on one developer host.

The proof rule stays: a provably deleted checkout is reclaimed at once. A
missing checkout that cannot be proved deleted (it may sit behind a mount
boundary: a container sharing the data root, an unmounted volume) is now
reclaimed once its state has also gone unused for
worktrees.install_state_retention_days (default 14, 0 = keep forever).
"Used" is what the runtime moves, measured on a live install: every sync
recreates inputs/ (and rewrites facts.json on a change), every launch takes a
generation lease (moving its .leases dir). Present checkouts, record-less
states and held states (install lock, generation lease) are never reclaimed;
removal keeps the record-last order, and a part-way removal does not restart
the clock.
2026-10-27 16:03:18 -07:00
Teknium
6d8a835485 fix(desktop): skipped onboarding and seen or dismissed tips follow the machine
Dismissal state lived only in each browser's localStorage, so a phone, a
second browser or another Webapp address replayed first-run onboarding and
the whole tip deck (#145600). The tip rotation's ledgers (seen, retired,
cursor, cooldown) and the onboarding skip are now machine-level shared
preferences; tours' switch already was. The skip is read and written through
the storage choke point so the sync sees it, and both writers accept the
`hermes-onboarding-` prefix. The "provider configured" cache stays local:
each backend answers that itself.

Fixes #145600
2026-10-27 14:02:54 -07:00
Teknium
2eec5f3632 fix(desktop): the preferences store never drops keys on a bad read or a fresh seed
Review findings 2-5 (#145536), store side, both writers (Python route and the
native Electron writer) in lockstep:

- Only a missing file reads as "no store". Any other read failure (EACCES,
  EBUSY, EMFILE) refuses the write (PreferencesBusy -> 503, retried) instead
  of merging over nothing; the GET answers 503 too.
- A corrupt store reads as no store; the write that replaces it first copies
  it to ui-preferences.json.corrupt-<ms> and starts a new `generation`, so open
  windows follow the replacement instead of waiting for the revision counter.
- `seed` (a client's first contact) only adds the keys the store lacks and
  creates no store from nothing, so a client with data fills a store an empty
  client reached first.
- The store root is judged on the path as given (a symlinked profile still
  names its root) and then resolved through symlinks on both sides.
2026-10-27 14:02:54 -07:00
Teknium
170ff2344c refactor(desktop): register the preferences IPC from main, beside the local-skin pre-paint read
registerFsIpc's callers (and its test's ipcMain stand-in) know only invoke
handlers; the store's synchronous first-paint snapshot needs ipcMain.on.
Register it from main next to the other pre-paint payload instead, moving the
local-skin handler into local-skin.ts so main.ts ends shorter than on main.
Docs: where Desktop and Webapp display preferences live.
2026-10-27 14:02:54 -07:00
unsupportedpastels
50e14f7dd8 docs(dashboard): generate the basic-auth signing secret in the remote recipes
The remote-backend recipes in desktop.md and web-dashboard.md wrote the
HERMES_DASHBOARD_BASIC_AUTH_SECRET line inside a quoted heredoc, so .env got the
literal text $(openssl rand -base64 32) instead of a random secret. Write the
credentials with the quoted heredoc and append the secret with a real command
substitution, and tell readers how to spot and replace the literal line.

The basic provider now ignores a signing secret that still contains unexpanded
shell text ($( or a backtick), logs an error, and uses a random per-process key,
so the literal string is never used to sign or verify sessions.
2026-10-27 16:37:10 -04:00