@@ -6,12 +6,13 @@ import {
|
6 | 6 | applyCustomApiConfig, |
7 | 7 | buildAnthropicVerificationProbeRequest, |
8 | 8 | buildOpenAiVerificationProbeRequest, |
9 | | -CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
10 | 9 | inferCustomModelSupportsImageInput, |
11 | 10 | parseNonInteractiveCustomApiFlags, |
12 | 11 | resolveCustomModelImageInputInference, |
13 | 12 | } from "./onboard-custom-config.js"; |
14 | 13 | |
| 14 | +const EXPECTED_CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS = 128_000; |
| 15 | + |
15 | 16 | function buildCustomProviderConfig(contextWindow?: number) { |
16 | 17 | if (contextWindow === undefined) { |
17 | 18 | return {} as OpenClawConfig; |
@@ -129,17 +130,17 @@ describe("applyCustomApiConfig", () => {
|
129 | 130 | { |
130 | 131 | name: "uses stable default context window for newly added custom models", |
131 | 132 | existingContextWindow: undefined, |
132 | | -expectedContextWindow: CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
| 133 | +expectedContextWindow: EXPECTED_CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
133 | 134 | }, |
134 | 135 | { |
135 | 136 | name: "upgrades existing custom model context window when below hard minimum", |
136 | 137 | existingContextWindow: 2048, |
137 | | -expectedContextWindow: CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
| 138 | +expectedContextWindow: EXPECTED_CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
138 | 139 | }, |
139 | 140 | { |
140 | 141 | name: "raises legacy generated hard-min context window (#79428)", |
141 | 142 | existingContextWindow: CONTEXT_WINDOW_HARD_MIN_TOKENS, |
142 | | -expectedContextWindow: CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
| 143 | +expectedContextWindow: EXPECTED_CUSTOM_PROVIDER_DEFAULT_CONTEXT_WINDOW_TOKENS, |
143 | 144 | }, |
144 | 145 | { |
145 | 146 | name: "preserves explicit small context window when already valid", |
|