feat: add session resume capability with automatic continuation

Add ability to resume inactive sessions and automatically continue with new
session ID. Includes message merging for preserving conversation history,
UI improvements to allow sending during inactive state, and database schema
migration. close #87
This commit is contained in:
weishu
2026-01-27 14:44:53 +08:00
parent 7a8f1c3e87
commit 87c79c3b94
24 changed files with 534 additions and 70 deletions
+8
View File
@@ -253,6 +253,14 @@ export class ApiClient {
})
}
async resumeSession(sessionId: string): Promise<string> {
const response = await this.request<{ sessionId: string }>(
`/api/sessions/${encodeURIComponent(sessionId)}/resume`,
{ method: 'POST' }
)
return response.sessionId
}
async sendMessage(sessionId: string, text: string, localId?: string | null, attachments?: AttachmentMetadata[]): Promise<void> {
await this.request(`/api/sessions/${encodeURIComponent(sessionId)}/messages`, {
method: 'POST',