fix(AI): add truncation DEBUG log

This commit is contained in:
Jake Turner 2026-05-16 06:09:39 +00:00 committed by Jake Turner
parent 2dec5bf676
commit e3b758f11e
1 changed files with 12 additions and 0 deletions

View File

@ -500,6 +500,18 @@ export class OllamaService {
? s.slice(0, OllamaService.EMBED_MAX_INPUT_CHARS)
: s
)
const truncatedCount = input.reduce(
(n, s) => (s.length > OllamaService.EMBED_MAX_INPUT_CHARS ? n + 1 : n),
0
)
if (truncatedCount > 0) {
logger.debug(
'[OllamaService] embed: pre-capped %d/%d inputs at %d chars',
truncatedCount,
input.length,
OllamaService.EMBED_MAX_INPUT_CHARS
)
}
try {
// Prefer Ollama native endpoint (supports batch input natively).