fix: 单独的web_fetch调用也不再截断内容,返回完整网页

This commit is contained in:
thzxx
2026-06-12 14:31:22 +08:00
parent 1000a6b525
commit 0f20540666
-3
View File
@@ -236,9 +236,6 @@ function formatToolResultForModel(toolName: string, result: ToolResult): string
case 'web_fetch': {
let content = (result.content as string) || '';
// 截断过长内容,避免撑爆上下文
const webFetchMax = TOOL_MAX_RESULT_SIZE['web_fetch'] || 20000;
if (content.length > webFetchMax) content = content.slice(0, webFetchMax) + '\n... (已截断)';
return JSON.stringify({ success: true, url: result.url, content });
}