PI
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user