From 121104e13d3d253fcb5dcf893d2023a86409732a Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Thu, 5 Mar 2026 16:59:08 +0800 Subject: [PATCH] feat: truncate llms.txt results --- packages/core/src/utils/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index 3da5340..b740be1 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -72,11 +72,15 @@ export async function fetchLlmsTxt(url: string): Promise { if (res.ok) { result = await res.text() console.log(chalk.green(`[llms.txt] Found (${result.length} chars)`)) + if (result.length > 1000) { + console.log(chalk.yellow(`[llms.txt] Truncating to 1000 chars`)) + result = truncate(result, 1000) + } } else { - console.log(chalk.gray(`[llms.txt] ${res.status} for ${endpoint}`)) + console.debug(chalk.gray(`[llms.txt] ${res.status} for ${endpoint}`)) } } catch (e) { - console.log(chalk.gray(`[llms.txt] Failed for ${endpoint}`), e) + console.debug(chalk.gray(`[llms.txt] not found for ${endpoint}`), e) } llmsTxtCache.set(origin, result) return result