feat: add session rename functionality to TUI modal (#1821)

Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Dax <mail@thdxr.com>
This commit is contained in:
spoons-and-mirrors
2025-08-12 22:22:03 +02:00
committed by GitHub
parent 81583cddbd
commit 47c327641b
5 changed files with 231 additions and 41 deletions

View File

@@ -296,6 +296,47 @@ export namespace Server {
return c.json(true)
},
)
.patch(
"/session/:id",
describeRoute({
description: "Update session properties",
operationId: "session.update",
responses: {
200: {
description: "Successfully updated session",
content: {
"application/json": {
schema: resolver(Session.Info),
},
},
},
},
}),
zValidator(
"param",
z.object({
id: z.string(),
}),
),
zValidator(
"json",
z.object({
title: z.string().optional(),
}),
),
async (c) => {
const sessionID = c.req.valid("param").id
const updates = c.req.valid("json")
const updatedSession = await Session.update(sessionID, (session) => {
if (updates.title !== undefined) {
session.title = updates.title
}
})
return c.json(updatedSession)
},
)
.post(
"/session/:id/init",
describeRoute({