Commit Graph

403 Commits

Author SHA1 Message Date
Teknium
9d70683b82 fix(transfer): name the Messaging page, not "Settings → Messaging"
Messaging is its own page (sidebar, command palette), not a Settings tab, so a user who opened
Settings looking for it would not find it. Every line this PR adds now names the Messaging page:
the confirm and done screens, the user guide, the CLI reference, the import's printed hint.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-16 10:29:52 -08:00
Teknium
5342a0a91f feat(import): transferred messaging bots arrive switched off on the cloud agent
A bot token answers to one running Hermes at a time. The transfer now
brings Telegram, Discord, Slack and every other messaging bot over with
its token and settings but switched off, so the computer it came from
keeps answering until the user switches each bot over by hand.

`hermes import --keep-host --messaging-off` (the Desktop transfer route
always passes it; the undo never does): in the root home and in each
profile the archive carries, every bot the archive would run (an
`enabled: true` block, or a token in that home's .env with no `enabled`
set) gets `platforms.<id>.enabled: false`, the switch Settings >
Messaging writes, inside the same merged config.yaml the keep-host
restore publishes. The explicit false sets the gateway's
_enabled_explicit marker, so the env token cannot re-enable it, and
turning the switch on in Settings > Messaging is the only step needed.

The import prints `Messaging switched off: <names>`, the action status
returns them as `messaging_off`, and the Desktop done screen names them.
The confirm note says the bots come over switched off.
2026-11-16 10:29:52 -08:00
Teknium
08e252dd29 fix(import): --keep-host is one restore pipeline; undo is a faithful replace
`--keep-host` was a second restore wrapped around `hermes import`: a
`_KeepHostZip` proxy merged every member named config.yaml/.env, a separate
writer published auth.json members without the import's path checks, and a
prune ran after the maintenance reservation was released. Reviews of #156330
reproduced the results: a `../x/auth.json` member written outside the home, a
symlinked skills/ emptied through the link (and missing from Undo), a skill's
templates/config.yaml stripped, a destination-only profile half-emptied while
its gateway ran, comments lost, and an Undo that left the source's
cron/jobs.json behind.

Now keep-host is a per-member policy (`KeepHostImport`) inside
`_import_members_exclusive`, under the same `exclusive_maintenance`
reservation (which also covers every profile the archive writes into):

- Every member goes through the import's own normalize + resolved-root
  checks. Only the root home's config.yaml/.env and the root's and each
  profile's auth.json are merged; everything else, including a named
  profile's config and a skill's files, is copied unchanged.
- config.yaml is written onto the archive's own document with the
  comment-preserving `atomic_config_replace`; auth.json goes through the auth
  store's lock and writer (`_auth_restore_target`, `_save_auth_store`);
  .env under `_env_write_lock`. When the merge changes nothing (an undo), the
  archive's bytes are published as they are.
- Replace: after a restore with no errors, files the archive lacks are
  removed in the root home and in every profile the archive carries (the
  backup's own walk, so links are never entered), and a missing auth.json/
  .env/config.yaml leaves only the host-owned part. A profile only the
  destination has is left untouched. Databases, logs, runtime records,
  lock files, install_id, webapp/ and shared/nous_auth.json stay.
- A folder the archive writes into that is a symlink refuses the import
  before any write.
- The undo point is taken after the gateway drained, under the reservation,
  with the `hermes backup` collector (`_external/` memory-provider files
  included, plus the external files the archive will overwrite). The import
  owns its path and prints `Undo point: <path>`; the last 3 are kept. A
  restore that wrote files and failed leaves a marker; the next keep-host
  import reuses that first undo point. The hidden `--undo-point` flag is gone.
- "Import refused; no files restored" is printed only for a refusal before
  the first write (`KeepHostRefused`, `OwnershipConflict`).
- `s6-svc -O` runs inside the try; an unprobeable s6 slot refuses.

Includes kvnloo's `_external/` undo-point fix (cherry-picked as the previous
commit) and BearHuddleston's root-only merge, both folded into this design.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Co-authored-by: kvnloo <7121943+kvnloo@users.noreply.github.com>
2026-11-16 10:29:52 -08:00
Teknium
0695cbbbab feat(import): hermes import --keep-host replaces a cloud agent, keeps its host setup
The restore half of Settings > Backup & Transfer. `hermes import <zip> --keep-host` restores a
`hermes backup` archive over an agent whose host provisioned part of it (a Hermes Cloud agent):

