v2.6.2
This commit is contained in:
+11
-7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user