Reuse validation costs when fitting and batching

This commit is contained in:
2026-11-10 20:45:38 +00:00
parent c16d61e091
commit a9b7c37a7e
7 changed files with 267 additions and 33 deletions

View File

@@ -142,7 +142,8 @@ payload token estimate. If one enriched item exceeds the configured limit, optio
neighbors are removed from the end first, then glossary entries from the end,
until it fits or only required candidate data remains. Required before/after text
is never truncated. Existing oversized-candidate handling still applies if that
required data does not fit. Context is supplemental, not a promise that every
required data does not fit. The built-in estimator reuses encoded fragment
counts for fitting and batching. Context is supplemental, not a promise that every
relevant definition or neighboring utterance always fits. This uses the existing
payload estimator, not a new guarantee about the provider's full context window.