fix(token-meter): reject stale config (round 2)

This commit is contained in:
Hypatia May
2026-07-16 13:23:20 +08:00
parent 5c243e8a8d
commit 19a56ec542
9 changed files with 110 additions and 34 deletions

View File

@@ -163,6 +163,8 @@ describe('compact configuration and defaults', () => {
[{ thresholdRatio: 1.1 }, /number in \(0, 1\]/],
[{ retainTokens: -1 }, /non-negative integer/],
[{ thresholdRatio: 0.5, retainTokens: 500 }, /less than threshold/],
[{ models: { [MODEL]: { retainTokens: 10 } } }, /BasicCompactConfig: unknown key "models"/],
[{ thresholdRato: 0.5 }, /BasicCompactConfig: unknown key "thresholdRato"/],
] as Array<[unknown, RegExp]>
for (const [config, pattern] of bad) {