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.
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.
/api/status is public so the native-app login probe and uptime checks can
read it without a session. On the gateway's Webapp behind its sign-in gate
(a wildcard bind reaches everyone on the network) it also answered every
caller with the profile names (profiles, parked_profiles,
gateway_shared_with), the install id, host memory and disk figures, the
Nous session state and session counts, and its ?profile= 404 told which
profile names exist.
The Webapp now answers a caller it cannot verify with liveness and the
sign-in shape only (version, release_date, gateway_running, gateway_state,
overall, components, auth_required, auth_providers, auth_flows) and ignores
?profile= for it. A signed-in browser or a native app's bearer gets the full
payload: the route checks the session the gate would accept (sign-in
binding included) through the existing _require_token, with a side-effect
free peek, since the gate skips public paths. The standalone dashboard and
every loopback listener answer as before: Hermes Cloud lists profiles from
the dashboard's public body (#60585).
Reported by @kshitijk4poor. The public-path session check follows the
approach in #97303.
Refs #144648
Refs #97302
Co-authored-by: Alexandre Mallet <alexandre.mallet@buldee.com>
Three Web Access issues found live by @dokterdok on a Mac (#144648):
- A gateway restart whose child exits at once (e.g. `run hermes pm repair`) left the pane
waiting 90 s for a generic timeout. /api/webapp-access/status now reports
`restart_failure` {pid, exit_code, reason}: the newest restart of that gateway exited
nonzero, with the last line it wrote to logs/gateway-restart.log. The pane matches the
pid its restart answered and says "The gateway couldn't restart: <reason>".
- /apple-touch-icon.png (the Webapp's page icon) sat behind the sign-in gate while
/favicon.ico did not, so cookie-less icon fetches hit the auto-SSO redirect and logged
orphan login_start entries. It joins the gate's public list, matched exactly.
- Under "My own URL", the address row kept the LAN address while the field was empty;
before web access starts it now shows the address being chosen.
Refs #144648
The speak and transcribe stream sockets refused the local Desktop's own
credential. They now redeem the interactive runtime ticket through the existing
native gate (no Origin, loopback peer, served profile) and run in the grant's
profile. Desktop sends the ticket as a subprotocol and its main process strips
Origin only for those two paths on a fresh /api/ws reservation.
Rows RT-71, RT-80.
Refs #143547
Co-authored-by: Dolverin <5910064+Dolverin@users.noreply.github.com>
With the Webapp off, `hermes dashboard` behind its sign-in gate answered 403 to every write its own
page made through a plain-HTTP reverse proxy that forwards with the upstream's Host and no
dashboard.public_url: the browser sends no Fetch Metadata to a plain-HTTP origin, and the
cookie-origin check carried for the Webapp compared the page's Origin with the server's own URL.
Main admitted those writes, and sign-out through /auth/logout stayed a plain public path.
The check, and the sign-out's place in it, now belong to the gateway's Webapp listener only: the
surface policy gains own_origin_cookie_writes, true for the Webapp and false for the dashboard and
`hermes serve`, and the gate asks for it before refusing a cookie write. The Webapp's refusal names
webapp.public_url. Tests that pinned the check on the dashboard now run on the Webapp surface, and
the dashboard's parity is pinned in test_dashboard_auth_middleware.
The previous change kept the Webapp's Portal client in the Nous sign-in plugin's module. Plugin
discovery imports that bundled plugin under a module name of its own
(hermes_plugins.dashboard_auth__nous), so the gateway's import of plugins.dashboard_auth.nous was
a copy discovery never ran. In a real gateway the Webapp kept signing in with
HERMES_DASHBOARD_OAUTH_CLIENT_ID, and on a home with only Web Access's client the Webapp found no
sign-in provider and fell back to the private listener. A live run of the gateway's own start
showed both; the earlier tests imported the plugin directly and passed.
The listener's client and the plugin's provider swap now live in
hermes_cli.dashboard_auth.listener_client, one module that the plugin, however it was imported,
and the gateway share. The plugin offers its swap when discovery runs it, so a plugin that
plugins.disabled keeps from loading still gives the Webapp no Nous sign-in. The tests load the
plugin the way discovery does.
Cookies are not scoped to a port, and only the sign-in binding cookie was named for the gateway. The
login itself (hermes_session_at, _rt, _provider) kept main's names, so when a browser signed in to a
second gateway on the same hostname (another user's, or a standalone profile's on 9121) with its own
sign-in provider or provider secret, those cookies replaced the first gateway's login and the first
Webapp answered session_expired. Signing out of one in the browser cleared the other's login too.
On the Webapp's listener every sign-in cookie it sets is now named for the gateway, with the same
suffix as the binding: the access and refresh token, the provider hint, the OAuth state cookie and
the auto sign-in marker. The listener reads and clears only those names, so cookies with main's names
(the standalone dashboard's on the same hostname, or this branch's earlier builds) are left alone
and such a browser signs in again. The standalone dashboard keeps main's names. Native Desktop's
check for a cookie login on a remote gateway accepts the per-gateway names.
Every gated Webapp bound its browser logins with a cookie named `hermes_webapp_signin`. Cookies are
not scoped to a port, so a browser that used two gateways' Webapps on one hostname (two profiles'
gateways on different ports, say) kept one such cookie for both: signing in to the second replaced
the first one's binding, and the first then answered as signed out. Where both gateways accept the
same account tokens (one sign-in provider setup), this cookie was the only thing they fought over.
The cookie is now named `hermes_webapp_signin_<gateway>`, with a suffix from a digest of the gateway's
home. It stays the same across restarts and differs for every gateway on one machine, so each
Webapp keeps its own binding, and signing one gateway's browsers out leaves the other's alone.
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.
`hermes webapp --sign-out` replaced the browser session token and closed the sockets that token
had opened. On a Webapp behind the sign-in gate (a wildcard bind, or a public URL in front of a
loopback bind) browsers never hold that token: they sign in with the dashboard's password or
OAuth provider and keep that login in cookies. Sign-out reached none of it. After it, a signed-in
browser still read /api/sessions, minted socket tickets, and kept its chat socket and host
terminal open, so signing out to cut off a lost device left that device a live host shell.
Each login on the gateway's Webapp is now bound to the browser session token. A password login
or OAuth callback there also sets the HttpOnly cookie hermes_webapp_signin, the hex
HMAC-SHA256 of "webapp-sign-in" keyed with the current token, with the session cookies' Path,
SameSite and Secure policy; a refresh renews it with them. The gate treats a cookie session on
the Webapp without a matching value as signed out: API requests get 401 with the login URL and
pages go to /login. Replacing the token therefore signs every browser out, whichever provider it
signed in with, and so does the CLI replacing the stored token while no gateway runs.
A request whose binding checked out records the token's digest, and the socket tickets it mints
(chat, host terminal, /api/auth/ws-ticket) carry it. Redeeming such a ticket after a sign-out
opens nothing, and the socket it opens is tracked like a token socket, so sign-out closes it with
4401. The verb now reports whether the gate is on and how many browser sockets it closed. The
standalone dashboard never sets or checks the binding and keeps its logins as before.
The gateway's Webapp listener read dashboard.public_url, the setting that describes `hermes
dashboard` behind a reverse proxy, to decide whether to require sign-in on a loopback bind, which
outside hostname to accept and where to send sign-in callbacks. So a user with a proxied dashboard
got a Webapp that demanded sign-in and accepted the dashboard's hostname, and with no sign-in
provider the gateway exited outright; and the Web Access pane had to rewrite dashboard.public_url
to publish the Webapp, breaking the dashboard it belonged to.
The Webapp now has webapp.public_url: an optional http(s) address with no credentials, query or
fragment (anything else keeps the Webapp off, like the other webapp settings). On the Webapp
listener it alone engages sign-in on a loopback bind, is the one outside hostname accepted, and is
the base of the sign-in and MCP OAuth callbacks and of the Origin check for browsers without Fetch
Metadata; dashboard.public_url never applies there. The listener records its own URL on the app
state and the shared resolver returns it; `hermes dashboard` declares none and reads
dashboard.public_url exactly as before. When the Webapp's URL needs sign-in and no provider is
registered, the gateway's reason names webapp.public_url. The key is in DEFAULT_CONFIG and the
configuration docs.
Ported from BearHuddleston's #93508.
SameSite=Lax keeps cross-site pages from sending the sign-in cookie, but a same-site sibling
(another port or subdomain) still sends it. A write that carries the cookie now has to come from
the dashboard's own origin: the browser's Sec-Fetch-Site decides when present, otherwise Origin
must match. Native clients and bearer tokens are unaffected.
Co-authored-by: emozilla <emozilla@nousresearch.com>
Carried from BearHuddleston's #93508 onto main. The Webapp relay and the
profile-incarnation fence stay out: carried code follows main's
named-profile rule and refuses a missing or deleted profile home.
- Webapp routes: one-use launch tickets, window handoff, and gateway
WebSocket tickets minted for the signed-in browser
- Browser surface policy and the SPA document policy
- A host terminal for the browser that survives reconnects
- Staged browser uploads and file tickets; file.attach takes a staged upload
- hermes sessions adopt
- Webapp bundle build helpers and the renderer freshness check
- Regenerated gateway contracts
Co-authored-by: emozilla <emozilla@nousresearch.com>
The single-use assertion reused a ticket against `keep`, which its first use
had just deleted, so the second request was refused whatever the ticket. It
now PATCHes the default profile (a display-name rename that never moves the
home) twice with one ticket: the reuse is 401 and a fresh ticket's identical
PATCH is 200, so only the reuse explains the refusal.
Smaller items from the same review: _redeem_http_ticket checks capabilities
against runtime_bootstrap._PURPOSE_CAPABILITIES instead of re-typing them, and
run_turn_runner drops its duplicate session_policy import.
Review finding by @dokterdok on #140970
Review finding by @kshitijk4poor on #140970
Refs #134889 (DB-5)
Refs #140719
Profiles named `active`, `import` or `sessions` are valid (PROFILE_ID_RE, not
reserved), and PATCH/DELETE /api/profiles/<that name> reach the per-profile
handlers, but grant selection (Desktop nativeGrantPurpose), ticket routing
(scopedProfileOf), ambient scoping (pathWithProfileScope) and the gateway
(_registry_target, _check_profile_scope) all matched the collection suffixes
whatever the method. So those profiles could never be renamed or deleted from
Desktop, and an ordinary native-http grant could PATCH/DELETE the profile
named `sessions` through the aggregate-selector branch.
- One method-aware table per language: native_http.PROFILE_COLLECTION_ROUTES /
profile_collection_route() and apps/desktop/electron/profile-routes.ts
(replacing the three Desktop copies). A path-only caller keeps the old
any-method reading.
- The registry grant now covers those names; the aggregate branch only
applies to the collection's own method, so native-http PATCH/DELETE of
`sessions` falls to the per-profile branch and is refused.
- _check_registry_scope refuses when the launch home is unknown, and compares
homes with hermes_home_key() as SessionAuthorities does.
- local-gateway-python.ts imports GatewayTicketPurpose instead of re-spelling it.
Review finding by @kshitijk4poor on #140970
Review finding by @dokterdok on #140970
Review finding by @greptile-apps on #140970
Refs #134889 (DB-5)
Refs #140719
A multiplexing gateway refused PATCH/DELETE /api/profiles/<name> under every
native grant, even one minted for that very profile, so the Desktop Profiles
screen could never rename or delete a profile while a gateway ran (403
profile_scope_mismatch). Separately, the Desktop's registry route appended the
ambient ?profile= (the sidebar's profile, or "__all__") to a path that already
names its profile, so SOUL reads/writes 403'd for every profile but the
active one, and for all of them in All-profiles scope.
One grant design for both:
- gateway/runtime_bootstrap.py: new `native-profile-registry` purpose
(capability `profiles:registry`), the twin of `native-profile-create`.
- native_http: that grant redeems only for PATCH/DELETE /api/profiles/<name>,
only for the profile it was minted for, never deletes or moves the
gateway's launch home (the default root's presentation-only rename stays
allowed), and is single-use. An ordinary native-http grant keeps refusing
both writes; a registry grant authorizes nothing else (401).
- Desktop: nativeGrantPurpose() mints the registry grant for those two
writes; pathWithProfileScope never adds the ambient profile to an
/api/profiles/<name>/... path (collection routes still get it).
Refs #134889 (DB-5)
Refs #134889 (DB-6)
Refs #140345
Refs #140346
Refs #140791
Refs #140719
A local Desktop talks to its gateway with authMode "native" and no static
token, so pluginSocket dialed /api/plugins/<id>/... with an empty ?token=.
The canonical WS gate (web_server_chat._ws_auth_reason) refused every such
upgrade: Kanban stayed on its 60 s poll, third-party ctx.socket was dead, and
the reconnect loop re-dialed every <=30 s forever, keeping an idle-exit
gateway awake.
The plugin socket now rides the credential its REST twin already uses on a
local gateway: the one-use native-http grant in X-Hermes-Gateway-Ticket.
- Gateway: GatewayRuntimeAPI stamps the raw socket peer on WebSocket scopes
too. PluginApiWebSocketGate redeems the grant once, ahead of routing
(native_http.redeem_native_ws: the HTTP seam's exact checks - single header,
no Origin, loopback peer, ready/served profiles, native-http purpose and
capability - plus the profile selectors, /api/plugins/ paths only), binds
the grant profile's home and secret scope for the whole connection, and
requires both that profile's and the launch profile's plugin consent before
accept. The route's credential check reads that principal and never
redeems. /api/ws and other core streams keep their purpose-bound credentials.
- Desktop main: hermes:plugin:ws-url mints the grant for the routed profile
and reserves a one-use dial bound to its origin (scheme, host, port) and
path. The path is checked one decoded segment at a time (dot segments, an
encoded slash or backslash, double encoding and bad escapes are refused),
then parsed with the real URL parser and required to stay under
/api/plugins/<id>/, and the dial records that parsed path. The webRequest
hook strips Origin and attaches the header only to an upgrade that matches
that dial, so the grant can't reach another host or another plugin's
path. The grant never enters a renderer URL. The redial/mint/prepare
branch shared by both gateway-socket IPCs moves to
local-gateway.localGatewayDial (main.ts stays under its line cap).
- Renderer: pluginSocket asks main for the URL when authMode is native, with
a deadline (a main process that never answers counts as a refused dial),
and stops after 5 dials in a row that never stay open, including a socket
that opens and closes at once (polling fallback stays).
Refs #134889 (PLG-1)
Refs #139523
Two review findings on the restart-wait attach (#139041):
- During a restart's after-turn wait every HTTP request still got 503 (and
native-HTTP auth refused on _draining), so a fresh Desktop window could
open the WebSocket but never list or open the parked conversation. An
explicit GET allowlist (drain_control.restart_wait_read: health/status,
profile session list + sidebar, session detail, messages, messages/around,
timeline) now passes both the runtime gate and native-HTTP auth while the
wait is open. Writes and every other route keep the drain refusal; stop()
withdraws the window.
- When Desktop itself found a stale-code owner it awaited
`hermes gateway restart` (which waits for the old owner to drain) before
re-discovering, so the only window that could answer a parked prompt sat
blocked behind it. The stale restarter now returns once the restart is
requested; ensure re-polls until the owner reports restart_wait (attach),
a replacement answers, or the restart client exits.
Refs #134889 (GW-6)
Refs #139574
`test_native_profile_create` failed on fd71031264 in 3 of 4 runs: the first native request after
`POST /api/profiles` answered 500 (`'NoneType' object has no attribute 'instance_id'`). Serving the
new profile reserves its registry slot as None, then builds the authority and publishes it to the
descriptor and the ticket store last. The native gate read every slot, so it crashed on the None
and refused (401) every already-served profile until the publish.
The gate now skips the reserved slot and compares the descriptor only with the authorities the
ticket store already serves. A profile that is still being served cannot redeem a grant, so it
gets no access early. After the fix: 5/5 runs green.
The gateway refused /api/profiles/projects/tree and
/api/profiles/sessions/pull-requests for every native grant, because
both scan every profile and a grant names one. The all-profiles
Projects view answered 403 profile_scope_mismatch on every refresh and
the PR scan could not run.
Gateway: both routes take a `profile` that limits the scan to that
profile, and the native grant check treats them like the session lists:
the selector is required and must be the grant's own profile, so `all`,
another profile, or no selector is still refused. Without a selector the
routes scan every profile as before, so token-authenticated clients are
unchanged. Each project now reports the folder key it was merged by.
Desktop: main assembles both reads from one request per profile, each
with that profile's own grant, and merges them the way the gateway does:
one group per folder, a declared project over an auto entry, summed
totals and the newest previews. A profile that cannot be read is
reported in `errors`, and the PR scan only settles ids it could read.
When a hot-serve fails, or an unserve's turn outlives its Stop,
_retire_profile_authority returns False and the authority keeps its registry
slot (its writer may still touch the home) with retiring=True, so it refuses
every admission with runtime_draining. SessionAuthorities.served_profiles /
profile_ids iterated every slot unfiltered and nothing republished when
retiring was set: identify kept listing the profile, discovery said ready
(served wins over parked_profiles), the ticket store kept minting for it, and
every submit then answered runtime_draining.
served_profiles/profile_ids now list only serving authorities (no unbuilt
None slot, no retiring one), retirement republishes the served set the moment
it sets retiring, and the native-HTTP descriptor check compares against the
same filtered view (it would otherwise 401 every native request while a
sibling is retiring). Discovery of the parked profile then falls through to
its parked_profiles verdict.
Test: tests/gateway/test_parked_profile_served_set.py::test_still_retiring_profile_leaves_the_served_set
Review: dokterdok dokterdok-N38
(cherry picked from commit ab3e053d6e42ec89b89c01f26a02630639d96513)
17 conflicts, all from main's lint sweep (ruff UP007/UP017/UP022/UP028/UP031/UP037/UP041,
FURB188/FURB192); no other main commit touches a conflicted file. Resolution: the branch side
of each file plus main's exact autofix (ruff 0.15.10, main's ruff.strict.toml, --fix
--unsafe-fixes). ruff.strict.toml takes main's copy. The pool-retirement live fixture stays
deleted with the pooled backend this branch retires.
8 conflicts, all from main's lint sweep (#135281 "Harder linter fixes" + the RUF series:
implicit-Optional, unused-unpacked-variable, next(...) for [...][0]). No other main commit touches
a conflicted file. Resolution: the branch side of each file plus main's exact autofix
(ruff 0.15.10, main's ruff.strict.toml, --fix --unsafe-fixes) on it. ruff.strict.toml takes main's
copy (the newly enabled rules). tests/cron/test_bot_chat_delivery_child_env.py stays deleted
(1cc9cb9199 retired its lane).
45 conflicts, all from #135177 (lefthook + `ruff check --fix` over 2,366 files). No other main commit
touches a conflicted file. Resolution: the branch side of each file, then main's exact autofix
(ruff 0.15.10, `--config ./ruff.strict.toml --fix`) on it — rewrites only (typing generics, noqa
drops, import forms), no import removed. tests/cron/test_bot_chat_cli_home.py stays deleted
(1cc9cb9199 retired its lane).
The test added with the native-ticket scope fix only exercised secondary
profiles (beta/gamma), which the parent already handled, so it passed
with or without the fix. Replace it with the case the fix actually
changes: a launch-home ticket entered while a foreign profile's home
override is ambient must resolve the launch home and the launch
profile's secrets through a nested implicit config selector. On the
parent the early return for the launch home left the foreign override
in place and the test reads beta's home and secret.
native_profile_scope only enters the ticket's home override; the secret
scope still comes from _config_profile_scope. Update its docstring,
which still described the removed launch-home early return as keeping
ambient behaviour byte-for-byte.
Follow-up to 4e007afee61e (#135061)
Review: https://github.com/NousResearch/hermes-agent/pull/135061
Always enter the ticket-owned home and secret scope, including the launch home, so nested implicit config selectors retain the authenticated profile.
Validation: tests/gateway/test_native_config_owner_scope.py
Implementation and additional regression probes were AI-assisted with GPT-6 Astra.
(cherry picked from commit 4e007afee61e394dbf84ab22d14011c5f5cc2059)
Every root-absolute URL the server-rendered auth pages emit now honours
X-Forwarded-Prefix: @font-face url('/fonts/...') in both the login page
and the RFC 8252 native provider chooser, the chooser's data-prefix
injection, and the SPA logout navigation target. Empty-prefix output is
byte-identical to before.
When the dashboard is mounted at a sub-path via X-Forwarded-Prefix,
auth_callback and auth_password_login returned bare "/" as the
post-login landing URL instead of prepending the prefix. This caused
the browser to navigate outside the proxy mount after a successful
login.
Add _externalize_post_login_target() helper that prepends the prefix
to the validated landing path, and apply it in both auth_callback and
auth_password_login. Paths that already carry the prefix are returned
unchanged; empty prefix (direct deploy) is a no-op.
Reported-by: LeDominik
When the dashboard is behind a reverse proxy at a sub-path (e.g. /hermes),
the post-login redirect next= parameter must include the prefix so the
browser lands at /hermes/sessions instead of bare /sessions.
Auth-route and API-path rejection still operates on the original path
(before prefix) so detection works regardless of the mount point.
Addresses feedback from @grunjol and @LeDominik on #48625.
The login page emitted root-relative URLs (/auth/login, /auth/password-login)
for provider buttons and the password-login JS, breaking the OAuth and
password flows when the dashboard is served behind a reverse proxy at a
sub-path (e.g. /hermes/).
Now render_login_html() accepts a prefix parameter (resolved from the
X-Forwarded-Prefix header via the existing prefix_from_request() helper)
and prepends it to all auth URLs. The password-login JS reads the prefix
from a data-prefix attribute on the <main> element.
Fixes#48623
audit_log() appended with a plain open(path, 'a') and no size cap, so
dashboard-auth.log grew unbounded for the life of the install — the one
log in the auth path outside hermes_logging's rotation.
Add self-contained size-check-and-rename rotation in audit.py matching
the agent.log convention (maxBytes=5MB, backupCount=3, stdlib
.1/.2/.3 naming). The pending record's UTF-8 bytes count toward the
threshold, so a crossing write rotates before appending. Implemented
locally (stdlib os.replace only) to keep the module import-light for
early-loading middleware; reusing _ManagedRotatingFileHandler would
pull in hermes_constants and break that guarantee.
Fixes#57749
The pre-auth POST routes under /auth/ buffered the whole JSON body before validation, with no size limit, so anonymous clients could hold large uploads in memory. A pure-ASGI middleware now answers 413 when Content-Length exceeds 64 KiB, and counts the bytes actually received so chunked or understated bodies are cut off at the same limit. Authenticated routes and WebSockets are unchanged.
Reported-by: Tenable Research
An unauthenticated password-login copied the whole provider string into dashboard-auth.log, on the unknown-provider path and on the rate-limited path alike, so one request could write an arbitrarily large entry to disk. provider is now limited to 128 characters (rejected with 422 before the handler runs), and audit_log caps every string value at 256 characters so a future field cannot reintroduce the same write.
Reported-by: Tenable Research
The host check was a three-branch if/elif mapping each accepted loopback
literal to its URL authority spelling; a lookup table states the same
allow-list in one place. The final urlunparse also re-set scheme, netloc
and fragment even though every earlier check already guarantees they are
canonical (http, netloc == canonical_netloc, '#' rejected), so only the
empty-path -> "/" normalisation is applied. Behaviour and 400 messages are
unchanged.
* refactor(plugins): remove the Sep 2026 decomposition compat layer on schedule
The PLUGIN-COMPAT layer (2776813df3 + d63e380324 + 0a5164cebe) kept pre-#102117 import paths
alive for external plugins until 2026-09-14. That window closed two weeks ago; since then the loader
has already been skipping plugins that use the old paths. This removes the layer itself:
- 328 appended `PLUGIN-COMPAT` blocks (lazy `__getattr__` pointer tables, re-exported third-party
names, restored dead definitions) and the three re-export stub modules
(gateway/startup_watchdog, hermes_cli/observability/relay_runtime, tools/environments/modal_utils)
- COMPAT_MANIFEST.md, compat_manifest.json, scripts/check_compat_pointers.py and its lint step
- the reporting surfaces: CLI banner notice, `hermes plugins compat`, the `hermes doctor` section,
the post-update notice, the Desktop one-time dialog, the loader's pre-import skip and the
`plugins.allow_deprecated_imports` escape hatch
An external plugin that still imports an old path now fails to load with its ImportError as the
reason in `hermes plugins list`, the same path as any broken plugin.
hermes_cli/plugin_compat.py stays as three inert stubs (compat_report, removal_in_effect,
summary_lines): an already-running pre-removal `hermes update` lazy-imports them after the checkout
swap (tests/compat/old_updater_surface.json).
In-tree fallout, both already dead: hermes_cli/setup.py::_check_espeak_ng (no callers; its
`shutil` came from a compat block) and gateway/config.py::SessionResetPolicy ("retained solely for
the scheduled plugin-compat window"). Two test_run_agent patches targeted the removed
`run_agent.handle_function_call` pointer; they now patch `model_tools.handle_function_call`, the
seam production reads, like every sibling test in that file.
* chore: retrigger CI (zero-job startup_failure phantom)
* test: drop resolution allowlist rows for the two deleted which() sites
hermes_cli/setup.py::_check_espeak_ng (dead) and tools/skillevaluator_scan.py::scanner_available
(a restored definition inside a PLUGIN-COMPAT block) no longer exist; the stale-row gate requires
their allowlist entries go with them.
Merge #8: 2,771 commits from main (4b05f764fa). Ports main's moved code into the
unified runtime (run.py/run_turn.py splits, tui_gateway server, backup/restore
split), keeps the detached-daemon Desktop lifecycle, and adapts main's new tests
to the owner/authority contracts (canonical session deletes, retired-id
tombstones, zero-writer browsing, hermes_yaml, platforms() markers).