Skip to content

feat(dashboard): hermes dashboard register for self-hosted OAuth client - #38802

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-c2ec639e
Jun 4, 2026
Merged

feat(dashboard): hermes dashboard register for self-hosted OAuth client#38802
teknium1 merged 2 commits into
mainfrom
hermes/hermes-c2ec639e

Conversation

@teknium1

@teknium1 teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #38771 (@benbarclay) onto current main. Adds hermes dashboard register — registers this install as a self-hosted dashboard with the user's Nous Portal account and writes the resulting agent:{id} OAuth client ID into ~/.hermes/.env, replacing the manual browser round-trip.

Changes

  • hermes_cli/dashboard_register.py (new): token resolution (resolve_nous_access_token, auto-refresh) → POST {portal}/api/oauth/self-hosted-client → idempotent save_env_value of HERMES_DASHBOARD_OAUTH_CLIENT_ID (+ HERMES_DASHBOARD_PORTAL_URL on non-default portals). Docker-style auto-naming, --name/--redirect-uri/--portal-url flags, managed-install refusal, 401/403 error mapping.
  • hermes_cli/main.py: nested register subparser — bare hermes dashboard unchanged.
  • tests/hermes_cli/test_dashboard_register.py (new): 12 unit tests.

Validation

Result
test_dashboard_register.py 12/12 pass on current main
dashboard register --help renders; bare hermes dashboard still launches server
Consuming gate HERMES_DASHBOARD_OAUTH_CLIENT_ID + HERMES_DASHBOARD_PORTAL_URL read by plugins/dashboard_auth/nous
NAS dep #324 (POST /api/oauth/self-hosted-client) merged 2026-06-04

Both contributor commits cherry-picked with @benbarclay's authorship preserved. Closes #38771.

Infographic

hermes-dashboard-register

…ient

Adds a CLI command that registers this install as a self-hosted dashboard
with the user's Nous Portal account, automating the manual browser flow on
/local-dashboards.

- New hermes_cli/dashboard_register.py: resolves a fresh Nous access token
  from auth.json (fast-fails with a `hermes setup` hint when not logged in),
  POSTs to {portal}/api/oauth/self-hosted-client, and writes
  HERMES_DASHBOARD_OAUTH_CLIENT_ID into ~/.hermes/.env idempotently.
- Docker-style adjective_noun auto-naming; --name and --redirect-uri overrides.
- Persists HERMES_DASHBOARD_PORTAL_URL only when non-default and unset (so a
  Vercel preview / staging portal sticks, prod default stays implicit).
- Refuses in managed/hosted installs (the orchestrator stamps the client_id).
- Post-register hint explains the OAuth gate only engages on a non-loopback bind.
- Nested 'register' subparser leaves bare `hermes dashboard` unchanged.
- 9 unit tests (name gen, fast-fails, POST shape, env writes, redirect URI,
  portal-URL persistence, 401/403 mapping); dashboard lifecycle tests still green.

Depends on NousResearch/nous-account-service#324 (the portal endpoint).
…ride in register

The register command resolved the portal base URL purely from the stored
login, ignoring any override. That meant `HERMES_DASHBOARD_PORTAL_URL` (and
the absence of any flag) gave no way to point registration at a staging or
preview portal — the request always hit the login's portal, returning 404
against a branch that wasn't deployed there.

- _resolve_portal_base_url now takes an optional override (precedence:
  override > stored login portal > prod default).
- New --portal-url flag; falls back to HERMES_DASHBOARD_PORTAL_URL env.
- Documents that the access token must be valid at the overridden portal
  (it's minted by whoever you logged into).
- 3 new tests for override precedence.

Verified live against the PR #324 Vercel preview: CLI -> preview endpoint ->
real agent:{id} client_id written to .env.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-c2ec639e vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9783 on HEAD, 9781 on base (🆕 +2)

🆕 New issues (2):

Rule Count
unresolved-import 1
invalid-argument-type 1
First entries
tests/hermes_cli/test_dashboard_register.py:24: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/hermes_cli/test_dashboard_register.py:194: [invalid-argument-type] invalid-argument-type: Argument to `HTTPError.__init__` is incorrect: Expected `Message[str, str]`, found `None`

✅ Fixed issues: none

Unchanged: 5074 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 4, 2026
@teknium1
teknium1 merged commit c2ca3f0 into main Jun 4, 2026
23 checks passed
@teknium1
teknium1 deleted the hermes/hermes-c2ec639e branch June 4, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants