chore: version up to 2.80.35 and package with experience memory

This commit is contained in:
g1nation
2026-05-12 23:23:23 +09:00
parent 065e598cca
commit f6b27a125b
25 changed files with 1088 additions and 103 deletions
+17
View File
@@ -252,3 +252,20 @@ export function truncationNotice(kind: GenerationStopKind): string {
return '';
}
}
/**
* Some local engines report `maxPredictedTokensReached` even when the visible
* answer is short (for example after an internal retry or SDK stats mismatch).
* Only show the "answer was cut off" notice when the generated answer actually
* consumed most of the output budget.
*/
export function shouldShowTruncationNotice(
kind: GenerationStopKind,
outputTokens: number,
maxOutputTokens: number
): boolean {
if (kind === 'context-overflow' || kind === 'error') return true;
if (kind !== 'output-limit') return false;
const threshold = Math.max(128, Math.floor(maxOutputTokens * 0.85));
return outputTokens >= threshold;
}