feat(chat): turn /btw into an isolated composer (#3398)

* feat(chat): turn /btw into an isolated composer

* fix(chat): preserve direct BTW sends and isolate pending preparation

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
ChangeHow
2026-09-07 23:13:07 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent 7b206b1014
commit 02581d08c5
38 changed files with 1227 additions and 311 deletions
+8 -2
View File
@@ -1601,9 +1601,15 @@ export async function unarchiveSessions(
return { restoredIds, failedIds }
}
export async function updateSessionTitle(sessionId: string, title: string): Promise<void> {
const sessionDirectory = getSessionDirectory(sessionId)
export async function updateSessionTitle(
sessionId: string,
title: string,
options?: { directory?: string | null; expectedRuntimeKey?: string },
): Promise<void> {
if (isStaleRuntime(options?.expectedRuntimeKey)) throw new Error("runtime changed")
const sessionDirectory = options?.directory ?? getSessionDirectory(sessionId)
const session = await opencodeClient.updateSession(sessionId, { title }, sessionDirectory)
if (isStaleRuntime(options?.expectedRuntimeKey)) throw new Error("runtime changed")
useGlobalSessionsStore.getState().upsertSession(session)
mirrorSessionIntoLiveStores(session, sessionDirectory)
}