fix(desktop): add missing PATCH /api/sessions/{id} so rename works (#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 commit is contained in:
brooklyn!
2026-06-01 00:01:28 -05:00
committed by GitHub
parent bdceedf784
commit 7fbe9b79ab
3 changed files with 72 additions and 1 deletions
+2 -1
View File
@@ -68,7 +68,8 @@ const ERROR_SUMMARIES: { test: (msg: string) => boolean; summarize: (msg: string
},
{
test: msg => /method not allowed/i.test(msg),
summarize: () => 'The desktop backend does not support that audio endpoint yet. Restart Hermes Desktop.'
summarize: () =>
'The desktop backend rejected that request (405 Method Not Allowed). Try restarting Hermes Desktop.'
},
{
test: msg => /microphone permission/i.test(msg),