fix(chat): support session IDs containing slashes in Retrofit endpoints (#473)
* fix(chat): support session IDs containing slashes in Retrofit endpoints
Set encoded = true on the @Path("id") annotations for all session endpoints
to prevent URL-encoding slashes, which caused 404 errors.
* chore: clean up inline comments — drop kanban metadata, align issue ref to #468
---------
Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
9689d17be0
commit
d5fa70b34b
1 file changed
+12
-4
@@ -126,7 +126,9 @@ interface HermesApiService {
|
|||||||
|
|
||||||
@GET("api/sessions/{id}/messages")
|
@GET("api/sessions/{id}/messages")
|
||||||
suspend fun getSessionMessages(
|
suspend fun getSessionMessages(
|
||||||
@Path("id") sessionId: String,
|
// Preserve slashes in session IDs — backend generates IDs containing '/' characters (issue #468).
|
||||||
|
// Contract: The server-generated sessionId must only contain URL-safe characters (no ?, #, or spaces).
|
||||||
|
@Path("id", encoded = true) sessionId: String,
|
||||||
): Response<SessionMessagesResponse>
|
): Response<SessionMessagesResponse>
|
||||||
|
|
||||||
@GET("api/sessions/stats")
|
@GET("api/sessions/stats")
|
||||||
@@ -134,7 +136,9 @@ interface HermesApiService {
|
|||||||
|
|
||||||
@PUT("api/sessions/{id}/rename")
|
@PUT("api/sessions/{id}/rename")
|
||||||
suspend fun renameSession(
|
suspend fun renameSession(
|
||||||
@Path("id") sessionId: String,
|
// Preserve slashes in session IDs — backend generates IDs containing '/' characters (issue #468).
|
||||||
|
// Contract: The server-generated sessionId must only contain URL-safe characters (no ?, #, or spaces).
|
||||||
|
@Path("id", encoded = true) sessionId: String,
|
||||||
@Body body: SessionRenameRequest,
|
@Body body: SessionRenameRequest,
|
||||||
): Response<Unit>
|
): Response<Unit>
|
||||||
|
|
||||||
@@ -145,7 +149,9 @@ interface HermesApiService {
|
|||||||
|
|
||||||
@DELETE("api/sessions/{id}")
|
@DELETE("api/sessions/{id}")
|
||||||
suspend fun deleteSession(
|
suspend fun deleteSession(
|
||||||
@Path("id") sessionId: String,
|
// Preserve slashes in session IDs — backend generates IDs containing '/' characters (issue #468).
|
||||||
|
// Contract: The server-generated sessionId must only contain URL-safe characters (no ?, #, or spaces).
|
||||||
|
@Path("id", encoded = true) sessionId: String,
|
||||||
): Response<Unit>
|
): Response<Unit>
|
||||||
|
|
||||||
@POST("api/sessions/prune")
|
@POST("api/sessions/prune")
|
||||||
@@ -155,7 +161,9 @@ interface HermesApiService {
|
|||||||
|
|
||||||
@GET("api/sessions/{id}/prompt")
|
@GET("api/sessions/{id}/prompt")
|
||||||
suspend fun getSessionPrompt(
|
suspend fun getSessionPrompt(
|
||||||
@Path("id") sessionId: String,
|
// Preserve slashes in session IDs — backend generates IDs containing '/' characters (issue #468).
|
||||||
|
// Contract: The server-generated sessionId must only contain URL-safe characters (no ?, #, or spaces).
|
||||||
|
@Path("id", encoded = true) sessionId: String,
|
||||||
): Response<SessionPromptResponse>
|
): Response<SessionPromptResponse>
|
||||||
|
|
||||||
@GET("api/system/stats")
|
@GET("api/system/stats")
|
||||||
|
|||||||
Reference in new issue
Block a user