Commit Graph

7 Commits

Author SHA1 Message Date
arya 26932ea0bf fix(desktop): retain registry session ownership 2026-08-25 22:51:31 -07:00
Teknium b0af119963 fix(desktop): resolve the owning remote profile before a hint-less session read falls through to local
Fixes #85834 (Electron REST intercept fall-through). The
/api/sessions/{id}[/messages] intercept in electron/main.ts required an
explicit ?profile= (or request.profile) to route a read to its remote owner;
callers without a hint fell straight through to the LOCAL backend and 404'd
on its state.db even though the session lives on a configured remote — while
the list endpoints happily showed the row (remoteSessionList tags s.profile).

When no explicit profile resolves, consult the same remote session lists the
list endpoints use to find the owning profile (matching id or lineage root
id), memoized for 30s so a transcript+messages burst costs one sweep. Only
when the id is genuinely unknown remotely does the request fall through to
local, exactly as before. Pure lookup lives in profile-session-routing.ts
with unit tests (owner hit, lineage-root match, null on miss/dead
remotes/no remotes).

Maintainer commit (cluster salvage).
2026-08-23 17:43:39 -07:00
Teknium d354af5e12 feat(desktop): unified Sessions list shows every connected gateway's chats (#88880)
The global SESSIONS sidebar only aggregated local profiles and v1 per-profile
remote overrides. Sessions living on v2 registry connections (remote/cloud/ssh
gateways) never appeared — the remote API returned the rows, but the renderer's
Sessions component received an empty array (#88880).

- electron/profile-session-routing.ts: fetchRegistrySessionRows reads each
  CONNECTED registry gateway's session list (ssh backends natively, shared
  remote/cloud hosts via one cross-profile aggregate with a legacy flat-list
  fallback), tagging rows with connection_id + owning profile.
  spliceRegistrySessionRows dedupes them into the unified list and extends
  per-profile totals. Reads never pass include_hidden, so Bot Mode's hidden
  canonical chats stay OUT of the global list, same as local sessions.
- electron/main.ts: mergeRemoteProfileSessions splices registry rows; the
  /api/profiles/sessions[+/sidebar] intercepts also fire when registry
  gateways are pooled (previously only v1 remote overrides). Only
  already-pooled backends are read — a sidebar refresh never dials or spawns
  a backend (the roster-respawn trap), and a dead gateway contributes nothing.
- types/hermes.ts + use-session-actions: SessionInfo carries connection_id;
  resuming a registry-owned row activates its connection-scoped gateway
  (ensureGatewayAgent) instead of a same-named local profile.
- store/gateway.ts: ensureActiveGatewayOpen rides out an in-flight secondary
  activation (bounded 8s) instead of failing instantly — the Sessions "+"
  during remote wake no longer errors "Hermes gateway is not connected".

Tests: 5 new registry-source/splice unit tests (tagging, shared-host
aggregate + legacy fallback, dead-gateway isolation, hidden-flag contract,
dedupe/totals) and a sabotage-verified activation-wait regression test.
2026-08-18 14:27:15 -07:00
David Dudok de Wit 8477a5a83d docs(desktop): document profile scope helpers
Add JSDoc to the exported helpers introduced by the profile-scoped sidebar change.
2026-08-16 02:44:08 -07:00
David Dudok de Wit e264b48394 fix(desktop): scope messaging to active remote profile
Complete the sidebar profile-scope contract across remote Electron routing, older-backend fallbacks, standalone messaging refreshes, and pagination. Reject stale profile responses and keep the explicit all-profiles view unified.

Co-authored-by: 墨綠BG <s5460703@gmail.com>

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
2026-08-16 02:44:08 -07:00
Jakub Wolniewicz 21b57c61f4 fix(desktop): page remote profile session reads 2026-08-14 20:23:47 -07:00
Vitor Cepeda Lopes 704a321870 fix(desktop): preserve OAuth sessions in sidebar 2026-07-27 13:41:56 -05:00