hermes-agent/apps/desktop/src
Ben Barclay c54b935873
fix(desktop): rename session via session.title RPC so /title works (#39410)
The desktop `/title <name>` command 404s with "Session not found" on
every platform (reported on Windows in #38508).

Root cause: `session.create` returns two distinct ids — a *runtime*
session id (held in `activeSessionIdRef`) and a `stored_session_id` (the
DB `sessions.id`) — and deliberately does NOT persist a DB row until the
first turn. Routing `/title` through the REST `PATCH /api/sessions/{id}`
endpoint (as #38576 proposed) resolves the id against the `sessions`
table, so the runtime id — or any brand-new, not-yet-persisted session —
never resolves and returns 404. This is an id-type mismatch, not a
Windows file-locking quirk, so it fails on macOS and Linux too.

Fix: route `/title <name>` through the gateway's `session.title` RPC —
the exact path the TUI already uses (`ui-tui/.../slash/commands/core.ts`).
The RPC maps the runtime id to the in-memory session, writes through the
gateway's own DB connection, and queues the title (`pending: true`) when
the row isn't persisted yet, so it works for a fresh chat. The sidebar is
then refreshed via the existing `refreshSessions()` plumbing.

Keeps the sidebar-refresh wiring and `refreshSessions` threading from
#38576; replaces only the broken REST/slash-worker write path. A bare
`/title` (no arg) still falls through to the worker to show the current
title.

Tests rewritten to assert `session.title` routing with the runtime-vs-
stored id distinction (which the original mock collapsed), plus the
queued/`pending` fresh-chat case and the error path.

Supersedes #38576. Fixes #38508.

Co-authored-by: xxxigm <54813621+xxxigm@users.noreply.github.com>
2026-06-04 19:32:24 -05:00
..
app fix(desktop): rename session via session.title RPC so /title works (#39410) 2026-06-04 19:32:24 -05:00
components fix(desktop): offer remote sign-in on a gated-gateway boot failure (#39402) 2026-06-04 17:28:29 -07:00
hooks Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
lib feat(desktop): search sessions by id 2026-06-04 07:49:34 -07:00
store chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
themes Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
types feat(desktop): dedicated Providers settings + polished Accounts/API-keys UX (#38551) 2026-06-04 03:03:42 -05:00
global.d.ts feat(desktop): username/password login for remote gateways (#38851) 2026-06-04 01:33:23 -07:00
hermes.ts fix(desktop): configure local/custom endpoint without an API key or UI changes 2026-06-03 17:48:55 -07:00
main.tsx fix(desktop): stabilize project folder sessions (#37586) 2026-06-02 20:23:09 +00:00
styles.css feat(desktop): dedicated Providers settings + polished Accounts/API-keys UX (#38551) 2026-06-04 03:03:42 -05:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00