fix: 自动抓取不再截断,保留完整网页内容

This commit is contained in:
thzxx
2026-06-12 14:30:42 +08:00
parent 38a8ae90d2
commit 1000a6b525
+2 -2
View File
@@ -785,9 +785,9 @@ async function applyAutoFetch(result: ToolResult, fetchTop: number): Promise<Too
const fetched: Array<{ url: string; title: string; content: string }> = []; const fetched: Array<{ url: string; title: string; content: string }> = [];
for (const r of toFetch) { for (const r of toFetch) {
try { try {
const fetchResult = await handleWebFetch({ url: r.url, max_chars: 5000, retry: false }); const fetchResult = await handleWebFetch({ url: r.url, retry: false });
if (fetchResult.success && fetchResult.content) { if (fetchResult.success && fetchResult.content) {
fetched.push({ url: r.url, title: r.title, content: String(fetchResult.content).slice(0, 5000) }); fetched.push({ url: r.url, title: r.title, content: String(fetchResult.content) });
} }
} catch { /* skip failed fetch */ } } catch { /* skip failed fetch */ }
} }