- auth.json: the destination keeps its Nous Portal sign-in (providers.nous, nous pool rows,
  active_provider when nous); every other login comes from the archive. Merged against the live
  store under the auth lock; the archive's Nous tokens never land on disk.
- config.yaml: HOST_CONFIG_KEYS (model, providers, fallback*, auxiliary, nous, auth, web, image_gen,
  video_gen, tts, stt, dashboard, webapp, cron, session caps) keep the destination's value.
- .env: NOUS_*, HERMES_*, TOOL_GATEWAY_*, API_SERVER_KEY keep the destination's lines, in place.
- skills/ and memories/ become exactly the archive's (replace, not merge).
- A full backup of the destination is written first (backups/pre-transfer-*.zip, the undo point);
  `hermes import <it> --force --keep-host` puts the agent back.
- In the s6 container the gateway owns state.db, so a plain import refuses it. --keep-host marks the
  gateway's slot run-once, asks it to drain and exit over its control socket (pause-for-update), waits
  for the profile lock, restores, and starts the slot again.

REST: POST /api/ops/import-upload and /api/ops/import take keep_host and answer the undo archive;
the upload gets a 32 GiB bound instead of the 100 MB managed-file cap. GET /api/ops/backup/chunk reads
a dashboard-written backup in base64 slices (JSON-only clients such as Desktop OAuth connections).
GET /api/cloud/agents lists the Nous account's Hermes Cloud agents for a Webapp tab.

Co-authored-by: SHL0MS <SHL0MS@users.noreply.github.com>
2026-11-16 10:29:52 -08:00
unsupportedpastels
71e07ef273 feat(gateway): mint host-scoped interactive tickets in gateway tickets
tickets --serve answers purpose interactive with the WebSocket ticket Desktop's local connection asks for (session-ticket, scope host, the store's 30 s TTL), so an SSH client's one socket selects every profile the gateway serves. The probe lists the purpose. A profile on such a request is invalid_request. The ticket attach returns is unchanged.
2026-11-14 10:50:28 -05:00
unsupportedpastels
0ca6a15001 feat(gateway): per-profile and profile-management tickets in gateway tickets
A --serve request line may name another profile the same gateway serves ("profile"), and --serve
also mints native-profile-create and native-profile-registry: the grants Desktop's local
connection uses for ?profile= routes and for profile create/rename/delete, asked of the same
control socket. Without "profile" a request is answered exactly as before. --probe lists the new
purposes and reports windows_service_session. The gateway is unchanged.
2026-11-14 10:50:28 -05:00
unsupportedpastels
8dc4a59c3e feat(gateway): add hermes gateway tickets for clients that reach the gateway over SSH
`--probe --json` prints the protocol version and the ticket purposes and touches no
gateway. `--serve --json` finds the running gateway as `attach` does (never starts one),
prints a hello line with its endpoint, then answers each stdin request line with one
single-use native-http ticket until stdin closes.

The mint is the one `attach` already uses, moved into `mint_ticket` so both commands
share its error mapping. Adds the client contract page for SSH clients.
2026-11-14 10:50:28 -05:00
Teknium
0913dd0f22 fix(update): --force stops gateways concurrently through their supervisors
Review fixes on #155524:
- systemd/launchd gateways are stopped through their supervisor from the start, so
  Restart=/KeepAlive cannot respawn one while another is still being killed, and a
  system unit gets the sudo path instead of a silently refused SIGTERM.
- Each gateway is stopped on its own thread against its own 12 s deadline, so the
  bound no longer grows with the fleet.
- The kill of a supervised survivor goes through systemctl kill.
- Help and docs: the immediate stop is Linux/macOS (Windows keeps its drain), and
  --force is chosen when starting an update, not to interrupt one already waiting.
- Tests gate on platforms("posix").
2026-11-14 01:11:55 -08:00
Teknium
e038cce570 feat(update): hermes update --force stops the gateways at once instead of draining
`hermes update` waits up to agent.restart_after_turn_timeout (30 min by default) for every
gateway's in-flight work before it moves the checkout. --force is the explicit "stop
everything now": the POSIX pre-swap pause names what each gateway was running, asks it to
stop immediately (the force control-socket verb when the gateway answers it, else the
planned-stop marker + SIGTERM, which enters stop() at once), SIGKILLs anything still alive
after 12 s, then the update runs and the paused set restarts on the new code as before.

