MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / renameSession

Function renameSession

src/stores/session.ts:649–663  ·  view source on GitHub ↗

* 重命名会话

(id: string, newName: string)

Source from the content-addressed store, hash-verified

647 * 重命名会话
648 */
649 async function renameSession(id: string, newName: string): Promise<boolean> {
650 try {
651 const success = await useDataService().renameSession(id, newName)
652 if (success) {
653 const session = sessions.value.find((s) => s.id === id)
654 if (session) {
655 session.name = newName
656 }
657 }
658 return success
659 } catch (error) {
660 console.error('重命名会话失败:', error)
661 return false
662 }
663 }
664
665 /**
666 * 清空当前选中会话

Callers

nothing calls this directly

Calls 3

useDataServiceFunction · 0.90
renameSessionMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected