mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 03:01:50 +03:00
test(config): cover maxTokens clamping
This commit is contained in:
@@ -215,7 +215,6 @@ export function applyModelDefaults(cfg: OpenClawConfig): OpenClawConfig {
|
||||
}
|
||||
|
||||
const defaultMaxTokens = Math.min(DEFAULT_MODEL_MAX_TOKENS, contextWindow);
|
||||
// Clamp maxTokens to contextWindow to prevent invalid configurations
|
||||
const rawMaxTokens = isPositiveNumber(raw.maxTokens) ? raw.maxTokens : defaultMaxTokens;
|
||||
const maxTokens = Math.min(rawMaxTokens, contextWindow);
|
||||
if (raw.maxTokens !== maxTokens) {
|
||||
|
||||
Reference in New Issue
Block a user