Files
hermes-agent/apps
Teknium d12bc0c4d9 fix(desktop): active gateway is never a session-RPC routing authority
Step 2 of removing 'active gateway' as a routing input. A session's backend
is a property of the SESSION (its profile), never of whatever the window is
currently showing. The active-profile fallback was the root cause of Bot Mode
'session not found' / hangs: a hidden/unlisted session with an unknown owner
was silently dispatched to the active profile's backend, which never owned it.

- sessionRpcNeedsProfileRoute: drop the active-profile comparison entirely. A
  KNOWN owner (route or profile name) ALWAYS routes to its own profile's
  socket; only a null/empty owner (fresh draft, global chrome) routes ambient.
  A primary-profile owner collapses back to the primary socket inside
  gatewayForProfile, so the reauth-aware reconnect path is unchanged.
- session.ts: split knownSessionProfile (row -> hint, undefined when unknown)
  out of rememberedSessionProfile. rememberedSessionProfile keeps its active
  fallback but is now documented as PRESENTATION-only (navigation keying),
  never routing.
- wiring requestGateway: resolve the owner from the tile route -> known
  profile -> a cross-profile REST probe (resolveSessionProfile, stamps
  ownership) before dispatch; only a request with no session at all falls to
  ambient. Never the silent active fallback.

Tests updated to the new contract + knownSessionProfile coverage asserting it
returns undefined (not active) for an unknown session. tsc 0 errors.
2026-08-23 17:43:39 -07:00
..