The Windows meaning (proceed past a concurrent hermes.exe) is kept under the same flag;
--force-venv is unchanged.
2026-11-14 01:11:55 -08:00
Maciej Lisiewski
97a6c2fc33 docs(webhook): subscribe prints a masked secret
Point readers at webhook_subscriptions.json for the full value, and fix
the troubleshooting step that sent them to `hermes webhook list`,
which never printed it.

Refs #68040
2026-11-13 17:46:33 -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
Maciej Lisiewski
2add11956e docs(debug): bare /debug only shows the privacy notice; /debug upload uploads
Since #94876 bare /debug uploads nothing; tip t346 (all locales), the zh-Hans
/debug rows and the cli-commands /debug mention still said it did.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-13 20:20:47 +01:00
Maciej Lisiewski
adee619279 fix(debug): public debug paste is an allowlisted summary; full logs only via --nous
The public paste (hermes debug share, gateway /debug, dashboard
POST /api/ops/debug-share) uploaded secret-redacted log tails and full
logs. Subtractive redaction cannot recognise IPs, room IDs, display
names or message bodies, so those reached a public URL. The public
upload is now built from an allowlist in hermes_cli/debug_summary.py:
versions, install kind, platform/built-in toolset names, config.yaml
key shape (no values; user-named keys counted), and WARNING+/exception/
HTTP-status counts. --no-redact can no longer put logs on the public
paste; --nous and --local keep the full redacted bundle.

Refs #46006
2026-11-13 20:20:45 +01:00
Maciej Lisiewski
b25847c75e Merge pull request #154633 from NousResearch/sec/76932-isolated-profile-scope
fix(dashboard): list only the launch profile on an isolated named-profile serve
2026-11-13 17:16:18 +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
6035ecba1a fix(dashboard): list only the launch profile on an isolated named-profile serve
`hermes -p <name> serve|dashboard --isolated` now stops advertising sibling
profiles: /api/profiles, /api/status profiles (+ new `isolated_profile`), the
unified /api/profiles/sessions{,/sidebar} fan-outs and gateway `profiles.list`
answer for the launch profile only, so Desktop's profile rail, sessions sidebar
and SOUL editor show just that profile.

