This commit is contained in:
2026-02-20 04:32:50 +00:00
parent d9f6eb14ed
commit 2a7485add2
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export type ClientMessage =
// Server → Client
export type ServerMessage =
| { type: 'session:init'; sessionId: string; model: string }
| { type: 'session:init'; sessionId: string; model: string | null }
| { type: 'system:prompt'; text: string }
| { type: 'assistant:text'; text: string }
| { type: 'assistant:partial'; text: string }
+3 -3
View File
@@ -464,11 +464,11 @@ async function handleChat({
const pendingTitle = prompt.slice(0, 100);
// Send session:init AFTER attaching ws so the pi process survives the reconnect
send(ws, { type: 'session:init', sessionId: sid, model: model ?? 'pi-mono' });
send(ws, { type: 'session:init', sessionId: sid, model: model ?? null });
if (session.resourceChatDir) {
const chatDir = join(session.resourceChatDir, 'chat');
const meta = { id: sid, model: model ?? 'pi-mono' };
const meta = { id: sid, model: model ?? null };
mkdir(chatDir, { recursive: true })
.then(() => Bun.write(join(chatDir, 'meta.json'), JSON.stringify(meta)))
.catch(() => {});
@@ -478,7 +478,7 @@ async function handleChat({
id: sid,
title: pendingTitle,
createdAt: Date.now(),
model: model ?? 'pi-mono',
model: model ?? null,
};
mkdir(dir, { recursive: true })
.then(() => Bun.write(join(dir, 'meta.json'), JSON.stringify(meta)))