fix(desktop): add missing PATCH /api/sessions/{id} so session rename works#36249
Merged
Conversation
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.
Contributor
🔎 Lint report:
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PATCH /api/sessions/{id}(renameSessioninapps/desktop/src/hermes.ts), but the backend only definedGETandDELETEfor that path, so FastAPI returned 405 Method Not Allowed.PATCH /api/sessions/{session_id}endpoint inhermes_cli/web_server.py, backed by the existingSessionDB.set_session_title(handles title sanitization, uniqueness conflicts → 400, and clearing the title when empty/null). Resolves short IDs like the siblingGEThandler and returns{ "ok": true, "title": "<sanitized>" }as the renderer expects."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