Don't log tool cancellation as error (#291797)

Fix #291096
This commit is contained in:
Rob Lourens
2026-01-30 05:10:27 +00:00
committed by GitHub
parent 40e01fce60
commit 968b908772
@@ -557,7 +557,9 @@ export class LanguageModelToolsService extends Disposable implements ILanguageMo
prepareTimeMs: prepareTimeWatch?.elapsed(),
invocationTimeMs: invocationTimeWatch?.elapsed(),
});
this._logService.error(`[LanguageModelToolsService#invokeTool] Error from tool ${dto.toolId} with parameters ${JSON.stringify(dto.parameters)}:\n${toErrorMessage(err, true)}`);
if (!isCancellationError(err)) {
this._logService.error(`[LanguageModelToolsService#invokeTool] Error from tool ${dto.toolId} with parameters ${JSON.stringify(dto.parameters)}:\n${toErrorMessage(err, true)}`);
}
toolResult ??= { content: [] };
toolResult.toolResultError = err instanceof Error ? err.message : String(err);