This is listing UX, not a boundary: per the maintainer decision, `--isolated`
is a routing/ops convenience (SECURITY.md §2.2/§2.6). ?profile=<sibling>,
/api/fs/* and the agent's own tools still reach sibling homes; the docs and
SECURITY.md now say so and point tenants at separate OS users or containers.

The scope is captured once at start_server as the canonical launch home (not
get_active_profile_name(), whose default/custom sentinels collide with real
ids), before multi-profile activation can mirror a turn's profile into
HERMES_HOME. The root home and Desktop-owned backends (its SSH serve --isolated
multiplexes every profile per connection) stay unscoped. Launch-path idea from
#91381.

Refs #76932
Refs #91330

Co-authored-by: KeyArgo <daniel.laforce@argobox.com>
2026-11-12 21:12:00 +01:00
kshitijk4poor
1a88f1e2d7 fix(cli): align shared foreground and delegation defaults
Narrow #152653 to defaults only. CLI caps come from DEFAULT_CONFIG, TUI foreground resolution uses that same source, explicit/background budgets remain unchanged, and panels say unlimited. Timeout display uses the shared default without seeding terminal.timeout over a shell override.

Keep the original delegation fix with Max Freedom Pollards authorship. The ignored-config reader/writer policy, refusal and preflight machinery are not included. resolve_turn_limit remains in its original owner; config_turn_limit contains only the display formatter. Ten scoped guards pass; seven fail on base with three existing-behavior cases remaining green. Ruff clean; ty adds no diagnostics.
2026-11-12 23:40:12 +05:30
Maciej Lisiewski
08f6771569 feat(webhook): opt-in per-route signature pin; subscribe pins generic
V1, GitHub (sha256=) and Linear signatures are the same body-only
HMAC under one route secret, so rejecting V1 alone still let a
captured V1 MAC replay as Linear-Signature or X-Hub-Signature-256.
A route `signature: generic|github|gitlab|linear` now accepts only
that scheme's headers and rejects every other family with 401; an
unknown value fails closed (startup error / dynamic route skipped /
403). Unset keeps the accept-any behaviour (V1 still rejected) so
existing provider routes keep working.

`hermes webhook subscribe` writes `signature: generic` for new routes
(`--signature` picks a provider; updates keep the existing pin), and
`hermes webhook test` signs V2 for generic/unpinned routes and the
provider scheme for pinned ones. Docs (en + zh-Hans) document the key,
pin the GitHub/GitLab examples and move the generic curl recipe to V2.

Refs #84265
2026-11-12 03:14:46 +01:00
unsupportedpastels
b7f0f7c6ce fix(gateway): remove backend migration advice from report
Remove prospective migration instructions at the maintainer’s decision because the service-migration design is not signed. Keep present ownership facts and all detected service metadata.
2026-11-10 10:40:31 -05:00
unsupportedpastels
bf11054845 fix(gateway): state truthfully what gateway migrate --backends never writes
The report never stops, restarts or kills anything, writes no service
file, unit, plist or ledger and opens no network connection, but normal
Hermes startup bookkeeping (HERMES_HOME layout, install record, logs,
scratch prune) still runs first, as for any hermes command. Say so in
the module docstring, help text and docs, and add a fresh-process test
through the real entry point that compares the files left behind with
gateway migrate --dry-run and checks every recorded systemctl/launchctl
call is a query.
2026-11-10 10:40:31 -05:00
unsupportedpastels
129755bcfb feat(gateway): add read-only gateway migrate --backends service report
Report the hermes serve / hermes dashboard background services on this
machine (systemd user/system units incl. Nix hermes-backend, launchd
jobs, s6 slots, containers, Desktop SSH/local backends, detached and
manual processes), the HERMES_HOME each serves, what a future backend
migration would do and why nothing is applied. Text or --json, exit 0,
never stops/restarts/edits/writes anything.
2026-11-10 10:40:31 -05:00
kshitijk4poor
2f355e1182 fix(profiles): say when a named profile's subscription logins stay with the default
Second review round on the share/copy split:

- A named launch profile's single-use OAuth logins (Claude, Codex, xAI,
  Nous) are stripped from its copied auth.json, so for those providers the
  new profile reads the default profile's. provision_profile now returns a
  warning naming them and the auth add command to fix it.
- The share decision uses the auth fallback's own root test
  (_global_auth_file_path) instead of a second resolve() comparison.
- The CLI only suggests --isolated-auth where it would change something,
  reuses the launch label it already computed, and the help, docs and the
  Desktop bot hint say logins are shared with the default profile.
2026-11-10 15:30:14 +05:30
kshitijk4poor
cbc254f1e6 fix(profiles): shared logins mean the root's; report what the profile actually reads
Review of the new create defaults found that share_auth works by not copying
auth.json, so the new profile reads the default root's (hermes_cli.auth
fallback). From a named launch profile that paired its API keys with the
root's logins and hid its own. A named launch profile's auth.json is now
copied (single-use OAuth grants stripped, as before).

mirrored["auth"] is now derived from the outcome: "shared" when the new
profile has no auth.json of its own. --clone-all no longer reports shared
logins it does not have, and --no-credentials says the root's logins stay
readable.

The CLI names the profile keys and model came from, uses cloned (so
--clone-from without --clone no longer says "no API keys yet"), and the
opt-out tests parse real argv. Docs list the new default and both flags.
2026-11-10 15:30:14 +05:30
kshitijk4poor
10533b43c8 feat(cli): hermes fallback check, fallback-chain readiness without an agent session (#63852)
`hermes fallback check [--live] [--json]` reports, per fallback entry, whether the switch
could use it:

- static (default): the entry resolves through resolve_runtime_provider with the switch's
  own kwargs (fallback_entry_runtime_kwargs), no chain walk, then the session-readiness
  credential predicate. No inference request; plugin installs held.
- --live: one minimal completion per statically ready entry, in parallel, on the client the
  swap itself builds (route_binding.resolve_route_entry_client; Anthropic Messages, Codex
  Responses, Bedrock and ACP on their own wire), shaped by the auxiliary request builder and
  streamed where the provider is stream-only. Never through call_llm, whose recovery ladder
  retries or answers from another provider and would hide a dead entry. SDK retries off, the
  provider's request_timeout_seconds (else 30 s), the aux response shape check. An empty
  answer fails as live_response; a provider-reported model other than the one sent (or a
  dated snapshot of it) fails as model_mismatch, except where the reported id proves nothing
  (adapter wires, Azure, local/private endpoints, router meta-models, Bedrock ARNs).
  ``auto`` and ``moa`` entries are not one fixed route and keep their static verdict.
  run_probes gains ``aws_imds`` so an EC2 instance role counts for a Bedrock probe.
- exit 1 when any entry is not ready; --json carries profile, checked_at and a stable
  per-entry record; credentials are never printed; error and model text are redacted,
  including the entry's own key when it has no recognisable prefix.
- no AIAgent, session, prompt context or fallback notice.

Based on #63914 by @webtecnica, which proposed the command; rebuilt on the existing
resolvers instead of copied alias/env tables and a raw chat-completions POST.

Co-authored-by: webtecnica <75556242+webtecnica@users.noreply.github.com>
2026-11-10 13:36:29 +05:30
unsupportedpastels
6b2b0e33aa docs(cli): say hermes clipboard image runs in the container under NixOS container mode
Container mode forwards every hermes invocation into the managed
container, so this command reads the container's clipboard (none) and
--out is a container path. It fails closed there. Say so in the docs;
keeping the command on the host is a separate change.

Suggested by @BearHuddleston in review.
2026-11-06 20:23:20 -05:00
unsupportedpastels
1e82b6df14 fix(cli): keep an overwritten --out file's permissions in hermes clipboard image
The image is staged in a temp file and renamed onto --out, so an existing
file came back with the umask default mode: a private 0600 temp file from
mkstemp became 0644 and readable by other local users. Copy the existing
file's permission bits onto the staged file before the rename. New files
keep the old default. The docs now say so, and that a symlink at --out is
replaced by a regular file.

Suggested by @BearHuddleston in review (fix and test).
2026-11-06 20:23:20 -05:00
unsupportedpastels
3c8ea50a5c fix(cli): keep an existing --out when hermes clipboard image fails
With a working clipboard tool and a read-only --out file, the command
reported no_image (exit 1) and the extractor's failure cleanup deleted the
existing file. The extractor now writes into a private temporary directory
beside --out and the result is renamed onto it, so an existing file is only
ever replaced by a complete image. A read-only or directory --out is
write_failed (exit 4) before the clipboard is read, and a failed rename is
write_failed too. The extractor itself is unchanged.

Also drops the FILE_LINES allow comment on main.py: the clipboard wiring
is offset by reflowing four short lines of the _BUILTIN_SUBCOMMANDS literal
(same set, same order), so main.py shrinks by one line against main.
2026-11-06 20:23:20 -05:00
unsupportedpastels
63cdc15eb3 feat(cli): add hermes clipboard image --json for clients that paste images
Third-party clients read the clipboard image by running the TUI's private
helper script with PYTHONPATH pointed at the source tree. This exposes the
same extractor (hermes_cli.clipboard.save_clipboard_image) as a documented,
device-local command with a JSON reply and stable reason codes:
ok / no_image (exit 1) / no_tool (exit 3) / write_failed (exit 4).

The TUI helper and the extractor's existing functions are unchanged; the
extractor gains clipboard_image_tools(), the per-platform tool list used to
tell "no image" from "no tool".
2026-11-06 20:23:20 -05:00
alt-glitch
54dae26e58 fix(gateway): attach leaves its caller's environment alone; one ticket_unavailable verdict
Review of the attach command:

- attach_gateway no longer pops the launch-policy variables from os.environ: an in-process
  caller would have lost HERMES_CWD and friends. scrub_client_launch_env() runs in the two
  processes that exist to attach (the CLI command and Ink's bootstrap), before the attach.
- Every failed mint after an attachable discovery raises TicketUnavailable (a RuntimeError, so
  Ink's bootstrap still prints one bounded line and retries). The CLI reports it as
  inaccessible/ticket_unavailable with the cause in `detail`, instead of a DiscoveryError's own
  code or a bare reason.
- --start and --recover are mutually exclusive; --timeout is documented as the start deadline,
  with discovery and the mint adding at most 5 s each.
- Docs: only an unmanaged gateway that attach spawns has the idle exit; a mint failure is
  answered by running attach again, not by --recover.
- The CLI test keeps the suite's isolation variables in the child, and the no-owner verdict test
  runs on every host.
2026-11-06 10:38:43 -05:00
alt-glitch
85973667b3 docs: document hermes gateway attach; the TUI speaks WebSocket hermes-gateway-v1, not stdio
The CLI reference and gateway internals describe the attach command, its JSON, the dial rules
(subprotocols, loopback, no Origin) and the ticket's limits.

tui_gateway/AGENTS.md drew Ink talking "stdio JSON-RPC" to a tui_gateway child, and tui.md said
the TUI spawns its own in-process gateway. Ink attaches to the profile's shared gateway owner
over `/api/ws` with `hermes-gateway-v1` and a ticket from the attach step; both now say so,
including how a dropped socket and a gone gateway recover.
2026-11-06 10:38:43 -05:00
Maciej Lisiewski
29e78b124e docs: pnpm commands for the JS workspaces
READMEs, contributor guides, AGENTS.md files, skills and the website (with
the zh-Hans translations) give pnpm commands for the workspaces; the
website itself is still an npm project.
2026-11-06 04:08:45 +01:00
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
kshitijk4poor
0aab6dcf8b docs(skills): correct the projects reference against the live CLI
Running the documented commands against a scratch HERMES_HOME showed several
claims in the new reference were wrong:

- `hermes project bind-board` does not link a board's tasks to the project. It
  records the board on the project and, when the board exists and the project has a
  primary folder, sets the board's default workdir (from the CLI only a bare
  `--workspace worktree` task uses it). The board's project_id stays null, so tasks
  get no project link or deterministic branch; only the kanban dashboard's Project
  selector or `hermes kanban create --project` links tasks. Unbinding clears only
  the project's record.
- The CLI resolves `<project>` by an exact id or a slug in any case, not by display
  name; name matching is only in the desktop_project tool.
- `set-primary` normalizes paths, so the "spell it the way show prints it" tip was
  wrong.
- A desktop_project move leaves the active-project pointer alone only when the
  project has a folder, and the desktop sidebar following the viewed chat can still
  select the new project.

Also: the worktree + branch default applies to linked non-dir tasks of a project
with a primary folder; an unknown `--project` creates an unlinked task without an
error; complete the exit-code list; note desktop delete (folders and chats kept),
the sidebar's automatic groups, and the Windows HERMES_HOME default; drop internal
table/function names and the raw sqlite queries; replace troubleshooting advice
that made two projects own one folder; point background-systems.md at the
reference; shorten the routing row; and regenerate the bundled-skill docs page.

website/docs/reference/cli-commands.md made the same bind-board claim; its summary
rows and `hermes project` section now describe what the CLI does, and `--project`
is listed among the `kanban create` flags.
2026-11-02 16:20:57 +05:30
Teknium
06433066f4 fix: bare hermes migrate passes no setup-only flags; an import that ran with errors gets its own warning 2026-11-01 19:53:24 -08:00
Teknium
43cc73f12d fix: hermes migrate openclaw imports secrets only with --migrate-secrets
First-run setup keeps passing --migrate-secrets (what core's old OpenClaw step did); the named
command forwarded setup's choice too, so API keys and bot tokens came over without being asked.
2026-11-01 19:53:24 -08:00
Teknium
afc5c55d47 feat: setup and hermes migrate offer the OpenBot import too 2026-11-01 19:53:24 -08:00
Teknium
3053b9dd92 feat: hermes migrate and setup move Grok Bot users over; hermes migrate <agent> installs the importer
Grok Bot joins setup's "Coming from another agent?" step (detected from its desktop app
or a downloaded grok-bot-export file). Bare `hermes migrate` offers the same import on an
existing install; `hermes migrate <agent>` imports from one agent, installing the
agent-importers plugin from the catalog when missing. A plugin too old for the picked
importer is updated once and the import retried, for setup and migrate alike.
2026-11-01 19:53:24 -08:00
Teknium
005fbe8058 fix(update): stash only what the update collides with, and ask before stashing
`hermes update` ran `git stash push --include-untracked` on every dirty tree,
so any untracked folder in the checkout was hashed into git objects and
deleted from disk, then written back on restore. A 55 GB leftover worktree
copy (2.8M files) made the "stashing before update" step take minutes, and
declining the restore left the whole folder parked in git stash.

- Untracked entries are stashed only when a ref the update can land on
  (target, origin/<branch>, local <branch>) has a file at that path, or a
  parent/child of it; the rest stay on disk via exclude pathspecs, because a
  pull or checkout never refuses on them. Comparison is casefolded so a
  case-insensitive filesystem still counts Config.py vs config.py. Forks and
  unreadable target trees keep the old stash-everything behaviour (the
  upstream sync lands on a ref fetched later).
- An interactive terminal now asks "Keep these changes after updating?"
  BEFORE anything is stashed. Yes stashes and restores without a second
  prompt; no deletes exactly what would have been stashed, so no stash
  entry is left behind. A run with nothing to pull does not ask. Gateway
  /update, --yes and non-interactive (Desktop) paths are unchanged apart
  from the scoped stash.
2026-11-01 10:08:01 -08: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
2f644f3fed Merge origin/main into copilot-seams/integration
Conflict: hermes_cli/env_loader.py import block. Kept the branch's
left_core_migration.profile_env_names import and main's ConfigBackend
switch (load_yaml_file_readonly no longer imported; _load_secrets_config
reads through config_backend.read_config_doc_readonly).

No main commit since 0c771d7a5b touches Copilot code; nothing to port.
2026-10-25 21:02:41 -07:00
Teknium
ee3bcbbbc1 docs: GitHub Copilot is the github-copilot labs plugin; document the provider seams
Provider pages (en + zh-Hans) replace the built-in Copilot sections, table
rows and env rows with a pointer: `hermes plugins install github-copilot`
(labs: built by Nous Research, not supported), auto-installed for profiles
that already use copilot/copilot-acp, sign-in with `hermes auth add copilot`
or COPILOT_GITHUB_TOKEN/GH_TOKEN/GITHUB_TOKEN (gh and Copilot CLI logins are
no longer read). The model-provider plugin guide gets one table of every
ProviderProfile field and hook in providers/base.py, and its examples point at
the labs plugin. The hermes-agent skill references and the
cli-config.yaml.example provider list drop the built-in Copilot rows.
2026-10-25 20:47:11 -07:00
unsupportedpastels
395c673739 fix(webapp): point to --no-open when a private launch opened no visible browser
On macOS webbrowser.open can return True with no page the user sees: over SSH osascript opens the browser on the Mac's own screen, and a sandboxed browser may refuse a file: page in a hidden folder. After a private launch, say how to get the link. The docs no longer say an SSH session always prints the link: that holds on the BSDs and illumos. The private-launch docstring notes that on macOS the URL reaches osascript on stdin, so the page mainly protects the BSDs and illumos.
2026-10-25 23:32:04 -04:00
unsupportedpastels
166bc0f822 fix(webapp): open private launch links through a user-only page
Where nothing checks who redeems a one-use launch link (macOS, the BSDs, illumos, WSL), hermes webapp printed it, and any local user who read it first could redeem it within its 60 s. TCP loopback has no peer-credential call on those platforms. The launcher now writes the link into a 0600 page in the gateway home's user-only webapp folder and opens that page, so the browser launcher's command line carries only the page's path and nothing is printed. It still prints the link where it cannot open a browser and on WSL.

Refs #144648 (WA-12)
2026-10-25 23:32:04 -04:00
emozilla
bf8e96e233 docs(webapp): say that on Windows nothing checks who spends a launch link
The guides and the launcher's docstring said, or implied, that on Linux and Windows the gateway
checks who redeems a one-use launch link. Only Linux does: on Windows the check returns yes for
every connection, and the link is protected because it travels only in the browser launcher's
command line, which other standard users cannot read. A reader weighing a shared Windows machine
was told the server authenticates the browser when it does not.

The peer check's docstring, the launcher's module docstring, the CLI reference and the Desktop
guide now say what each platform does: Linux checks the connection's user, Windows relies on the
launcher's private command line, and macOS, the BSDs and WSL print the link instead.
2026-10-25 03:22:38 -07:00
emozilla
b70215d46a fix(webapp): hermes webapp under WSL prints a launch link the Windows browser can use
Under WSL2 the Windows browser reaches the gateway's loopback port through WSL's localhost relay, and
inside Linux that connection belongs to root. The gateway treated WSL as Linux: it gave hermes webapp
a launch link that only a connection owned by the gateway's user may spend, so every link was
refused, and the page told the user it "was already used or has expired. Run hermes webapp again",
which failed the same way. The loopback Webapp could not be opened from Windows at all.

The connection cannot be tied to the user there (any Windows account can reach the relayed port), so
WSL now takes the macOS path: the link is printed for the user to open by hand and spends without
the peer check. Native Linux keeps the check. Live on this machine's WSL2 (NAT): before, curl.exe from
Windows arrived as uid 0 and got 403; after, the printed link spent with 200.
2026-10-25 03:22:37 -07:00
emozilla
e77feea88d fix(webapp): on the LAN, open the address Web Access registered Nous sign-in for
With the Webapp on every interface (`webapp.host: 0.0.0.0`) and no `webapp.public_url`, `hermes
webapp` on the host opened the loopback address. Web Access Start registers Nous sign-in for the
LAN address's callback, so a sign-in started there sent the Portal a callback for 127.0.0.1 that it
had never seen, and failed.

For a launch behind the sign-in gate the gateway now opens, in order: `webapp.public_url` when set,
as before; on the LAN, the address in Start's `webapp/sign-in-registration.json`, while that is
still this machine's LAN address and the Webapp's port (a moved address or port would send the
browser elsewhere); otherwise the loopback address, which still serves a password provider and
sign-in set up by hand for it. Native clients keep the loopback address. The docs say so.
2026-10-25 03:22:32 -07:00
emozilla
b140bf4039 fix(webapp): print a one-use link on macOS instead of the long-lived browser credential
Where nothing can check who redeems a launch link (macOS and the BSDs), `hermes webapp` printed the
gateway's browser credential as `#hermes-session=<token>`. That link signed a browser in as the user
until the next sign-out, and when Hermes ran the command through its terminal tool the credential
landed in the transcript.

The gateway now mints a launch ticket there too: the same one-use, 60-second link Linux and Windows
get, which spends without the peer check, as a window ticket does. `hermes webapp` prints it with its
lifetime and still never passes it to a browser launcher, whose arguments other local users can read.
A copy that leaks is spent once the user opens it and dead after 60 seconds, instead of working until
the next sign-out. The docs describe the macOS link as the one-use link it now is.
2026-10-25 03:22:31 -07:00
emozilla
9538b1b040 fix(webapp): end the account tokens of a signed-out browser login on the Webapp too
A browser that signs in to the gated Webapp keeps the sign-in provider's access and refresh token
in its cookies. Only the cookie path checked the login's binding to the browser credential, so
after `hermes webapp --sign-out` those tokens still worked when presented on their own: the access
token as `Authorization: Bearer` (enough to mint a host-terminal ticket) and the refresh token on
`/auth/native/refresh`, where the bundled password provider hands out a new 30-day refresh token
every time. Refusing a recorded list of those tokens would not hold: the password provider decodes
base64 leniently, so another spelling of the same token, such as the quoted value the cookie
stores, verifies too.

On the gateway's Webapp behind the sign-in gate, a provider token now works on its own only when
the listener gave it to a native app's RFC 8252 sign-in (`/auth/native/token`, then each
`/auth/native/refresh`). The listener keeps a digest of each such token until it expires, in
`webapp/native-sign-in-tokens.json` in the gateway home, so native apps stay signed in across a
sign-out and a restart. A browser login's tokens work only as that login's cookies, which
sign-out, or a credential replaced while no gateway ran, already ends. The standalone dashboard
and the gateway's private listener keep main's behaviour. `hermes webapp --sign-out` and the docs
now say that those tokens end and that native apps stay signed in.
2026-10-25 03:22:31 -07:00
emozilla
7e2972f249 fix(webapp): open the Webapp's public URL to sign in when webapp.public_url is set
Behind the sign-in gate, hermes webapp opened the gateway's loopback address even when
webapp.public_url was set. Sign-in started there and kept its state cookie on the loopback
address, but its callback is built on the public URL, so an OAuth sign-in such as the Nous
account's came back to an address without that cookie and failed with "Missing PKCE state
cookie".

A gated launch now opens the listener's own public URL, path prefix kept, with the profile
query after it, so sign-in starts and finishes on the same address. Without a public URL it
still opens the loopback address, and native clients keep dialling loopback. The CLI and
configuration docs say which address is opened.
2026-10-25 03:22:30 -07:00
emozilla
ac64150960 docs(webapp): describe sign-out behind the sign-in gate and where launch links work
The Webapp docs said `hermes webapp --sign-out` signs out the tabs a launch link signed in. They
now say it also signs out every browser that signed in with a dashboard account behind the
sign-in gate, closes Bot Desktop viewers with the rest of a tab's connections, reports how many
connections it closed, waits for a gateway that is still starting, and replaces the stored
credential itself only when no gateway runs. The private-link fallback is documented for the BSDs
as well as macOS, and the developer guide records how a Webapp login is bound to the browser
session token (the hermes_webapp_signin cookie).
2026-10-25 03:22:25 -07:00