The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): use gateway terminology in connection UI
David Dudok de Wit72fc5ab7ca4d
diff --git a/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx b/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsxindex fd245f58db1..68612a1d5d4 100644--- a/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx+++ b/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx@@ -41,7 +41,7 @@ vi.mock('@/i18n', () => ({switchToConnection: (name: string) => `Switch to ${name}`,connectGateway: 'Connect another Hermes gateway…'},- settings: { connections: { title: 'Connections' } }+ settings: { connections: { title: 'Registered gateways' } }}})}))@@ -113,7 +113,7 @@ describe('ConnectionSwitcher', () => {$connectionsRegistry.set(registry([connection('local', 'This device', 'local')]))render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.queryByRole('group', { name: 'Connections' })).toBeNull()+ expect(screen.queryByRole('group', { name: 'Registered gateways' })).toBeNull()})it('shows a named source selector instead of profile-like gateway glyphs', () => {@@ -126,7 +126,7 @@ describe('ConnectionSwitcher', () => {)render(<ConnectionSwitcher onConnect={onConnect} />)- const trigger = screen.getByRole('button', { name: 'Connections: This device' })+ const trigger = screen.getByRole('button', { name: 'Registered gateways: This device' })expect(trigger.textContent).toContain('This device')expect(trigger.getAttribute('data-variant')).toBe('ghost')@@ -148,8 +148,10 @@ describe('ConnectionSwitcher', () => {$pendingConnectionId.set('homelab')render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.getByRole('group', { name: 'Connections' }).getAttribute('aria-busy')).toBe('true')- expect(screen.getByRole('button', { name: 'Connections: This device' }).querySelector('.animate-spin')).toBeTruthy()+ expect(screen.getByRole('group', { name: 'Registered gateways' }).getAttribute('aria-busy')).toBe('true')+ expect(+ screen.getByRole('button', { name: 'Registered gateways: This device' }).querySelector('.animate-spin')+ ).toBeTruthy()})it.each([2, 20])('uses the same stable source selector for %i registered backends', count => {@@ -161,7 +163,7 @@ describe('ConnectionSwitcher', () => {)render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.getByRole('button', { name: 'Connections: This device' })).toBeTruthy()+ expect(screen.getByRole('button', { name: 'Registered gateways: This device' })).toBeTruthy()})it('announces a pending switch in the compact source menu', () => {@@ -174,6 +176,6 @@ describe('ConnectionSwitcher', () => {$pendingConnectionId.set('remote-3')render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.getByRole('group', { name: 'Connections' }).getAttribute('aria-busy')).toBe('true')+ expect(screen.getByRole('group', { name: 'Registered gateways' }).getAttribute('aria-busy')).toBe('true')})})diff --git a/apps/desktop/src/app/settings/connections-registry.tsx b/apps/desktop/src/app/settings/connections-registry.tsxindex c7ec2fbb155..55dbe367c80 100644--- a/apps/desktop/src/app/settings/connections-registry.tsx+++ b/apps/desktop/src/app/settings/connections-registry.tsx@@ -221,6 +221,7 @@ export function ConnectionsRegistrySection() {const bridge = window.hermesDesktop?.connectionsconst hasLocal = Boolean(registry?.connections.some(c => c.kind === 'local'))+const publishRegistry = useCallback((next: DesktopConnectionsRegistry) => {setRegistry(next)setConnectionsRegistry(next)diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex bda4860f2ca..2aacee09300 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -699,21 +699,21 @@ export const en: Translations = {set: 'Set',clear: 'Clear'},- // v2 multi-connection registry: Settings → Connections.+ // v2 multi-connection registry: Settings → Gateways.connections: {- title: 'Connections',- intro:- 'Manage this device, remote gateways, SSH hosts, and Hermes Cloud sources.',+ title: 'Registered gateways',+ intro: 'Manage this device and every Hermes gateway it can reach through remote, SSH, or Cloud connections.',stagedNote:- 'Switch sources from Sessions. Profiles, chats, messaging, and cron jobs stay with their source; work on other sources keeps running.',+ 'Switch gateways from Sessions. Profiles, chats, messaging, and cron jobs stay with their gateway; work on other gateways keeps running.',launchModeTitle: 'Open on launch',- launchModeDesc: 'Choose whether Hermes opens your primary source or the last source that connected successfully.',- launchPrimary: 'Primary source',+ launchModeDesc:+ 'Choose whether Hermes opens your primary gateway or the last gateway that connected successfully.',+ launchPrimary: 'Primary gateway',launchLastUsed: 'Last used',loadFailed: 'Could not load connections',currentPill: 'Current',primaryPill: 'Primary',- managedPill: 'This device',+ managedPill: 'App-managed',addConnection: 'Add connection',editConnection: 'Edit',removeConnection: 'Remove',diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex d5e7831c0ff..3b4650d4db6 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -904,20 +904,20 @@ export const zh: Translations = {set: '设置',clear: '清除'},- // v2 多连接注册表:设置 → 连接。+ // v2 多连接注册表:设置 → 网关。connections: {- title: '连接',- intro: '注册你的智能体所在的每个位置——本机、局域网中的远程网关、Hermes Cloud 实例——全部保存在这里。',+ title: '已注册网关',+ intro: '管理本机以及通过远程、SSH 或 Hermes Cloud 连接可访问的每个 Hermes 网关。',stagedNote:- '可在“会话”侧边栏切换来源。配置档案、聊天、消息和定时任务始终限定在所选来源;“主连接”是注册表的默认值,不会切换当前工作区。',+ '可在“会话”侧边栏切换网关。配置档案、聊天、消息和定时任务归属于各自网关;其他网关上的工作会继续运行。',launchModeTitle: '启动时打开',- launchModeDesc: '始终打开主连接,或恢复上次成功连接的来源。',- launchPrimary: '主连接',+ launchModeDesc: '选择 Hermes 启动时打开主网关,或上次成功连接的网关。',+ launchPrimary: '主网关',launchLastUsed: '上次使用',loadFailed: '无法加载连接',currentPill: '当前',primaryPill: '主连接',- managedPill: '本机',+ managedPill: '应用管理',addConnection: '添加连接',editConnection: '编辑',removeConnection: '移除',diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex 813df331883..a381a4b568b 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -295,22 +295,22 @@ Everything connection-related lives on one settings page: **Settings → Gateway- **Remote gateway** — enter the URL of a `hermes serve` backend you run yourself and sign in. This is the mode the rest of this section walks through.- **Hermes Cloud** — sign in once to Hermes Cloud and pick from the agents on your account; no URL to paste. The app discovers your agents (with an organization picker if your account spans several orgs), and connecting to one switches the session over automatically. The status bar shows the cloud connection while it's active.-Gateway connections are **machine-level**: the Gateways page manages which gateway backends this desktop can connect to, and profiles are discovered *from* the gateways you connect. Per-profile backend routing continues to work — it lives in the profile rail's connect flow and the session source switcher, not in the settings page.+Gateway connections are **machine-level**: the Gateways page manages which gateway backends this desktop can connect to, and profiles are discovered *from* the gateways you connect. Sessions select one gateway at a time, while the adjacent profile rail selects a profile discovered on that gateway.### The multi-connection registry-Further down the same **Settings → Gateways** page, the connections registry manages a named list of every agent source the app knows about — the local runtime, any number of remote gateways (LAN, Tailscale, internet), Hermes Cloud instances, and SSH hosts — all persisted together in one place. You can jump there from the plug button at the right end of the sidebar profile rail (**Connect another Hermes gateway…**) or via **⌘K → Gateways**. The full guide, including the union agent roster, `@name-device` handles, fleet-wide updates, and the plugin SDK surface, is at [Connecting Desktop to Many Hermes Instances](./multi-connection-desktop.md).+Further down the same **Settings → Gateways** page, **Registered gateways** manages a named list of every Hermes gateway the app knows about — the local runtime, any number of remote gateways (LAN, Tailscale, internet), Hermes Cloud instances, and SSH hosts — all persisted together in one place. You can jump there from the plug button at the right end of the sidebar profile rail (**Connect another Hermes gateway…**) or via **⌘K → Gateways**. The full guide, including the union agent roster, `@name-device` handles, fleet-wide updates, and the plugin SDK surface, is at [Connecting Desktop to Many Hermes Instances](./multi-connection-desktop.md).-- **Every connection needs a unique name** (a device name such as "Homelab" or "Work laptop"). When the same profile name exists on several registered sources, surfaces disambiguate it as `@profile-device` (e.g. `@research-homelab`).-- **Switch sources from the Sessions sidebar.** A named source selector appears when more than one source is registered and handles any registry size without making gateways look like profiles. The adjacent profile rail then shows only that source's agents and remembers the last profile used there; large profile sets condense independently.-- **Choose what opens after a restart.** **Open on launch** keeps the backward-compatible **Primary source** default, or can resume the **Last used** source after it connects successfully. This preference is stored outside the application bundle and survives Desktop updates.+- **Every connection needs a unique name** (a device name such as "Homelab" or "Work laptop"). When the same profile name exists on several registered gateways, surfaces disambiguate it as `@profile-device` (e.g. `@research-homelab`).+- **Switch gateways from the Sessions sidebar.** A named gateway selector appears when more than one gateway is registered and handles any registry size without making gateways look like profiles. The adjacent profile rail then shows only that gateway's agents and remembers the last profile used there; large profile sets condense independently.+- **Choose what opens after a restart.** **Open on launch** keeps the backward-compatible **Primary gateway** default, or can resume the **Last used** gateway after it connects successfully. This preference is stored outside the application bundle and survives Desktop updates.- **Add / edit / remove / test** connections from the panel. The **Add** flow offers all four kinds — **Local**, **Hermes Cloud**, **Remote gateway**, and **SSH** (the Local button is disabled while the app-managed local entry exists, and a hint points cloud adds at the sign-in/discovery flow above). The local entry is managed by the app and cannot be removed. **Test** probes the connection's own HTTP and WebSocket legs directly.- **Duplicates are rejected at save time**: only one **local** entry ever; remote and cloud entries are deduplicated on the normalized URL (trimmed, trailing slashes stripped, lowercased — across both kinds); SSH entries on the normalized `user@host:port` plus remote profile.- Existing settings are **imported automatically** the first time you run a build with the registry: your current global connection and any legacy per-profile overrides become named entries. The legacy settings file is left untouched, so older builds keep working.- Cloud entries come from the Hermes Cloud sign-in/discovery flow above, not from a hand-typed URL.- Tokens are stored encrypted with the OS keyring (with an explicit plain-text opt-in on keyring-less Linux).-Side-by-side routing is live: each registered source dials its own backends and sockets on demand (keyed per connection + profile), the plugin SDK exposes the union agent roster (`host.agents()` / `host.ensureAgent()`), and **Update all instances** on the Gateways page dispatches `hermes update` to every eligible source at once — Hermes Cloud entries are skipped (the platform updates them), and each instance reports its own result.+Side-by-side routing is live: each registered gateway dials its own backends and sockets on demand (keyed per connection + profile), the plugin SDK exposes the union agent roster (`host.agents()` / `host.ensureAgent()`), and **Update all instances** on the Gateways page dispatches `hermes update` to every eligible gateway at once — Hermes Cloud entries are skipped (the platform updates them), and each instance reports its own result.:::info The remote backend is a running `hermes serve` processdiff --git a/website/docs/user-guide/multi-connection-desktop.md b/website/docs/user-guide/multi-connection-desktop.mdindex 444a0217799..37ac24a074c 100644--- a/website/docs/user-guide/multi-connection-desktop.md+++ b/website/docs/user-guide/multi-connection-desktop.md@@ -7,8 +7,8 @@ sidebar_position: 5Register every Hermes backend you own — the local runtime, remote gateways onyour LAN or VPS, SSH hosts, and Hermes Cloud instances — in one desktop app,and use the agents on all of them side by side. Connections are persistent:-each registered source dials its own backends and WebSockets on demand, and-background agents keep streaming while you look at another source.+each registered gateway dials its own backends and WebSockets on demand, and+background agents keep streaming while you look at another gateway.This is the desktop-side complement to[Running Many Gateways at Once](./multi-profile-gateways.md): that page is@@ -31,13 +31,12 @@ redirect there). Three doors lead to it:- **The command palette** — **Cmd/Ctrl+K**, then type *Gateways* (alsomatches *connections*, *add gateway*, *remote*, *ssh*, *instances*).-## The connection registry+## The gateway registry-The registry section of **Settings → Gateways** manages a named list of agent-sources. The-pane's intro says it plainly: *"Register every place your agents live — this-device, remote gateways on your network, and Hermes Cloud instances. All of-them are stored here."* Each entry is a *connection*:+The **Registered gateways** section of **Settings → Gateways** manages a named+list of Hermes gateways. Its intro says it plainly: *"Manage this device and+every Hermes gateway it can reach through remote, SSH, or Cloud connections."*+Each entry is a *connection*:| Kind | What it is | Auth ||---|---|---|@@ -52,18 +51,18 @@ Rules worth knowing:The name shows up everywhere the instance appears — roster badges, handles,update results. Uniqueness is case-insensitive, so `Homelab` and `homelab`cannot coexist.-- The **local** entry is managed by the app (it wears a **This device** pill)+- The **local** entry is managed by the app (it wears an **App-managed** pill)and cannot be removed. Removing any other connection tears down its livebackends and tunnels; the instance itself is untouched.- One connection is always the **Primary** (pill on its row): it is the- registry fallback for multi-source calls that do not name a source.+ registry fallback for multi-gateway calls that do not name a gateway.**Make primary** does not switch the current Sessions workspace; removingthe primary falls back to the local entry.-- **Open on launch** controls which source Sessions opens after a full app- restart. **Primary source** preserves the established Desktop behavior and+- **Open on launch** controls which gateway Sessions opens after a full app+ restart. **Primary gateway** preserves the established Desktop behavior andremains the default for existing and new installs. Choose **Last used** to- resume the most recent source that connected successfully. A failed switch- is never remembered, and a removed or unavailable saved source falls back+ resume the most recent gateway that connected successfully. A failed switch+ is never remembered, and a removed or unavailable saved gateway falls backto Primary.- **Test** probes the connection's own HTTP *and* WebSocket legs, so a pass(the *"Reachable"* toast) means chat will actually work — not just that the@@ -78,8 +77,8 @@ Rules worth knowing:the top of the Gateways page — the **Hermes Cloud** kind in the add-connectioneditor points you there.-Switch sources from the **Sessions** sidebar. Profiles, chats, messaging, and-cron stay scoped to that source; the app-managed window backend is still chosen+Switch gateways from the **Sessions** sidebar. Profiles, chats, messaging, and+cron stay scoped to that gateway; the app-managed window backend is still chosenby the connection-mode controls above. **Primary** is the registry fallback anddoes not switch the current workspace.@@ -137,59 +136,59 @@ The legacy settings file is left untouched, so older builds on the samemachine keep working. If a migrated name collided, it was suffixed(`Homelab 2`).-## Agents across sources+## Agents across gatewaysEvery [profile](./profiles.md) on every registered connection is an *agent*.-The union roster is what multi-source surfaces (and the built-in+The union roster is what multi-gateway surfaces (and the built-in[Bot Mode](./bot-mode.md) roster) render:-- When the same profile name exists on several sources, handles disambiguate+- When the same profile name exists on several gateways, handles disambiguateas **`@name-device`** — `research` on your Homelab renders as- `@research-homelab`, while a profile unique across all sources keeps its+ `@research-homelab`, while a profile unique across all gateways keeps itsbare name.- Enumeration is eager but sockets are lazy: the app lists agents over REST- without dialing every source's WebSocket. An unreachable source reports- per-row instead of breaking the roster; SSH sources stay connect-on-demand+ without dialing every gateway's WebSocket. An unreachable gateway reports+ per-row instead of breaking the roster; SSH connections stay connect-on-demanduntil you first open an agent on them (no surprise tunnels).-- Opening an agent dials **its own source** — chats, sessions, and memory+- Opening an agent dials **its own gateway** — chats, sessions, and memorylive on the machine that owns the profile, exactly as if you were usingthat instance directly.Each `(connection, profile)` pair gets its own backend and socket, pooledwith the same idle-reaping as local per-profile backends — background agents-keep streaming while you look at another source.+keep streaming while you look at another gateway.### Switching and scoping-The sidebar foot follows one hierarchy: **source → profile → sessions**.-Sources are machines or hosted backends; profiles are isolated Hermes agents-that live on one source.+The sidebar foot follows one hierarchy: **gateway → profile → sessions**.+Gateways are machines or hosted backends; profiles are isolated Hermes agents+that live on one gateway.-- With one registered source, no source control is added. Local-only Desktop+- With one registered gateway, no gateway control is added. Local-only Desktopkeeps the same profile rail and keyboard flow as before.-- With several sources, the sidebar shows one named source selector. Its device,+- With several gateways, the sidebar shows one named gateway selector. Its device,cloud, network, or terminal icon identifies the connection type; profileavatars remain a separate control after the divider. The same selector scales- from two sources to a larger fleet without turning backends into profile-like+ from two gateways to a larger fleet without turning backends into profile-likeglyphs or crowding profile actions out of the rail.-- Selecting a source restores the last profile used there. The profile rail- then shows only that source's profiles; the home pill returns to its default- profile and the layers pill shows **All profiles on this source**.- **Cmd/Ctrl+1–9** continue to switch profiles within the active source.-- The selected source survives a quit and relaunch only when **Settings →- Connections → Open on launch** is set to **Last used**. The preference and- source id live in the app's user-data registry, so replacing or updating the+- Selecting a gateway restores the last profile used there. The profile rail+ then shows only that gateway's profiles; the home pill returns to its default+ profile and the layers pill shows **All profiles on this gateway**.+ **Cmd/Ctrl+1–9** continue to switch profiles within the active gateway.+- The selected gateway survives a quit and relaunch only when **Settings →+ Gateways → Open on launch** is set to **Last used**. The preference and+ gateway id live in the app's user-data registry, so replacing or updating theapplication bundle does not reset them.-- With more than thirteen profiles on the active source, their avatar strip- condenses into a named profile selector. Large source and profile sets can- therefore coexist without changing the **source → profile → sessions** model.-- **This device** remains a first-class source even when a remote connection is+- With more than thirteen profiles on the active gateway, their avatar strip+ condenses into a named profile selector. Large gateway and profile sets can+ therefore coexist without changing the **gateway → profile → sessions** model.+- **This device** remains a first-class gateway even when a remote connection isPrimary. It can keep local sessions available during a remote outage, but theapp does not call it "offline mode": the selected model or tools may stillrequire internet access.- The session list, messaging channels, cron jobs, settings, files, and memory- are all scoped to the active `(source, profile)`. Switching from a Telegram- source to a Signal source cannot leave the previous source's channel groups+ are all scoped to the active `(gateway, profile)`. Switching from a Telegram+ gateway to a Signal gateway cannot leave the previous gateway's channel groupsor sessions in the sidebar.- Merely displaying the switcher reads Electron's local connection registry.Remote gateways are opened only when selected; there is no periodic fleet@@ -205,22 +204,22 @@ that live on one source.on the gateway the window is connected to; edits on other machines apply ontheir next session.-Add, test, rename, or remove sources in **Settings → Connections**. The plug+Add, test, rename, or remove gateways in **Settings → Gateways**. The plugbutton beside the profile actions is a shortcut to that single managementhome, not a second add flow.### Sessions and Bot Mode-Sessions intentionally show one active source at a time: this keeps files,+Sessions intentionally show one active gateway at a time: this keeps files,tools, channels, cron, and session history in one understandable executioncontext. Bot Mode serves a different job and may present the union roster,-grouped by source, so a user can open one agent on a NAS and another on a VPS-from one surface. Opening a bot still activates its exact `(source, profile)`+grouped by gateway, so a user can open one agent on a NAS and another on a VPS+from one surface. Opening a bot still activates its exact `(gateway, profile)`route.-Direct bot mentions and delegation remain source-local by default. Crossing a+Direct bot mentions and delegation remain gateway-local by default. Crossing abackend boundary changes filesystem, credentials, tools, and trust context, so-cross-source execution should be an explicit bridge rather than an accidental+cross-gateway execution should be an explicit bridge rather than an accidentalside effect of sharing one Desktop window.## Updating every instance at once@@ -261,11 +260,11 @@ with their own message, per row.## For plugin authorsThe Desktop [plugin SDK](../developer-guide/desktop-plugin-sdk.md) exposes the-multi-source surface directly:+multi-gateway surface directly:- `host.connections()` — the registered connection list (labels, kinds,primary; never token bytes).-- `host.agents()` — the union roster: one row per `(source, profile)` with+- `host.agents()` — the union roster: one row per `(gateway, profile)` withthe precomputed `@name-device` handle.- `host.ensureAgent(connectionId, profile)` — activate an agent's gateway sosubsequent `host.request` calls hit its backend.@@ -273,8 +272,8 @@ multi-source surface directly:(hover-intent).All four are feature-detected: on an older Desktop build they're absent and a-plugin should fall back to the single-source `profiles.list` flow. Bot Mode's-multi-source roster is the reference consumer.+plugin should fall back to the single-gateway `profiles.list` flow. Bot Mode's+multi-gateway roster is the reference consumer.## Troubleshooting@@ -285,8 +284,8 @@ multi-source roster is the reference consumer.- **An agent shows but won't open** — run **Test** on its connection. TheWebSocket leg failing while HTTP passes usually means a proxy, firewall, orgateway auth/origin guard is blocking `/api/ws`.-- **A remote source is missing from the roster** — its backend is down or- unreachable; the roster lists it under sources with the error. SSH sources+- **A remote gateway is missing from the roster** — its backend is down or+ unreachable; the roster lists it under gateways with the error. SSH connectionsshow *connect-on-demand* until first use — that's by design, not a failure.- **"Update Hermes Desktop to chat with agents on other connections"** — theapp predates the multi-connection stack; update the desktop app itself.