feat(tui): start fresh chats in launch workspace

This commit is contained in:
chengyongru
2026-08-20 11:16:09 +08:00
committed by chengyongru
parent 1018bdb7fe
commit c615aee2ca
11 changed files with 85 additions and 105 deletions
+2 -1
View File
@@ -157,6 +157,7 @@ export interface ClientOptions {
connectionRetryLabel?: string
startupRetryMaxDelayMs?: number
chatId?: string
initialWorkspaceScope?: WorkspaceScopePayload
reconnectDelayMs?: number
onEvent: (event: InboundEvent) => void
onStatus: (status: ConnectionStatus, detail?: string) => void
@@ -995,7 +996,7 @@ export class NanobotClient {
this.chatId = requestedChatId
this.write({ type: "attach", chat_id: this.chatId })
} else {
this.write({ type: "new_chat" })
this.newChat(this.options.initialWorkspaceScope)
}
} else if (event.event === "attached") {
this.chatId = event.chat_id