Two structural fixes from the Desktop performance audit (P2 tier):
1. Scope live tool-diff subscriptions. `ToolEntry` subscribed to the whole
`$toolDiffs` map via `useStore`, so one `recordToolDiff` re-rendered every
mounted tool row. Add a cached per-toolCallId derived atom
(`$toolInlineDiff(id)`, mirroring the existing `$toolDisclosureOpen` pattern);
computed() only notifies when that id's diff string changes, so a live patch
re-renders one row.
2. Narrow profile / gateway-switch query invalidation. Both the active-profile
subscription and `wipeSessionListsForGatewaySwitch` called keyless
`queryClient.invalidateQueries()`, refetching account/marketplace/onboarding
caches on every switch. Add `invalidateProfileScopedQueries()` with a
denylist of profile-independent roots (billing, marketplace-themes,
onboarding-model-options, contrib-logs-tail). A denylist is correctness-safe:
a root we forget just refetches (cheap), whereas an allowlist that misses a
profile-scoped key would paint the previous profile's data.
Tests: per-tool notify isolation, and real-QueryClient invalidation partition
(profile-scoped invalidated, global left intact, unknown keys invalidated).
Add first-class profile support to the desktop app without app reloads.
- Swap the single live gateway onto a session's profile lazily (spawned on
demand by the Electron backend pool), so one backend serves the active
profile and others stay cold — no OOM with many profiles.
- Aggregate sessions across profiles by reading each profile's state.db
read-only; unified "All profiles" view groups sessions per profile with
per-profile pagination, while the default view stays scoped to one profile.
- Add an Arc-style profile rail at the sidebar foot: a default<->all toggle
pinned left, colored named-profile squares scrolling between, Manage pinned
right. Profile identity is a deterministic per-name color.
- Route profile-scoped REST (config/env/skills/tools/model) to the active
gateway profile and invalidate React Query caches on swap. Single-profile
users never trigger a swap, so their path is unchanged.
Backend:
- web_server: profile-aware active/list endpoints + per-profile session
totals; hermes_state: session_count(exclude_children); main.py: honor
--profile over HERMES_HOME env for pooled backends.
UI primitives:
- Add a position-aware Tip tooltip (instant, themed) as a drop-in for native
title=, and strip redundant tooltips from self-descriptive chrome.