This commit is contained in:
2026-02-25 16:04:11 +00:00
parent 05c5b648fa
commit b6a0a57893
11 changed files with 698 additions and 22 deletions
+10
View File
@@ -451,6 +451,16 @@ function writeRpcCommand(proc: Subprocess, command: Record<string, unknown>): vo
}
}
export function setThinkingLevel(
process: Subprocess,
level: string,
): void {
writeRpcCommand(process, {
type: 'set_thinking_level',
level,
});
}
export function sendPrompt(
process: Subprocess,
prompt: string,
+3
View File
@@ -39,6 +39,8 @@ export type GroupMeta = {
sessionCount: number;
};
export type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
export type ClientMessage =
| {
type: "chat";
@@ -50,6 +52,7 @@ export type ClientMessage =
sandboxed?: boolean;
groupSlug?: string;
attachmentIds?: string[];
thinking?: ThinkingLevel;
}
| {
type: "resume";
+6 -1
View File
@@ -244,7 +244,7 @@ function createEventHandler(sessionId: string, model: string, cwd: string, stora
async function handleChat(
ws: ServerWebSocket<WSData>,
msg: { prompt: string; sessionId?: string; model?: string; cwd?: string; cwdRoot?: string; sandboxed?: boolean; groupSlug?: string; attachmentIds?: string[] }
msg: { prompt: string; sessionId?: string; model?: string; cwd?: string; cwdRoot?: string; sandboxed?: boolean; groupSlug?: string; attachmentIds?: string[]; thinking?: string }
): Promise<void> {
const { email, username, userId } = ws.data;
const sessionId = msg.sessionId || randomUUID();
@@ -312,6 +312,11 @@ async function handleChat(
session.meta.title = msg.prompt.slice(0, 100);
}
// Set thinking level if provided
if (msg.thinking) {
piBridge.setThinkingLevel(session.piProcess, msg.thinking);
}
// Send prompt to Pi
const requestId = randomUUID();
session.isGenerating = true;