From ac84beab07904d401f3cd76755376dc8d396aefb Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 27 Aug 2026 10:52:52 +0200 Subject: [PATCH] Improve web_fetch tool --- apps/api/src/services/fetch/fetch.service.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/api/src/services/fetch/fetch.service.ts b/apps/api/src/services/fetch/fetch.service.ts index a2e5276cf..1cf260ed3 100644 --- a/apps/api/src/services/fetch/fetch.service.ts +++ b/apps/api/src/services/fetch/fetch.service.ts @@ -173,9 +173,7 @@ export class FetchService implements OnModuleInit { try { JSON.parse(body); } catch { - if (!rejectedBody) { - rejectedBody = body; - } + rejectedBody = body; continue; } @@ -195,9 +193,9 @@ export class FetchService implements OnModuleInit { ); this.logger.debug( - `Web fetch tool response for ${this.redactUrl( - url - )}: ${this.getBodyPreview(rejectedBody)}` + `Web fetch tool response for ${this.redactUrl(url)} (${ + sources?.length ?? 0 + } sources): ${this.getBodyPreview(rejectedBody || text)}` ); return undefined;