This commit is contained in:
kim
2026-05-10 12:00:01 +09:00
parent 82bda7409e
commit c26f9b431b
155 changed files with 5923 additions and 4073 deletions
+11 -7
View File
@@ -4575,7 +4575,17 @@ function renderFileDownloads(steps, processEntries) {
return urls;
}
// Collect /api/files/ URLs from this message's own data only (not global log)
// Pre-mark URLs already present in msg.content so tool-result duplicates are suppressed.
// renderMarkdown() handles content links — we must not render a second button for the same URL.
if (arguments.length > 2 && arguments[2]) {
const contentText = String(arguments[2]);
if (contentText.indexOf('/api/files/') !== -1) {
for (const u of extractUrls(contentText)) seenUrls.add(u);
URL_RE.lastIndex = 0;
}
}
// Collect /api/files/ URLs from tool results only (not content — already handled above)
const allUrls = [];
// 1. msg.steps (legacy step events)
@@ -4594,12 +4604,6 @@ function renderFileDownloads(steps, processEntries) {
}
}
// 3. msg.content itself (LLM may include the link in its reply)
if (arguments.length > 2 && arguments[2]) {
const contentText = String(arguments[2]);
if (contentText.indexOf('/api/files/') !== -1) allUrls.push(...extractUrls(contentText));
}
for (const rawUrl of allUrls) {
if (seenUrls.has(rawUrl)) continue;
seenUrls.add(rawUrl);