refactor: dedupe agent and reply runtimes

This commit is contained in:
Peter Steinberger
2026-03-02 19:47:30 +00:00
parent 8768487aee
commit 9617ac9dd5
53 changed files with 1828 additions and 1176 deletions

View File

@@ -182,6 +182,16 @@ export function emitAssistantLifecycleErrorAndEnd(params: {
params.emit({ type: "agent_end" });
}
export function createReasoningFinalAnswerMessage(): AssistantMessage {
return {
role: "assistant",
content: [
{ type: "thinking", thinking: "Because it helps" },
{ type: "text", text: "Final answer" },
],
} as AssistantMessage;
}
type LifecycleErrorAgentEvent = {
stream?: unknown;
data?: {