The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs: describe the gateway attach model, not the removed Desktop pool
Teknium6cd311eb5e66
diff --git a/website/docs/developer-guide/desktop-plugin-sdk.md b/website/docs/developer-guide/desktop-plugin-sdk.mdindex cb2b6e2f070..62a263a6d16 100644--- a/website/docs/developer-guide/desktop-plugin-sdk.md+++ b/website/docs/developer-guide/desktop-plugin-sdk.md@@ -1134,12 +1134,13 @@ profile without changing the active chat or gateway. The profile-only overload iretained only for the sole-local/legacy topology; registry-aware plugins should passthe descriptor so two sources exposing the same profile name cannot collide.-A call that may cold-start a pooled profile backend dials at background priority by-default, and background dials never get the slot the pool keeps free for user actions.-When the call IS a user action (a save, a button press, a dialog opening), pass-`host.requestProfile(route, method, params, undefined, { spawnPriority: 'foreground' })`;-otherwise, with the pool full of warm backends, it waits out the 30-second slot timeout-and fails. Keep the background default for polling and roster warming.+A call that has to open a connection to another profile dials at background priority+by default. After a failed dial to that profile, background calls fail fast while the+reconnect backoff runs (*Backend for "<profile>" is reconnecting; retry after it+settles.*) instead of redialing on every tick. When the call IS a user action (a save,+a button press, a dialog opening), pass+`host.requestProfile(route, method, params, undefined, { spawnPriority: 'foreground' })`+so it dials at once. Keep the background default for polling and roster warming.`host.openWorkspace(id, { render, title?, minWidth?, onClose? })` docks aplugin-rendered view into the **main workspace zone** — the same center area@@ -1658,10 +1659,10 @@ your handler). Where it lands depends on the process the call runs in:| Caller runs in | Reaches ||---|---|-| `hermes serve` (the Desktop backend): `plugin_api.py` routers, plugin slash commands, tools and hooks in the agent turn | every connected Desktop window |-| the `dashboard.turn_isolation` compute-host child (tools/hooks of an isolated turn) | relayed over the host pipe to `hermes serve`, then every window |+| the process Desktop is connected to — the host gateway a local Desktop attaches to, or a remote `hermes serve`: `plugin_api.py` routers, plugin slash commands, tools and hooks in the agent turn | every Desktop window connected to that process |+| the `dashboard.turn_isolation` compute-host child (tools/hooks of an isolated turn) | relayed over the host pipe to its parent process, then every connected window || the stdio TUI (`hermes` in a terminal) | that terminal's client |-| `hermes gateway run` (messaging platforms), `hermes chat`, cron, `hermes plugins validate` | nobody — no Desktop client is attached to that process; the call is a logged no-op |+| `hermes chat`, cron, `hermes plugins validate`, or a gateway with no Desktop window connected | nobody — no Desktop client is attached to that process; the call is a logged no-op |Use this instead of importing `tui_gateway.server` internals; for plugin-scoped frameswith a payload tailored per connection, `ctx.socket('/events')` remains thediff --git a/website/docs/developer-guide/model-provider-plugin.md b/website/docs/developer-guide/model-provider-plugin.mdindex e620d7e98a5..df1fbda3fd6 100644--- a/website/docs/developer-guide/model-provider-plugin.md+++ b/website/docs/developer-guide/model-provider-plugin.md@@ -21,7 +21,7 @@ Model provider plugins are the third kind of **provider plugin**. The others are3. **Installed plugins** — `$HERMES_HOME/plugins/<name>/` (where `hermes plugins install owner/repo` clones) — imported only when `plugin.yaml` declares `kind: model-provider`; every other kind there belongs to the general PluginManager4. **Legacy single-file** — `<repo>/providers/<name>.py` — back-compat for out-of-tree editable installs-Steps 2 and 3 are **per profile home**: one process that serves several profiles (the multiplex gateway, the Desktop app's `hermes serve`) resolves the plugins of whichever profile's `$HERMES_HOME` is bound at lookup time, and a plugin installed in one profile is not visible from another. Install the plugin in every profile that should use it (`hermes -p <profile> plugins install ...`).+Steps 2 and 3 are **per profile home**: one process that serves several profiles (the multiplex gateway a local Desktop attaches to, a `hermes serve` backend) resolves the plugins of whichever profile's `$HERMES_HOME` is bound at lookup time, and a plugin installed in one profile is not visible from another. Install the plugin in every profile that should use it (`hermes -p <profile> plugins install ...`).**User plugins override bundled plugins of the same name** because `register_provider()` is last-writer-wins. Drop a `$HERMES_HOME/plugins/model-providers/gmi/` directory to replace the built-in GMI profile without touching the repo.diff --git a/website/docs/developer-guide/multiplexing-gateway.md b/website/docs/developer-guide/multiplexing-gateway.mdindex efea24c3a59..73abddcc321 100644--- a/website/docs/developer-guide/multiplexing-gateway.md+++ b/website/docs/developer-guide/multiplexing-gateway.md@@ -54,7 +54,7 @@ is documented as a known limitation at the end of this document.a plain module global, not a contextvar: it describes the deployment mode,not a per-task value. Its only job is to arm the fail-closed behavior in`get_secret()`.-- The dashboard/Desktop backend (`hermes serve`) has no such flag, so+- The dashboard / remote-Desktop backend (`hermes serve`) has no such flag, so`hermes_cli/web_server.py::start_server` calls`tui_gateway.launch_profile_policy.activate_multi_profile_hosting_eagerly()`as its LAST boot step: the host arms the guard when the machine has more thandiff --git a/website/docs/developer-guide/session-storage.md b/website/docs/developer-guide/session-storage.mdindex f91a5883f7d..398cf191e90 100644--- a/website/docs/developer-guide/session-storage.md+++ b/website/docs/developer-guide/session-storage.md@@ -56,7 +56,7 @@ pytest run.### Desktop profile isolation and compaction generationsEach named profile stores its transcript in its own `$HERMES_HOME/state.db`,-including when one `hermes serve` process serves several profiles. In-session+including when one process (the multiplex gateway, or a `hermes serve`) serves several profiles. In-sessionagent rebuilds (Bot Chat capability refresh and `tools.configure`) must retainthat session's database handle and bind its profile home during construction.Releasing the outgoing agent must not close the handle inherited by its replacement.diff --git a/website/docs/getting-started/nix-setup.md b/website/docs/getting-started/nix-setup.mdindex d4dd84e6f97..b0ab8f77717 100644--- a/website/docs/getting-started/nix-setup.md+++ b/website/docs/getting-started/nix-setup.md@@ -677,7 +677,7 @@ macOS has no equivalent option. A `launchd` agent with `RunAtLoad` starts at log### Running the Desktop / Dashboard Backend-`gateway.enable` runs the messaging gateway for Telegram, Discord, Slack and the other platforms. Hermes Desktop and the web dashboard connect to a *different* process, which is `hermes serve` or `hermes dashboard`. `backend.mode` runs that process with the gateway:+`gateway.enable` runs the messaging gateway for Telegram, Discord, Slack and the other platforms. A Hermes Desktop **remote** connection and the web dashboard connect to a *different* process, which is `hermes serve` or `hermes dashboard`. (A Desktop running on the same host attaches to the gateway itself via `hermes gateway ensure`.) `backend.mode` runs that process with the gateway:```nix{@@ -1035,7 +1035,7 @@ nix build .#checks.x86_64-linux.config-roundtrip # merge script preserves use### Backend (`hermes serve` / `hermes dashboard`)-This option runs the process that Hermes Desktop and the web dashboard connect to, with the gateway. You cannot use it with `container.enable`.+This option runs the process that a remote Hermes Desktop connection and the web dashboard connect to, with the gateway. You cannot use it with `container.enable`.| Option | Type | Default | Description ||---|---|---|---|diff --git a/website/docs/reference/environment-variables.md b/website/docs/reference/environment-variables.mdindex 1765b98991a..b458fe1e359 100644--- a/website/docs/reference/environment-variables.md+++ b/website/docs/reference/environment-variables.md@@ -830,7 +830,7 @@ Advanced per-platform knobs for throttling the outbound message batcher. Most us| `HERMES_QUIET` | Suppress non-essential output (`true`/`false`) || `CODEX_HOME` | When [Codex app-server runtime](../user-guide/features/codex-app-server-runtime) is enabled, override the directory Codex CLI reads its config + auth from (default: `~/.codex`). Hermes' migration writes the managed block to `<CODEX_HOME>/config.toml`. || `HERMES_KANBAN_TASK` | Set by the kanban dispatcher when spawning a worker (task UUID). Workers and the spawned `hermes-tools` MCP subprocess inherit it so kanban tools gate correctly. Don't set manually. |-| `HERMES_ACP_SKIP_CONFIGURED_MCP` | Set by an [ACP host](../user-guide/features/acp#host-integration) on the Hermes subprocess it spawns. `1` skips starting the globally configured `config.yaml` MCP servers before the ACP JSON-RPC loop, for hosts that pass the session's MCP servers through `session/new` themselves. Servers supplied by the ACP session are still registered; any other value keeps the default. Don't set manually. |+| `HERMES_ACP_SKIP_CONFIGURED_MCP` | Obsolete. No longer read, and has no effect. `hermes acp` is a viewer of the gateway daemon and never starts `config.yaml` MCP servers itself. The gateway starts its profile's `mcp_servers` at boot (filtered for ACP by `platform_toolsets.acp`), and the editor's `session/new` `mcpServers` are attached by the gateway either way. See [ACP host integration](../user-guide/features/acp#host-integration). || `HERMES_API_TIMEOUT` | LLM API call timeout in seconds (default: `1800`) || `HERMES_API_CALL_STALE_TIMEOUT` | Non-streaming stale-call timeout in seconds (default: `90`). Auto-disabled for local providers when left unset, and may scale upward for very large contexts. Also configurable via `providers.<id>.stale_timeout_seconds` or `providers.<id>.models.<model>.stale_timeout_seconds` in `config.yaml`. || `HERMES_STREAM_READ_TIMEOUT` | Streaming socket read timeout in seconds (default: `120`). Auto-increased to `HERMES_API_TIMEOUT` for local providers. Increase if local LLMs time out during long code generation. |diff --git a/website/docs/user-guide/bot-mode.md b/website/docs/user-guide/bot-mode.mdindex 4e9f9b60123..0cc50a5c60f 100644--- a/website/docs/user-guide/bot-mode.md+++ b/website/docs/user-guide/bot-mode.md@@ -132,8 +132,7 @@ Unresolved member failures remain visible in the collapsed Activity summary aftethe room settles — including a turn the member's backend itself failed (badcredentials, provider errors), which is reported the moment the gatewayreports it instead of looking like twenty minutes of thinking. A failure row names its cause: `builder hit an error — <first line of-the error>` (secret-shaped tokens redacted, long lines truncated), or `builder couldn't start — too many bots running` when the local-backend pool had no free slot. Expand Activity for the turn sequence; re-address the member to+the error>` (secret-shaped tokens redacted, long lines truncated). Expand Activity for the turn sequence; re-address the member totry again. An ambiguous submit failure is not automatically resubmitted.@@ -168,7 +167,7 @@ Use the **Move up** and **Move down** arrows beside a room to choose its positio- Hard caps (10 messages per send, 3 rounds) keep rooms from spinning.- Each member keeps its own persistent room session, so room context survives like any other conversation.- **Not every Bot replies to every message.** Speaking is each member's own choice — a Bot replies only when it has something new to add and passes otherwise, and @-mentioning specific members scopes the round to them. Expect the members you addressed (or whoever has something to say) to speak, and the rest to stay quiet.-- **Rooms keep running when you close the Desktop.** When every member of a room lives on the same gateway, that gateway owns turn scheduling through a durable driver: closing Hermes Desktop (or losing its connection) does not stop a room mid-discussion, and the Desktop simply catches up from the room's log when it reconnects. `groups.capabilities` on the gateway reports `driver: true` when this applies. More than one room worker may share a home — the messaging gateway (`hermes gateway run`) and the Desktop's own backend (`hermes serve`) both run one — and whichever holds the room's driver lease runs the next turn; a member's room session is held only for the duration of its turn, so the lease can move between workers without a turn being refused. Room state lives in the install's root `shared-state.db`; installs that created rooms before that file existed (when rooms were still kept in the root `state.db`) get those rooms copied across once, on the first open after updating, so pre-existing Group Chats stay reachable. Rooms whose members span several machines are different: each member's turns run on its own gateway, and the cross-connection courier described under *Bot-to-bot messaging* still applies to them.+- **Rooms keep running when you close the Desktop.** When every member of a room lives on the same gateway, that gateway owns turn scheduling through a durable driver: closing Hermes Desktop (or losing its connection) does not stop a room mid-discussion, and the Desktop simply catches up from the room's log when it reconnects. `groups.capabilities` on the gateway reports `driver: true` when this applies. More than one room worker may share a home — the host gateway that Desktop attaches to (`hermes gateway run`) and a `hermes serve` / `hermes dashboard` backend both run one — and whichever holds the room's driver lease runs the next turn; a member's room session is held only for the duration of its turn, so the lease can move between workers without a turn being refused. Room state lives in the install's root `shared-state.db`; installs that created rooms before that file existed (when rooms were still kept in the root `state.db`) get those rooms copied across once, on the first open after updating, so pre-existing Group Chats stay reachable. Rooms whose members span several machines are different: each member's turns run on its own gateway, and the cross-connection courier described under *Bot-to-bot messaging* still applies to them.- **Mentions read as identities.** In the transcript a routed `@bot` mention, the human handoff `@user`, and the broadcasts `@everyone` / `@all` render as inline references (accent text, not pills); unknown `@words` and e-mail addresses stay plain. Hover a Bot's message and use **Reply to @handle** to seed `@handle ` into the composer, so your next send goes to that Bot only (when a same-named Bot from a Connection shares the room, the tag is device-qualified, e.g. `@reviewer-mini` / `@reviewer-local`) — **Reply in thread** still continues the whole thread. If a reply box for a *different* thread is open, **Reply to** seeds the main composer instead and so starts a fresh thread; use **Reply in thread** to continue that thread.- **Rooms can span machines.** **New Group Chat** is available as soon as two Bots are selectable across all your registered connections — one Bot on this device plus one on another gateway is enough. The picker seats Bots from any registered connection; each member's turns run on its own machine, in its own room session there. Cross-machine members carry a device badge (`dixie · Mac Mini`) in the room and in other members' transcripts, and the disambiguated `@name-device` handle works in room mentions — so same-named agents on two machines never blur together. A member's turn that outlives this Desktop — you quit or it crashed mid-turn — finishes on the member's own machine: the room posts that reply the next time it is driven, and does not re-drive the member while it is still working.@@ -368,11 +367,13 @@ Clicking a Connections Bot does **not** hop your window onto that machine — stSee [Connecting Desktop to Many Hermes Instances](./multi-connection-desktop.md) for the full multi-connection guide.-## Warm Bot Backends (how many bots run at once)+## Local Bots and the gateway (how many bots run at once)-Each local Bot runs in its own backend process, and Desktop keeps at most **Settings → Advanced → Warm Bot Backends** of them alive at once (default 3, ~60 MB each). Idle backends are reaped after the idle timeout next to that setting (default 10 minutes); the `Hermes backend for profile "<name>" exited (1)` line in `desktop.log` that follows an idle-reap message is that cleanup, not a crash. A Bot you open while every slot is busy waits up to 30 seconds for a slot, then fails with *timed out waiting for a free local slot*.+Desktop does not run a backend per Bot. One gateway process per host owns every local profile's sessions: when you open a local Bot, Desktop runs `hermes gateway ensure --json` for that profile, which attaches to the running gateway or starts it if nothing serves the profile yet, and then dials it over WebSocket (`/api/ws`) with a one-use ticket. There is no Desktop-side backend pool, no limit setting for how many Bots can be warm, and no idle reaper — opening another Bot never waits for a slot, and reading another Bot's history costs only a request to the same gateway.-Reads of another Bot's chat history and background transcript refreshes do **not** take a slot — only an interactive open or a running turn does. If you drive a large fleet (group chats with many members, or Kanban dispatch across many profiles), raise Warm Bot Backends toward the number of Bots you expect to be active at the same time and give the machine the memory to match. Setting it higher than the profiles you actually use only adds startup work.+The gateway's lifetime is independent of Desktop windows. Closing a window or quitting Desktop only forgets the connection; it never stops the gateway, so your messaging bots, routines, and in-flight turns keep running, and Desktop re-attaches on the next open. Stop it deliberately with `hermes gateway stop`. If the gateway restarts underneath Desktop (an update, a crash, `hermes gateway stop` followed by a later open), Desktop re-runs `gateway ensure` once and reconnects. A profile marked `gateway.standalone: true` keeps a gateway of its own; Desktop attaches to it the same way.++Remote gateways, SSH hosts, and Hermes Cloud instances in **Settings → Connections** are separate hosts with their own processes; their Bots run on that machine (see *Bots across machines* above), not on this host's gateway.## Turning it offdiff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex 3b2f08166f0..294c79f17c7 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -423,7 +423,7 @@ When you start Hermes from the application grid or menu (the launcher sets `DESK## How it works-The packaged app ships the Electron shell and a native React chat surface. On first launch it can install the Hermes Agent runtime into `HERMES_HOME` (`~/.hermes`, or `%LOCALAPPDATA%\hermes` on Windows) — **the same layout a CLI install uses**, which is why the two are interchangeable. Bundled apps use their included backend. Without a bundled backend, resolution honours `HERMES_DESKTOP_HERMES_ROOT`, then the development checkout, then an explicit `HERMES_DESKTOP_HERMES` command override for packagers such as Nix, and finally a usable managed install. The command override takes precedence over the managed install so a Nix desktop cannot silently launch an older mutable runtime. The React renderer talks to the profile's **gateway**: on first use of a local profile the app runs `hermes gateway ensure`, which attaches to that profile's running gateway or, when there is none, installs and starts a persistent per-profile gateway (a systemd/launchd service where one exists, otherwise a detached daemon) — the same process `hermes chat`, the TUI and messaging channels use. That gateway is not tied to the app's lifetime: it keeps running after you quit and has no idle shutdown; stop it with `hermes gateway stop` (or the gateway controls in Settings). The desktop app is **self-contained**: it needs no separate `hermes serve` process and never opens or requires the [web dashboard](./features/web-dashboard.md). Install, backend-resolution, and self-update logic live in the Electron main process.+The packaged app ships the Electron shell and a native React chat surface. On first launch it can install the Hermes Agent runtime into `HERMES_HOME` (`~/.hermes`, or `%LOCALAPPDATA%\hermes` on Windows) — **the same layout a CLI install uses**, which is why the two are interchangeable. Bundled apps use their included backend. Without a bundled backend, resolution honours `HERMES_DESKTOP_HERMES_ROOT`, then the development checkout, then an explicit `HERMES_DESKTOP_HERMES` command override for packagers such as Nix, and finally a usable managed install. The command override takes precedence over the managed install so a Nix desktop cannot silently launch an older mutable runtime. The React renderer talks to the profile's **gateway**: on first use of a local profile the app runs `hermes gateway ensure`, which attaches to the gateway that serves that profile or, when there is none, starts it (an already-installed systemd/launchd service where one exists, otherwise a detached daemon; `ensure` never installs a service). One gateway per host serves every profile unless a profile is marked `gateway.standalone: true`, and Desktop dials it over `/api/ws` with one-use tickets — the same process `hermes chat`, the TUI and messaging channels use. That gateway is not tied to the app's lifetime: it keeps running after you quit and has no idle shutdown; stop it with `hermes gateway stop` (or the gateway controls in Settings). The desktop app is **self-contained**: it needs no separate `hermes serve` process and never opens or requires the [web dashboard](./features/web-dashboard.md). Install, backend-resolution, and self-update logic live in the Electron main process.## Connecting to a remote backenddiff --git a/website/docs/user-guide/features/acp.md b/website/docs/user-guide/features/acp.mdindex ceaa34d5908..4c235539e83 100644--- a/website/docs/user-guide/features/acp.md+++ b/website/docs/user-guide/features/acp.md@@ -336,25 +336,25 @@ Provider resolution uses Hermes' normal runtime resolver, so ACP inherits the cu## Host integration-These variables are set by an **ACP host process** (an editor or another agent-harness) on the Hermes subprocess it spawns. They are not user configuration —-do not set them by hand in `.env` or `config.yaml`.+Older ACP hosts may still set this variable on the Hermes subprocess they+spawn. It is not user configuration — do not set it by hand in `.env` or+`config.yaml`.| Variable | Value | Effect ||----------|-------|--------|-| `HERMES_ACP_SKIP_CONFIGURED_MCP` | `1` | Skip starting the **globally configured** MCP servers from `config.yaml` before the ACP JSON-RPC loop begins. |--Hermes normally starts every MCP server configured in `config.yaml` before it-enters the ACP JSON-RPC loop. A host that owns MCP itself — passing the-session's servers explicitly through `session/new` — does not need that global-startup, and an unrelated slow or interactive MCP server would otherwise delay-`initialize`. Setting the marker to exactly `1` lets such a host skip it.--Only the global `config.yaml` discovery is skipped. **MCP servers supplied by-the ACP session through `session/new` are still registered**, so a host loses-no capability it asked for. Any other value (unset, empty, `0`, `false`) keeps-the default behavior, so an unrelated truthy-looking string cannot silently-disable MCP.+| `HERMES_ACP_SKIP_CONFIGURED_MCP` | `1` | **No effect.** Hermes no longer reads it. `hermes acp` / `hermes-acp` runs as a viewer of the gateway daemon and never starts the `config.yaml` MCP servers itself, so there is no ACP-side startup to skip. |++The ACP process does no MCP discovery. The gateway daemon starts the+`mcp_servers` from its own profile's `config.yaml` once at gateway boot, and ACP+sessions get those servers through the `platform_toolsets.acp` rules+[above](#what-hermes-exposes-in-acp-mode). Setting the variable on the ACP+subprocess or on the gateway does not change that. Use `platform_toolsets.acp`+or `no_mcp` to keep configured servers out of ACP sessions.++The editor's `session/new` `mcpServers` are passed to the gateway and attached+to that canonical session (see+[Editor-provided MCP servers](#editor-provided-mcp-servers)), whether or not+the variable is set.## Session behaviordiff --git a/website/docs/user-guide/features/curator.md b/website/docs/user-guide/features/curator.mdindex fcd16c1610f..48d2c21e58d 100644--- a/website/docs/user-guide/features/curator.md+++ b/website/docs/user-guide/features/curator.md@@ -16,12 +16,12 @@ Tracks [issue #7816](https://github.com/NousResearch/hermes-agent/issues/7816).## How it runs-The curator is triggered by an inactivity check, not a cron job. On CLI session start, during gateway housekeeping, and on the Desktop/`hermes serve` maintenance timer, Hermes checks whether:+The curator is triggered by an inactivity check, not a cron job. On CLI session start, during gateway housekeeping (which also covers a local Desktop, since it attaches to the gateway), and on the `hermes serve` maintenance timer, Hermes checks whether:1. Enough time has passed since the last curator run (`interval_hours`, default **7 days**), and2. The agent has been idle long enough (`min_idle_hours`, default **2 hours**).-Desktop and other `hermes serve` backends share the existing hourly maintenance timer (first poll after 90 seconds), independently of cron jobs. They measure inactivity from process startup and the most recent chat activity in the same profile, retaining that activity timestamp after a session closes or is reaped, and skip curator while a turn in that profile is running. A connected but inactive window does not block maintenance. A running messaging gateway for the same profile owns these chores instead.+`hermes serve` / `hermes dashboard` backends (for example a remote Desktop connection) share the existing hourly maintenance timer (first poll after 90 seconds), independently of cron jobs. They measure inactivity from process startup and the most recent chat activity in the same profile, retaining that activity timestamp after a session closes or is reaped, and skip curator while a turn in that profile is running. A connected but inactive window does not block maintenance. A running messaging gateway for the same profile owns these chores instead.The timer services its backend's profile. In-flight maintenance runs in a worker thread; closing the backend does not cooperatively interrupt that pass. Starting multiple independent serve processes for the same profile can still race the curator's interval check.diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/bot-mode.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/bot-mode.mdindex e53cb8af6b1..380ed87a10f 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/bot-mode.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/bot-mode.md@@ -220,11 +220,13 @@ hermes peer stop spark run_abc123完整的多连接指南请参阅[将 Desktop 连接到多个 Hermes 实例](./multi-connection-desktop)。-## Warm Bot Backends(同时运行多少个 Bot)+## 本地 Bot 与 gateway(同时运行多少个 Bot)-每个本地 Bot 都运行在自己的后端进程中,Desktop 最多同时保留 **设置 → Advanced → Warm Bot Backends** 个后端存活(默认 3 个,每个约 60 MB)。空闲的后端会在该设置旁边的空闲超时(默认 10 分钟)后被回收;`desktop.log` 中紧跟空闲回收消息之后出现的 `Hermes backend for profile "<name>" exited (1)` 一行就是这次清理,而不是崩溃。当所有槽位都被占用时,你打开的 Bot 会最多等待 30 秒以获得一个槽位,然后以 *timed out waiting for a free local slot* 失败。+Desktop 不会为每个 Bot 运行一个后端。每台主机只有一个 gateway 进程,负责所有本地 profile 的会话:当你打开一个本地 Bot 时,Desktop 会为该 profile 运行 `hermes gateway ensure --json`,它会附加到正在运行的 gateway;如果还没有进程服务该 profile,就启动它。随后 Desktop 通过 WebSocket(`/api/ws`)使用一次性 ticket 连接它。Desktop 端没有后端池,没有“同时保持多少个 Bot 预热”的设置,也没有空闲回收——打开另一个 Bot 从不需要等待槽位,读取另一个 Bot 的历史也只是向同一个 gateway 发一个请求。-读取另一个 Bot 的聊天历史以及后台的记录刷新**不会**占用槽位——只有交互式打开或正在运行的轮次才会。如果你在驾驭一支庞大的队伍(成员众多的群聊,或跨多个 profile 的 Kanban 派发),请把 Warm Bot Backends 调高到你预期同时活跃的 Bot 数量,并为机器配备相应的内存。把它设得比你实际使用的 profile 数量还高,只会增加启动开销。+gateway 的生命周期与 Desktop 窗口无关。关闭窗口或退出 Desktop 只会丢弃连接,绝不会停止 gateway,因此你的消息平台 bot、Routines 和进行中的轮次都会继续运行,Desktop 下次打开时会重新附加。要停止它,请显式运行 `hermes gateway stop`。如果 gateway 在 Desktop 运行期间重启(更新、崩溃,或 `hermes gateway stop` 之后再次打开),Desktop 会重新运行一次 `gateway ensure` 并重新连接。标记为 `gateway.standalone: true` 的 profile 会保留自己的 gateway;Desktop 以同样方式附加到它。++**设置 → Connections** 中的远程 gateway、SSH 主机和 Hermes Cloud 实例是独立的主机,拥有各自的进程;它们的 Bot 运行在那台机器上(参见上文*跨机器的 Bot*),而不是本机的 gateway 上。## 关闭它