Skip to content

Latest commit

 

History

History
285 lines (226 loc) · 33.8 KB

OPERATIONS.md

File metadata and controls

285 lines (226 loc) · 33.8 KB

Operations & Advanced Usage

This document covers the operational and advanced topics split out of the main README: quota enforcement, client auto-update, multi-profile sync, data retention, server migration, the MCP tools in detail, the Hermes SQLite-lock compatibility note, and a troubleshooting table.

Quota (Optional)

  • Users carry a plan (free / unlimited); registration without an invite code grants free, registration with an invite grants the invite's plan (default unlimited), and admins can create invite codes granting free. The default free plan caps a user at 300 active sessions.
  • Enforcement: POST /push gates new session writes only — an Agent allowlist plus the user-wide active session count. Updates to existing sessions and pulls are never blocked, so lowering a quota never breaks an already-synced pool. Rejections return 403 (agent_not_allowed / quota_exceeded_sessions) and are recorded in the audit log.
  • Policy lives in the DB (users.plan + quota_config): an operator changes it and the next push applies it — no API coupling, no restart. The quota UI (sidebar usage, invite grant-plan controls) shows whenever a limited plan is reachable — a free-granting invite or existing free users (default registration grants free, so it appears once anyone registers); enforcement still applies when the UI is hidden.
  • Ops SQL (adjusting limits, minimal-privilege read-only role) is in server-deployment.md.

Client Auto-Update

MCP clients have built-in auto-update: a check runs about 1 minute after startup and then every 1 hour. New versions are pulled from the server via /api/client/manifest (version comparison) and /api/client/download (a zip with a SHA256 manifest), verified file by file, then atomically replaced in place, with a backup of the previous version kept (.bak-<version>/). The update takes effect after the Agent is restarted (the MCP server cannot restart itself and does not interrupt ongoing sessions).

  • Disable: HERMES_SYNC_AUTO_UPDATE=0; adjust the interval: HERMES_SYNC_UPDATE_INTERVAL
  • Server default in shipped packages: every downloaded client package has its HERMES_SYNC_SERVER code default set to the server that served the download (per-request address), or to HERMES_SYNC_PUBLIC_URL when that server-side variable is configured. To migrate existing clients to a new address: set HERMES_SYNC_PUBLIC_URL to the new address on the server and bump CLIENT_VERSION — clients pull the new package from the old address (keep it reachable until they all update) and switch after the agent restarts.
  • If verification fails or the network is unreachable, the old files are kept and only a log entry is recorded; sync is unaffected
  • Rollback: copy the files from .bak-<version>/ back into the mcp/ directory and delete .hermes-sync-version
  • Release workflow: after modifying the client, bump the CLIENT_VERSION constant in both mcp/updater.py and server/client_update.py; once the server is deployed, all clients upgrade automatically at their next check. scripts/deploy-remote.py --list prints the exact upload set (server modules/templates/static, the mcp/ package and the /opt/scripts files the client zip embeds) without connecting; the script takes DEPLOY_SSH_PORT (a deployment on a non-default SSH port sets it) and probes the schema with the local psql before falling back to the legacy docker container.

Multi-Profile Sync (Hermes profiles)

The Hermes desktop app supports multiple profiles: each named profile is a completely independent storage directory with its own state.db (default at the platform root, named profiles in <root>/profiles/<name>/). The client scans every profile under the platform root and syncs them one by one — a single MCP instance covers all profiles on the machine without cross-contamination.

Profile Discovery Rules

Platform root <root> (default platform locations only; HERMES_HOME / active_profile are not read)
├─ Windows: %LOCALAPPDATA%\hermes
└─ POSIX:   ~/.hermes

Scan:
├─ <root>/state.db                  → default profile (bare id, backward compatible)
└─ <root>/profiles/<name>/state.db  → named profiles (e.g. magic), sorted by name
  • MCP subprocesses do not inherit the profile: Hermes' profile switching is implemented with an in-process ContextVar and is not passed to MCP server subprocesses via environment variables; the desktop app neither writes an active_profile marker nor passes HERMES_HOME. The client therefore scans the profiles/ directory to discover all profiles instead of resolving the "currently active profile".
  • Single watermark: the incremental pull watermark lives at the platform root in <root>/.hermes-sync-watermark, shared by all profiles; every pull is incremental based on the server's last_synced_at, so profiles never get mixed.

