test: close the coverage gaps the gate found

surface.replaceGeneration gets its direct-access test (the getter folds
a pending delta itself, not only via a nodes read); the reconstruction
theorem drives maxTokens and stop through the config waterfall; the
compact-basic envelope drops a dead conditional — config.maxTokens is
required and validated positive, so this backend's envelope always
carries the cap (the return type's optionality exists for overriding
subclasses).
This commit is contained in:
Tianyi Cui
2026-07-06 03:55:30 +08:00
parent c0808d5126
commit c58e5adee7
3 changed files with 28 additions and 6 deletions

View File

@@ -325,11 +325,10 @@ export class BasicCompactService extends CompactService {
throw new Error('summarization produced no text summary content')
}
return {
summary,
model: options.model,
...options.maxTokens !== undefined ? { maxTokens: options.maxTokens } : {},
}
// config.maxTokens is required and validated positive, so this backend's
// envelope always carries the cap; the return type's optionality exists
// for overriding subclasses whose summarizer has none.
return { summary, model: options.model, maxTokens: this.config.maxTokens }
}
// ---- Core API (implements the abstract contract) ----