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>
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.
`--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>
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>
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.
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.
`--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.
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").
`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.
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
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.
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>
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
`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>
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.
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
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.
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.
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.
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.
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.
`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>
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.
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).
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.
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".
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.
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.
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.
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
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.
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.
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.
`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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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).