Session IDs and Isolation

Profile canonical id Description
default bare id (20260808_180012_0c275f) backward compatible, behavior unchanged
non-default (e.g. magic) 20260808_180012_0c275f the profile travels in the profile_name column; bare ids never collide because profiles are a column, not part of the id
  • Zero server changes: sessions of different profiles are distinguished purely by the id prefix, and the profile_name column is filled in with the profile name as a bonus.
  • Push merges everything: on push, the client reads state.db from every local profile and merges them into a single list to report; each session carries its profile_name (bare ids throughout).
  • Pull routes per profile: on pull, sessions are routed back to each profile's state.db by id prefix; sessions of profiles that don't exist locally (profiles unique to other machines) are skipped. Sessions from other agents are stored in the default profile with their canonical id intact — every client pulls the full workspace pool and pushes everything it holds (the server merges by canonical id; agent_type is preserved per session and messages dedupe by (session_id, role, timestamp), so a foreign session continued locally pushes only its newly-added messages).

Cross-Computer Sync Example

Machine A: default + magic profile     Machine B: default + magic profile

t1: A only has default; B only has default
    → bare-id sessions merge on both sides, same behavior as single-profile sync
t2: A creates the magic profile; B hasn't created it yet
    → A pushes sessions with `profile_name=magic`; B skips them on pull (no local magic profile)
t3: A and B both have the magic profile
    → magic sessions merge on both sides (profile_name=magic); default syncs as usual

Note: the client only syncs profiles that already exist locally. When a profile exists only on a remote device, the local pull skips that profile's sessions (the watermark still advances); once you create a profile with the same name locally, its historical sessions can be pulled back from the server.

Project Sync (shared pool)

