fix: restore model activity reasoning stream

This commit is contained in:
User
2026-07-14 15:03:07 +02:00
parent 1b1554b353
commit c7474f3852
11 changed files with 490 additions and 14 deletions
+3
View File
@@ -3,6 +3,7 @@ import type { RpcClient } from "../rpc/rpc-client.js";
export type ClientEvent =
| { type: "ui_request"; ui_request: any }
| { type: "text_delta"; text: string }
| { type: "activity_delta"; text: string }
| { type: "info"; [k: string]: any }
| { type: "system_event"; [k: string]: any };
@@ -27,6 +28,8 @@ export class SessionBridge {
this.fan({ type: "info", level: m.notifyType ?? "info", text: m.message ?? "" });
} else if (m.type === "message_update" && m.assistantMessageEvent?.type === "text_delta") {
this.fan({ type: "text_delta", text: m.assistantMessageEvent.delta ?? "" });
} else if (m.type === "message_update" && m.assistantMessageEvent?.type === "thinking_delta") {
this.fan({ type: "activity_delta", text: m.assistantMessageEvent.delta ?? "" });
} else if (m.type === "text_delta") {
this.fan({ type: "text_delta", text: m.text ?? "" });
// tool_execution_* events are intentionally NOT forwarded: they clutter
+2 -5
View File
@@ -69,8 +69,7 @@ export function sessionRoutes(
const options = {
provider: s.provider,
model: s.model,
// Keep the saved preference in the manifest; F1 starts tool-first.
thinking: "off",
thinking: s.thinking,
author: getUser(req).id,
question: b.question,
};
@@ -117,9 +116,7 @@ export function sessionRoutes(
const options = {
provider: saved?.provider,
model: saved?.model,
// Phase 1 must reach a widget instead of exposing a long reasoning trace.
// The session keeps its saved preference for later turns.
thinking: "off",
thinking: saved?.thinking ?? settings.thinking,
author: getUser(req).id,
mode: "resume" as const,
};