From 2a7485add2da516c529de848958d310b06d79f8b Mon Sep 17 00:00:00 2001 From: Andre Padez Date: Fri, 20 Feb 2026 04:29:39 +0000 Subject: [PATCH] PI --- .../officer-web/Screens/Dashboard/ChatHistory/Screen.tsx | 2 +- .../officer-web/Screens/Dashboard/ChatHistory/Widget.tsx | 2 +- src/servers/api/chat-types.ts | 2 +- src/servers/api/pi-mono/websocket.ts | 6 +++--- src/workspaces/apps/Chat/types.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/officer-web/Screens/Dashboard/ChatHistory/Screen.tsx b/src/apps/officer-web/Screens/Dashboard/ChatHistory/Screen.tsx index c54c7e3f..b1e0cf5b 100644 --- a/src/apps/officer-web/Screens/Dashboard/ChatHistory/Screen.tsx +++ b/src/apps/officer-web/Screens/Dashboard/ChatHistory/Screen.tsx @@ -94,7 +94,7 @@ export const SessionList = () => { {session.model && (
- {session.model} + {session.model.includes('/') ? session.model.replace('/', ' - ') : session.model}
)} diff --git a/src/apps/officer-web/Screens/Dashboard/ChatHistory/Widget.tsx b/src/apps/officer-web/Screens/Dashboard/ChatHistory/Widget.tsx index 7e66c84a..67d86784 100644 --- a/src/apps/officer-web/Screens/Dashboard/ChatHistory/Widget.tsx +++ b/src/apps/officer-web/Screens/Dashboard/ChatHistory/Widget.tsx @@ -40,7 +40,7 @@ export const ChatHistory = () => { {session.model && ( - {session.model} + {session.model.includes('/') ? session.model.replace('/', ' - ') : session.model} )} diff --git a/src/servers/api/chat-types.ts b/src/servers/api/chat-types.ts index 37911ec4..fc8ade6a 100644 --- a/src/servers/api/chat-types.ts +++ b/src/servers/api/chat-types.ts @@ -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 } diff --git a/src/servers/api/pi-mono/websocket.ts b/src/servers/api/pi-mono/websocket.ts index 1c4a68d9..6b7761e1 100644 --- a/src/servers/api/pi-mono/websocket.ts +++ b/src/servers/api/pi-mono/websocket.ts @@ -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))) diff --git a/src/workspaces/apps/Chat/types.ts b/src/workspaces/apps/Chat/types.ts index 28169974..47696b5d 100644 --- a/src/workspaces/apps/Chat/types.ts +++ b/src/workspaces/apps/Chat/types.ts @@ -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 }