system prompt

This commit is contained in:
2026-02-17 22:03:02 +00:00
parent 680f623b41
commit cb603e3cf9
7 changed files with 53 additions and 17 deletions
+1
View File
@@ -25,6 +25,7 @@ export type ClientMessage =
// Server → Client
export type ServerMessage =
| { type: 'session:init'; sessionId: string; model: string }
| { type: 'system:prompt'; text: string }
| { type: 'assistant:text'; text: string }
| { type: 'assistant:partial'; text: string }
| { type: 'tool:use'; toolName: string; toolInput: Record<string, unknown>; toolUseId: string }
+1
View File
@@ -135,6 +135,7 @@ async function handleChat({
const workingDir = state.cwd ?? homeDir;
const skillsAppend = await buildSkillsPrompt(ws.data.email);
if (skillsAppend) send(ws, { type: 'system:prompt', text: skillsAppend });
// Build prompt: use AsyncIterable<SDKUserMessage> with image content blocks when images are present
let promptInput: string | AsyncIterable<SDKUserMessage> = prompt;
+2 -1
View File
@@ -401,7 +401,8 @@ async function handleChat({ ws, prompt, sessionId, model, attachmentIds, images,
}
const skillsAppend = await buildSkillsPrompt(ws.data.email);
const fullPrompt = skillsAppend ? `${skillsAppend}\n\n${prompt}` : prompt;
if (skillsAppend) send(ws, { type: 'system:prompt', text: skillsAppend });
const fullPrompt = skillsAppend ? `<system>${skillsAppend}</system>\n\n${prompt}` : prompt;
const parts: Record<string, unknown>[] = [];
if (images?.length) {