mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Two fixes surfaced by the first live end-to-end test of cloud sign-in (both would have shipped broken — green units + code review did not catch them). 1. Portal session is PRIVY, not Hermes-gateway cookies (Q7). Phase 3 polled for hermes_session_at/rt on the portal host, but the Nous portal (NAS) is a Privy-authed Next.js app — it sets privy-token (which NAS auth() and the /api/agents cookie path both read). The sign-in window therefore never detected success and hung. Fix: cookiesHavePrivySession (privy-token + __Host/ __Secure/legacy privy-session variants) in connection-config.cjs, and hasLivePortalSession now checks the Privy cookie on the portal host. The per-agent silent cascade still uses the gateway-cookie check (each agent IS a Hermes gateway). 2. Multi-org discovery needs an org picker (Q8). A portal session carries no org pin, so a user in >1 org got a dead-end 403. Paired with NAS #545 (merged): /api/agents now returns 409 org_selection_required + the user's org list, and accepts a membership-validated ?org=. discoverCloudAgents(org) appends ?org=, and on 409 returns { needsOrgSelection, orgs } instead of throwing; the cloud panel shows a 'Choose an organization' picker, then re-runs discovery scoped to the chosen org (with a 'Change org' affordance for multi-org users). Also reverts the ERR_NETWORK_CHANGED retry helper from the prior commit: the IPv6-churn aborts on Ben's Arch host are a host/network-layer issue, and a client reload can't safely drive Privy's single-use-code redirect chain (disable IPv6 for the session is the workaround). Kept out of this feature PR. Tests: connection-config.test.cjs (57, +5 Privy-cookie cases, proven to fail without the helper); boot-failure-reauth (16). tsc + eslint clean. Verified live end-to-end against prod portal: sign-in → org picker → scoped agent list → silent per-agent connect. cloud-auto-discovery Phases 3+4 follow-up (decisions.md Q7, Q8). |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||