PI
This commit is contained in:
@@ -94,7 +94,7 @@ export const SessionList = () => {
|
|||||||
</div>
|
</div>
|
||||||
{session.model && (
|
{session.model && (
|
||||||
<div className="text-xs text-duck-teal/70 dark:text-duck-teal/60 truncate">
|
<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>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export const ChatHistory = () => {
|
|||||||
</span>
|
</span>
|
||||||
{session.model && (
|
{session.model && (
|
||||||
<span className="text-xs text-duck-teal/70 dark:text-duck-teal/60 truncate block">
|
<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>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export type ClientMessage =
|
|||||||
|
|
||||||
// Server → Client
|
// Server → Client
|
||||||
export type ServerMessage =
|
export type ServerMessage =
|
||||||
| { type: 'session:init'; sessionId: string; model: string }
|
| { type: 'session:init'; sessionId: string; model: string | null }
|
||||||
| { type: 'system:prompt'; text: string }
|
| { type: 'system:prompt'; text: string }
|
||||||
| { type: 'assistant:text'; text: string }
|
| { type: 'assistant:text'; text: string }
|
||||||
| { type: 'assistant:partial'; text: string }
|
| { type: 'assistant:partial'; text: string }
|
||||||
|
|||||||
@@ -464,11 +464,11 @@ async function handleChat({
|
|||||||
const pendingTitle = prompt.slice(0, 100);
|
const pendingTitle = prompt.slice(0, 100);
|
||||||
|
|
||||||
// Send session:init AFTER attaching ws so the pi process survives the reconnect
|
// 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) {
|
if (session.resourceChatDir) {
|
||||||
const chatDir = join(session.resourceChatDir, 'chat');
|
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 })
|
mkdir(chatDir, { recursive: true })
|
||||||
.then(() => Bun.write(join(chatDir, 'meta.json'), JSON.stringify(meta)))
|
.then(() => Bun.write(join(chatDir, 'meta.json'), JSON.stringify(meta)))
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
@@ -478,7 +478,7 @@ async function handleChat({
|
|||||||
id: sid,
|
id: sid,
|
||||||
title: pendingTitle,
|
title: pendingTitle,
|
||||||
createdAt: Date.now(),
|
createdAt: Date.now(),
|
||||||
model: model ?? 'pi-mono',
|
model: model ?? null,
|
||||||
};
|
};
|
||||||
mkdir(dir, { recursive: true })
|
mkdir(dir, { recursive: true })
|
||||||
.then(() => Bun.write(join(dir, 'meta.json'), JSON.stringify(meta)))
|
.then(() => Bun.write(join(dir, 'meta.json'), JSON.stringify(meta)))
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export type TaskInfo = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ServerMessage =
|
export type ServerMessage =
|
||||||
| { type: 'session:init'; sessionId: string; model: string }
|
| { type: 'session:init'; sessionId: string; model: string | null }
|
||||||
| { type: 'system:prompt'; text: string }
|
| { type: 'system:prompt'; text: string }
|
||||||
| { type: 'assistant:text'; text: string }
|
| { type: 'assistant:text'; text: string }
|
||||||
| { type: 'assistant:partial'; text: string }
|
| { type: 'assistant:partial'; text: string }
|
||||||
|
|||||||
Reference in New Issue
Block a user