fix: fix broken when SSE

This commit is contained in:
Henry Li
2026-01-16 23:15:53 +08:00
parent d5b3052cda
commit 16a5ed9a73
3 changed files with 16 additions and 16 deletions

View File

@@ -159,9 +159,12 @@ export function extractPresentFilesFromMessage(message: Message) {
if (message.type !== "ai" || !hasPresentFiles(message)) {
return [];
}
const files = [];
const files: string[] = [];
for (const toolCall of message.tool_calls ?? []) {
if (toolCall.name === "present_files") {
if (
toolCall.name === "present_files" &&
Array.isArray(toolCall.args.filepaths)
) {
files.push(...(toolCall.args.filepaths as string[]));
}
}