Files
hermes-agent/apps/desktop/electron
Teknium fceab28602 fix(desktop): cold start no longer hides Cloud agents until Portal re-login
Fixes #73495. Two cold-start defects made the configured Hermes Cloud
agent vanish after a Desktop restart even though the persisted Portal
session was still renewable:

1. hasLivePortalSession() trusted the FIRST cookies.get() on the lazy
   `persist:` partition. It now reuses the warmOauthCookieStore()
   warm-up + bounded reread that hasLiveOauthSession() gained in
   PR #67769, so a single hydration false-negative no longer clears the
   agent list and flips the panel to signed-out.

2. Discovery required the short-lived `privy-token` access cookie but
   treated its absence as a full interactive re-login, even when the
   30-day `privy-session` / `privy-refresh-token` renewal cookies
   survived the process exit. New cookiesHavePrivyAccessToken() splits
   "signed in (renewable)" from "discovery can succeed right now";
   discoverCloudAgents() and cloudAgentSilentSignIn() now mint a fresh
   access token via one bounded, hidden, deadline-capped portal load
   (renewPortalAccessSilently) before or after a 401, and only surface
   needsCloudLogin when renewal genuinely cannot complete.

PRIVY_SESSION_COOKIE_VARIANTS also learns `privy-refresh-token` so a
renewal-only jar still counts as signed in rather than demanding an
interactive login while usable refresh material sits in the partition.

Tests: connection-config.test.ts covers the access/session split,
including the exact renewal-only cold-start jar from the issue repro.
2026-08-14 20:33:39 -07:00
..
2026-08-14 22:16:25 +00:00