fix merge; add control logging

This commit is contained in:
Peter Steinberger
2025-12-09 01:45:56 +00:00
parent 31750b5ee5
commit e15475449c
4 changed files with 1763 additions and 1762 deletions

View File

@@ -625,13 +625,10 @@ export async function runCommandReply(
toolCallId?: string;
tool_call_id?: string;
};
const role =
typeof msg.role === "string" ? msg.role.toLowerCase() : "";
const role = (msg.role ?? "") as string;
const isToolResult =
role === "toolresult" || role === "tool_result";
if (!isToolResult || !Array.isArray(msg.content)) {
// not a tool result message we care about
} else {
role === "toolResult" || role === "tool_result";
if (isToolResult && Array.isArray(msg.content)) {
const toolName = inferToolName(msg);
const toolCallId = msg.toolCallId ?? msg.tool_call_id;
const meta =
@@ -675,6 +672,11 @@ export async function runCommandReply(
flushPendingTool,
TOOL_RESULT_DEBOUNCE_MS,
);
return;
}
if (msg.role === "assistant") {
streamAssistantFinal(msg as AssistantMessage);
}
}