Skip to content

fix(desktop): add missing PATCH /api/sessions/{id} so session rename works#36249

Merged
OutThisLife merged 1 commit into
mainfrom
bb/fix-session-rename-405
Jun 1, 2026
Merged

fix(desktop): add missing PATCH /api/sessions/{id} so session rename works#36249
OutThisLife merged 1 commit into
mainfrom
bb/fix-session-rename-405

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • Renaming a chat in the desktop app failed with "Rename failed" and a confusing detail. Root cause: the renderer calls PATCH /api/sessions/{id} (renameSession in apps/desktop/src/hermes.ts), but the backend only defined GET and DELETE for that path, so FastAPI returned 405 Method Not Allowed.
  • Added the missing PATCH /api/sessions/{session_id} endpoint in hermes_cli/web_server.py, backed by the existing SessionDB.set_session_title (handles title sanitization, uniqueness conflicts → 400, and clearing the title when empty/null). Resolves short IDs like the sibling GET handler and returns { "ok": true, "title": "<sanitized>" } as the renderer expects.
  • Fixed a misleading notification: the 405 was caught by an over-broad rule that summarized any "method not allowed" as "The desktop backend does not support that audio endpoint yet" (see screenshot). That rule was meant for audio routes only. Replaced it with an accurate, generic 405 message.

Test plan

  • scripts/run_tests.sh tests/hermes_cli/test_web_server.py — 189 passed (incl. 3 new: rename, clear-title, 404)
  • npm run type-check (apps/desktop) passes
  • Manually rename a session in the desktop app and confirm the title updates without error

The desktop rename dialog sent PATCH /api/sessions/{id}, but the backend
only defined GET and DELETE for that path — FastAPI returned 405 Method
Not Allowed, surfaced to the user as "Rename failed". Add the PATCH route
backed by SessionDB.set_session_title (handles sanitization, uniqueness,
and clearing the title when empty).

Also fix a misleading notification: any 405 was summarized as an unrelated
"does not support that audio endpoint" message. Make it a generic 405 hint.
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/fix-session-rename-405 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9572 on HEAD, 9572 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4961 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@OutThisLife OutThisLife merged commit 7fbe9b7 into main Jun 1, 2026
18 of 21 checks passed
@OutThisLife OutThisLife deleted the bb/fix-session-rename-405 branch June 1, 2026 05:01
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 1, 2026
JoeKowal pushed a commit to JoeKowal/hermes-agent that referenced this pull request Jun 4, 2026
…ousResearch#36249)

The desktop rename dialog sent PATCH /api/sessions/{id}, but the backend
only defined GET and DELETE for that path — FastAPI returned 405 Method
Not Allowed, surfaced to the user as "Rename failed". Add the PATCH route
backed by SessionDB.set_session_title (handles sanitization, uniqueness,
and clearing the title when empty).

Also fix a misleading notification: any 405 was summarized as an unrelated
"does not support that audio endpoint" message. Make it a generic 405 hint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants