PI
This commit is contained in:
@@ -94,7 +94,7 @@ export const SessionList = () => {
|
||||
</div>
|
||||
{session.model && (
|
||||
<div className="text-xs text-duck-teal/70 dark:text-duck-teal/60 truncate">
|
||||
{session.model}
|
||||
{session.model.includes('/') ? session.model.replace('/', ' - ') : session.model}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@ export const ChatHistory = () => {
|
||||
</span>
|
||||
{session.model && (
|
||||
<span className="text-xs text-duck-teal/70 dark:text-duck-teal/60 truncate block">
|
||||
{session.model}
|
||||
{session.model.includes('/') ? session.model.replace('/', ' - ') : session.model}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -29,7 +29,7 @@ export type TaskInfo = {
|
||||
};
|
||||
|
||||
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 }
|
||||
|
||||
Reference in New Issue
Block a user