Projects are a workspace-level shared pool: /api/projects/pull returns every visible project of the workspace regardless of which agent asks, exactly like sessions. Each client pushes only what its own agent's store holds:

  • Hermes — per-profile projects.db (<profile-dir>/projects.db, alongside state.db). The client walks every projects.db by profile to sync projects across devices:
    • Push: reads projects.db from every local profile and merges them into a canonical list to push (ids are bare, the profile field carries the hermes profile).
    • Same-name merge: for projects in the same workspace with the same (profile, slug) but different ids, the server merges them into the earliest-created project: folders are unioned, and a remap (old_id → new_id) is recorded so clients can converge.
    • Pull: pulls remote projects plus remap records and routes them back to each profile's projects.db by id prefix; folders merge incrementally (new paths inserted, existing paths updated, nothing deleted), and slug conflicts get a de-duplicated suffix automatically.
  • WorkBuddy — the desktop app's project list is the workspaces table in workbuddy.db (path + last_opened_at ms), which has no id/slug/name column. The adapter keeps the canonical identity per path in the sidecar .workbuddy-sync-projects.json (written from each pull), mints wb_<sha1(path_key)> deterministically for a path the server never saw, and on pull adds a workspace row (creating the directory) for every pulled project path. Existing rows are never re-dated and never deleted; a project whose directory cannot exist on this machine (e.g. a missing drive) simply stays server-side.
  • Capability: an adapter takes part only when it declares supports_projects = True (hermes, workbuddy). Every other agent skips the project stage — no local project store to read or write.
  • Root-shaped paths stay out of the pool: a drive/filesystem root, the user home or one of its ancestors (D:/, C:/Users, C:/Users/<name>, /home/<name>) is never pushed or pulled as a project — it is an ancestor of every session, so its card would swallow the whole subtree, and its meaning differs per machine (C:/Users/rong vs C:/Users/x1). Clients filter it on both sides (mcp/adapters/base.py::is_root_project_path); the paths stay local (a WorkBuddy workspace keeps working, hermes' projects.db is untouched). Full rationale: ARCHITECTURE "根目录(home / 盘符根)不入共享项目池".
  • Retiring a project card: there is no Web/API entry for it (projects.hidden exists but nothing in the app writes it, and project_folders is union-only). Use scripts/hide-root-projects.py on the server: it finds root-shaped projects (dry-run by default), then --apply sets hidden = 1 (removes the card from the Web list and from /api/projects/pull for every client, reversible with --undo). A hidden project cannot be resurrected by a client push — the push update path never writes hidden.
  • Web session association: the project list on the Web workspace page prefix-matches session cwd against project folders (case-insensitively) to show the sessions under each project (consistent with Hermes' native project_for_path logic; paths are per-machine and the Web shows the union). Sessions in folders that belong to no project are listed but not grouped — and because the match is not exclusive, a project folder nested inside another project's folder makes those sessions show under both cards.
  • Tools: project_push / project_pull can be triggered manually; periodic sync (default 300s) also syncs projects along the way.

Session Last Activity (last_activity_at)

sessions.last_activity_at is the session's real last-activity time = the newest visible message timestamp. The server derives it on every /push from the messages in that payload (a client-sent value for the same field is overwritten); a message-less metadata-only push passes the client's own value through. Clients only consume it, writing it into whichever local "last updated" column their agent has (Hermes last_activity_at, WorkBuddy updated_at+last_activity_at, omp title-slot updatedAt, OpenClaw index updatedAt/lastInteractionAt/lastActivityAt) — the rule lives in mcp/adapters/base.py::session_last_activity (canonical value → newest message → ended_at → now). Rationale: ended_at disagrees per agent (2026-09-13: missing in 5 of 40 pulled sessions, equal to the newest message time in only 3), and the Web already orders by MAX(message.timestamp). Rows that predate the column stay NULL until a client re-pushes them; scripts/backfill-last-activity.py fills them in one go (--apply; dry-run default; idempotent).

Data Retention & Retrieval (Delete / Trash / Pinned / Search)

  • Delete / Restore (soft-hide): the Web session list and message detail views support "delete / restore"; data is kept, not deleted (a soft hidden flag), and fully reversible. Deleted items move to the trash: /web/workspace/{id}/trash (session trash) and /web/workspace/{id}/session/{sid}/trash (message trash), where they can be restored. Once deleted:
    • the server's /pull no longer delivers deleted sessions/messages (data stays on the server and is delivered again after restore);
    • /push does not reset the hidden flag when updating existing rows;
    • the session list and message viewer hide deleted items by default; the trash pages show them for viewing and restoring.
  • Pause / resume sync (per session): the session list (/web/workspace/{id}, /web/all-sessions) and the session viewer carry a "pause sync" / "resume sync" control; tick several sessions and use the bulk bar to pause/resume them at once. A paused session is frozen on the server: /push and the Web import write nothing to it (session metadata, messages, rev/field_rev and last_synced_at all stay put), while /pull keeps delivering the frozen copy to every device — pause only stops the upload direction. Clients re-send paused sessions every cycle (they record no push fingerprint for them), so content written during the pause lands on the server on the next cycle after you resume; nothing is lost. Paused sessions are marked "Sync paused" in the lists. Exact contract (including the older-client window): docs/ARCHITECTURE.md "暂停/恢复同步".
  • Pinned ordering: the session list sorts pinned sessions first (pinned, 📌 marker). Currently used for display ordering only; there is no pin-management entry yet.
  • Search: the Workspace session list ?q= fuzzy-filters by title / id; the session detail page ?q= fuzzy-filters by message content (LIKE wildcards are escaped to prevent injection).

Migrating existing local data

Already been using Hermes and want your history on the server too? Push historical sessions from the local state.db to the remote server:

python scripts/migrate-local-to-server.py ws_yourkeyhere https://<your-domain>

The server binds 127.0.0.1:8765 only, so the URL here is the address the reverse proxy publishes (a domain over HTTPS), not the app port.

This is optional — new clients bootstrap locally-held data onto the server on first pairing; this script just uploads existing history proactively.

Server Migration

Server address priority: the HERMES_SYNC_SERVER environment variable in config.yaml > the default value in the server.py code (currently the deployed server address). The client auto-update ships the new default address along with the update.

Seamless migration (recommended — keep the old server online until all clients have updated):

  1. Deploy the new server (with the new default address) and bump CLIENT_VERSION
  2. Keep the old server online (clients still need to pull updates from the old address)
  3. Wait for each client to finish auto-updating (checked 1 minute after startup / every 1 hour)
  4. Clients connect to the new server automatically after the Agent is restarted
  5. Once no client is still connected to the old server, take the old server offline

When the old server goes offline directly: clients can no longer pull updates from the old address and need manual handling — add HERMES_SYNC_SERVER: https://new-address to the env section of config.yaml on each machine (environment variables take priority), or manually copy the new server.py into the mcp/ directory. The address is whatever the reverse proxy publishes: the app itself binds 127.0.0.1:8765 and cannot be dialed directly.

Id-scheme upgrade (2026.08.18): canonical session ids are bare for every agent — agent_type (sessions + messages) records the owning agent and profile_name records the hermes profile (projects: profile column). Legacy prefixed ids (codex:..., magic:..., ...) pushed by old clients are normalized by the server's inbound shim, so mixed-version deployments work. To migrate an existing database run python scripts/migrate-id-scheme.py --apply (dry-run by default; collisions are reported and skipped, never merged). After migration, hermes-profile and workbuddy sessions pull onto Windows machines too (their bare ids are legal file names).

Watermark follows the server identity: the incremental pull watermark records which server it belongs to. When a client points at a different server (via env var or the updated default address), the watermark mismatch triggers a full re-pull automatically — a leftover watermark from the old server can never suppress sessions on the new one.

Sync Tools (background behavior)

The full tool list lives in the README; details of the background engine:

  • One automatic incremental pull at startup (delayed 8 seconds to avoid the host agent's startup/read peak; local .hermes-sync-watermark watermark + 5-minute clock tolerance); if the remote is empty, local data is pushed automatically (first-pairing bootstrap for new devices)
  • Periodic auto-sync (default 300 seconds; 1800 once the wake hook below is armed)
  • Event-driven wake: scripts/install-hermes-sync-hook.py --apply registers a Hermes shell hook on on_session_end that touches <stem>.wake; the loop watches that file (HERMES_SYNC_WAKE_POLL_S, 5 s) and runs a cycle as soon as a turn ends instead of polling on a short timer. Standbys ignore wake events. See Large stores: incremental reads, API writes and the wake hook
  • Watermark bound to the server identity: pointing the client at a different server automatically triggers a full re-pull (see Server Migration)
  • Batching: pulls page in small batches (15 sessions per request); pushes split by session-count + message-count + byte-size (default 8 MB) limits — large syncs never time out; a single oversized session rides alone in its own chunk, and a failed chunk (413 / quota / timeout) no longer aborts the rest of the push cycle
  • Push-side watermark (session fingerprint): each session records a push fingerprint (message_count, max_timestamp[, file mtime]) in a sidecar next to the field-meta file; periodic push skips sessions whose fingerprint is unchanged (the fingerprint updates only after a successful push), so a large store no longer re-uploads everything every cycle. Agents without field-meta fall back to full push (previous behavior). mtime is provided by the adapter where available (workbuddy implements it, so a pull that touched a copy also invalidates its fingerprint)
  • Pull write retry: when the local store is locked by the host agent, the pull write retries a few times (each attempt fails fast with a 5 s busy_timeout)
  • Single-writer lock: with two serve instances, only one process runs background sync, avoiding local storage races; auto-update uses a separate update lock
  • Message dedup is based on the (session_id, role, timestamp) triple, idempotent across devices
  • Background sync completion sends an MCP log notification (notifications/message, logger hermes-sync) to the host agent; whether the host surfaces it in the UI is host-dependent — the Web UI is the guaranteed visibility channel

Large stores: incremental reads, API writes and the wake hook

A hermes store grows fast: the development machine's state.db reached 821 MB / 742 sessions / 109,869 messages, of which messages is 297 MB and the two FTS5 indexes (messages_fts_trigram_data, messages_fts_data) are 406 MB. Every write to messages fires 11 triggers over those indexes, so a sync client that reads the whole store every cycle and writes pulled messages in a second process is expensive on both sides (observed: event loop stalled in the Hermes web server, 67 MB state.db-wal that could not reset).

Four changes address that. All are on by default where noted; none changes the wire format or the server.

  1. Incremental reads (default). mcp/adapters/base.py gained read_session_headers() and session_fingerprints(); hermes answers both from SQL (SELECT session_id, COUNT(*), MAX(timestamp) … GROUP BY session_id, covered by an index) instead of materializing messages. The push reads headers + fingerprints, compares them with its sidecar and materializes ONLY the changed sessions; the pull's inventory uses headers. Measured on the store above: full read 5.2 s / ~300 MB of pages → headers 0.6 s + fingerprints 0.06 s + 0.05 s for the changed sessions. A sub-agent session's messages are folded into its root, so the root's fingerprint rolls up its subtree and a partial read expands to the ancestor chain plus the root's whole subtree. Other agents keep the previous full read (supports_incremental_read is per adapter).

  2. Writes through Hermes (optional, HERMES_SYNC_HERMES_API). Hermes' HTTP API writes inside the Hermes process (mutate_session(authority, …), documented in its source as "never open a second writer"). Set HERMES_SYNC_HERMES_API=http://127.0.0.1:9119 for a backend started with hermes serve --host 127.0.0.1 --port 9119; a loopback bind needs no auth, a Desktop-owned backend needs HERMES_SYNC_HERMES_API_TOKEN (X-Hermes-Session-Token). Only sessions absent locally go through it: Hermes' POST /api/sessions/import is an import, not an upsert — it skips ids that already exist, so message appends to an existing session still use the local SQLite writer. Any HTTP error, validation refusal or unreachable backend falls back to that writer for the affected sessions, so the pull never depends on the API being up.

    The backend must OWN the profile. While the Desktop gateway runs it owns state.db, and a standalone hermes serve is refused for writes with 409 Exclusive maintenance refused: Gateway runtime already owns profile ... (Hermes' "never open a second writer" rule) — that case is what the gateway RPC path (next item) covers. Verified on a live backend: new session imported (imported: 1), readable through GET /api/sessions/{id}/messages; an existing session's new message appended through the SQLite path and visible through the same API; profile_name: magic routed to ?profile=magic; a wrong X-Hermes-Session-Token produced 401 and the local fallback wrote the row. Canonical payloads pass Hermes' _validate_import_payload unchanged (verified against Hermes 0.22.1).

  3. Writes through the running gateway (Desktop; default auto). The Desktop gateway accepts session edits over its own WebSocket JSON-RPC (session.mutate), and any same-user process can mint the ticket it needs through the local control channel. mcp/hermes_gateway.py discovers the owner without starting one (discover_gateway_endpoint, whose contract is "preserving uncertainty instead of spawning"), then mcp/hermes_gateway_write.py runs under the Hermes install's own interpreter (in-process when the MCP child already uses it, otherwise as a child process) and imports each new session. Hermes stays the only writer.

    Version skew is handled by capability probing, not version numbers: the helper first issues a non-mutating probe — renaming a session that does not exist — and treats not_found as "contract accepted", unknown_method/invalid_params/permission_denied as "this version does not speak our shape". Anything else (missing gateway, protocol mismatch, ticket refusal, timeout) is reported with a bounded reason and the batch goes to the local writer; supported: false refuses the whole batch rather than trusting partial outcomes. runtime.describe is not used as the gate: its capabilities list does not advertise mutation verbs.

    Titles are disambiguated with the local " (N)" rule before the import because Hermes enforces UNIQUE INDEX sessions(title) and a collision fails the statement (UNIQUE constraint failed: sessions.title, measured). scripts/probe-hermes-write-path.py prints which path a machine will use (API / gateway RPC / local SQLite) plus the probe verdict — run it on an unfamiliar Hermes version instead of guessing. Measured on 0.22.1 with the gateway running: new session written by the gateway in 0.75 s (child helper incl. startup), existing session appended through SQLite, colliding title stored as dup probe (2).

  4. Wake hook (opt-in). python scripts/install-hermes-sync-hook.py (dry run) / --apply writes a hooks.on_session_end entry that runs mcp/wake.py, records its consent entry in ~/.hermes/shell-hooks-allowlist.json through Hermes' own writer, and creates the wake file. Restart Hermes so the hook registers. --remove undoes it. With the wake file present the client's fallback interval becomes 1800 s; HERMES_SYNC_INTERVAL still overrides. sync_status reports wake_file / wake_hook_armed.

Compatibility with Hermes 0.20+ (SQLite Lock Contention)

Symptom: the Hermes desktop app reports request timed out after 30s: session.resume.

Root cause: the SQLite 3.50.4 bundled with Hermes has a WAL-reset corruption bug (see the hermes doctor / errors.log warnings), so Hermes forcibly falls back to journal_mode=DELETE — in that mode any write transaction blocks concurrent readers. The MCP client's background sync (startup pull, periodic sync) writes directly to Hermes' state.db; while it holds the write lock, Hermes' own session.resume (reading state.db) keeps waiting and errors out after the desktop's 30-second RPC timeout (shown as database is locked in errors.log).

Hermes 0.21+ note: after upgrading Hermes 0.20 → 0.21 the same request timed out after 30s: session.resume symptom can appear while hermes' own logs show no database is locked — the sync client is then not the blocker (its state.db writes are tiny and fail fast). Check the hermes backend logs for event loop stalled … (GIL pressure) / ws write slow and the desktop log for Timed out connecting to Hermes backend after 60000ms: the stall is inside Hermes itself, not sync lock contention.

Mitigations already in place in this client:

  • The SQLite write connection's busy_timeout is shortened to 5 seconds: if the lock can't be acquired it fails immediately and defers to the next sync cycle — it never holds or waits on a lock for long
  • The startup auto-pull is delayed by 8 seconds to avoid the read peak of Hermes startup and session resume
  • Background pulls are incremental (local .hermes-sync-watermark watermark + 5-minute tolerance) instead of a full rescan every time
  • New HERMES_SYNC_AUTO_SYNC=0 fully disables background auto-sync (manual tool calls still work), completely eliminating lock contention with Hermes
  • Mutating sync tools also take the cross-process lock (HERMES_SYNC_TOOL_LOCK_WAIT_S, default 20s): a manual tool call never writes concurrently with a background cycle or with another client copy

Recommendation (root fix): run hermes update to upgrade Hermes' bundled SQLite to 3.51.3+ (or hermes doctor to repair the embedded runtime); once WAL concurrency is restored, reads and writes no longer block each other and the mitigations above are no longer needed.

Known Issues & Troubleshooting

Symptom Cause Resolution
Sync won't push (server total_sessions doesn't grow) The old server returns 500 for columns added in Hermes 0.20 (e.g. system_prompt_hash) Upgrade the server to a version with column filtering; the client recovers automatically next cycle
request timed out after 30s: session.resume/create Hermes 0.20 SQLite lock contention (see previous section); on Hermes ≥0.21 with no database is locked in hermes logs the cause is hermes backend stalls, not sync Upgrade SQLite or set HERMES_SYNC_AUTO_SYNC=0; on 0.21 check hermes backend/desktop logs for event-loop stalls (see note above)
Sync fails with UNIQUE constraint failed: sessions.title Hermes 0.20+ enforces a partial unique index on sessions.title (WHERE title IS NOT NULL); sessions in the shared pool can carry the same auto-generated title Client now disambiguates colliding titles with a (N) suffix on pull (mirroring the desktop app); update the client
Authentication failure after registering the downloaded package <YOUR_API_KEY> was not replaced with a real Key Copy the Key for the corresponding workspace from the onboarding help page
Server session/message count keeps growing for reasonix sessions The reasonix desktop normalizes local transcripts (strips timestamps, prepends its system prompt), so the (role, timestamp) dedupe triple no longer matches and every periodic push re-inserts the same messages Server-side content-level dedupe now covers reasonix (same treatment as hermes' message-alternation repair); update the server
Reasonix local transcript grows forever Same normalization breaks the local pull dedupe, re-appending identical messages The reasonix adapter dedupes pulled writes by content as well; update the client
Foreign session titles revert to the bare id on the server A pulled session re-pushed by reasonix carried the local-id title fallback The adapter no longer sends the fallback title for foreign sessions (server keeps its own); update the client
After the id-scheme upgrade, magic:/workbuddy: sessions were not pullable on Windows Prefixed ids contain : — invalid Windows file names (silently become NTFS alternate data streams) Canonical ids are now bare for every agent (see the Id-scheme upgrade note)
DSH Desktop boots fine but sync never runs (no mcp__hermes-sync__* tools, watermark never moves) The @deepseek-ai/dsh-mcp-client row has no cwd; the plugin defaults it to "", spawn() fails with ENOENT, and failOnStartupError: false hides the startup failure Add cwd: '<EXTRACT_DIR>' to the row in ~/.dsh/profiles/<profile>/cordis.patch.yml and restart; set failOnStartupError: true temporarily to read startup errors on the desktop's startup page (see SUPPORTED_AGENTS.md)
A desktop client stays standby forever after restarting the app (tools work, nothing syncs) Fixed in client 2026.10.02.1. The role used to be decided once per process by a startup lock race, so a copy that lost it (a leftover process from the previous app instance, or a sibling window that started first) stayed Standby for its whole life — and once the owner was gone nothing synced at all Client ≥ 2026.10.02.1 keeps the role in a durable lease (hermes-sync-<agent>.primary.json) and a standby re-checks it every cycle and promotes itself once the owner has missed a whole HERMES_SYNC_INTERVAL or is gone (pid + heartbeat). On an older client: end the stale agentctxsync-mcp-client-*/mcp/server.py process (or restart the app after killing it) so the fresh client wins the startup race
Nothing in the host's logs explains why sync stopped (no MCP client stderr at all) The host owns the client's stderr and commonly drops it (omp keeps no MCP stderr anywhere), so role elections, transport loss and cycle failures left no trace Client ≥ 2026.10.02.1 mirrors every log line into <stem>.log under %LOCALAPPDATA%\hermes (rotated into .log.1 at HERMES_SYNC_LOG_MAX_BYTES, default 512 KiB) and answers "who is syncing?" through sync_status (instance.role, lock_holder_pid, lease, lease_owner_alive)
One hermes session is stuck at an old snapshot on the server while newer ones never arrive The client's whole push cycle aborted on a non-JSON-encodable value (Hermes 0.20's messages.display_identity BLOB leaked into the canonical message) Client ≥ 2026.09.12.4 drops binary columns and isolates any remaining offender (unsendable: [id...] + a field-level log line); update the client, then restart the host agent
A session deleted locally comes back on the next sync (or: deleting one locally does not stick) By design since client/server 2026.09.12.5: any session the server still holds visible is authoritative, so a locally missing row is restored on the next pull (a local delete is not a delete signal — see ARCHITECTURE "本地删除不是删除信号") To retire a session for every device, soft-delete it server-side (Web workspace → hide / trash): hidden rows are never delivered and never reported missing. Reversible via restore
Client ≥ 2026.09.12.5 logs Restored N session(s) the server still holds after every sync Same rule, with the same session missing locally every round — usually a local store that cannot keep the row (read-only/wrong agent store) Expected only while the session is genuinely absent locally; if it repeats forever, check the adapter's stores_pulled_sessions (read-only uploaders set it False)
A hermes session is visible on the server but never appears locally; the client logs skipped N session(s) from profiles/agents not present on this machine (and 2026.09.12.5 clients log Restored N while imported stays 0) The row carries profile_name='default' — hermes' local profile_name column literal, pushed by older clients. The canonical spelling of the default profile is ""/NULL, so the pull-side router (which has no default key) silently drops the row Client ≥ 2026.09.13.1 drops the literal on push and routes default as the default profile, so existing rows land; update the client (the completeness repair alone re-fetches such rows every cycle without filing them)