hermes-agent/apps/desktop/src/app
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
..
agents Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
artifacts refactor(desktop): DRY/elegance pass over PR-touched files 2026-06-04 00:28:57 -05:00
chat fix(desktop): satisfy slash metadata typecheck 2026-06-04 17:56:36 -04:00
command-center perf(desktop): make session-id search SQL-bounded, not O(n) 2026-06-04 07:49:34 -07:00
command-palette feat(desktop): polish credentials settings and messaging env routing (#39217) 2026-06-04 14:01:15 -04:00
cron feat(desktop): polish credentials settings and messaging env routing (#39217) 2026-06-04 14:01:15 -04:00
gateway/hooks chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
hooks feat(desktop): global Cmd+K palette + UI consistency overhaul 2026-06-03 23:45:45 -05:00
messaging feat(desktop): polish credentials settings and messaging env routing (#39217) 2026-06-04 14:01:15 -04:00
overlays feat(desktop): dedicated Providers settings + polished Accounts/API-keys UX (#38551) 2026-06-04 03:03:42 -05:00
profiles chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
right-sidebar chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
session/hooks fix(desktop): rename session via session.title RPC so /title works (#39410) 2026-06-04 19:32:24 -05:00
settings fix(desktop): restore accordion expand for credential settings rows (#39327) 2026-06-04 19:10:44 -04:00
shell chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
skills feat(desktop): polish credentials settings and messaging env routing (#39217) 2026-06-04 14:01:15 -04:00
desktop-controller.tsx fix(desktop): rename session via session.title RPC so /title works (#39410) 2026-06-04 19:32:24 -05:00
index.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
layout-constants.ts feat(desktop): global Cmd+K palette + UI consistency overhaul 2026-06-03 23:45:45 -05:00
model-picker-overlay.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
model-visibility-overlay.tsx feat(desktop): inline model picker in the status bar 2026-06-02 19:09:41 -05:00
page-search-shell.tsx chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
routes.ts chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
types.ts fix(desktop): rename session via session.title RPC so /title works (#39410) 2026-06-04 19:32:24 -05:00
updates-overlay.tsx chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00