Skip to content

Commit 39ea1c7

Browse files
authored
fix(shared): remove inactive maxTokens config since 1.0 (#2545)
maxTokens stopped affecting AI requests in the 1.0 refactor. Remove the stale env variables, docs, parsing, and tests.
1 parent 6a53603 commit 39ea1c7

11 files changed

Lines changed: 0 additions & 177 deletions

File tree

apps/site/docs/en/model-config.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ If you configure a dedicated Insight or Planning model, model-related `MIDSCENE_
4343
|------|-------------|
4444
| `MIDSCENE_MODEL_TIMEOUT` | Hard timeout for AI API calls in milliseconds (default intent). Defaults to `180000` (180s). Set to `0` to disable the hard timeout and let the request run indefinitely (only a caller-provided `AbortSignal` will cancel it). Note: Midscene controls the full request lifetime, not just the time until the first response header arrives, so stalled body reads can still be terminated cleanly |
4545
| `MIDSCENE_MODEL_TEMPERATURE` | Sampling temperature for model responses |
46-
| `MIDSCENE_MODEL_MAX_TOKENS` | `max_tokens` for responses, default 2048 |
4746
| `MIDSCENE_MODEL_RETRY_COUNT` | Number of retries when AI call fails, default 1 (i.e., retry once after failure) |
4847
| `MIDSCENE_MODEL_RETRY_INTERVAL` | Interval between retries in milliseconds, default 2000 |
4948
| `MIDSCENE_MODEL_REASONING_ENABLED` | Enable or disable model-native reasoning/thinking. Set to `"true"` or `"false"`. For supported model families, Midscene disables model-native thinking by default when this variable is unset. See [Model-Native Thinking Mode](./model-strategy#model-native-thinking-mode). Explicit reasoning config requires a supported `MIDSCENE_MODEL_FAMILY` |
@@ -68,7 +67,6 @@ Set the following if the Insight intent needs a different model:
6867
| `MIDSCENE_INSIGHT_MODEL_BASE_URL` | API endpoint URL (omit the trailing `/chat/completion`) |
6968
| `MIDSCENE_INSIGHT_MODEL_NAME` | Model name |
7069
| `MIDSCENE_INSIGHT_MODEL_FAMILY` | Model family |
71-
| `MIDSCENE_INSIGHT_MODEL_MAX_TOKENS` | Optional; `max_tokens` for Insight intent responses |
7270
| `MIDSCENE_INSIGHT_MODEL_TIMEOUT` | Optional; timeout for Insight intent AI API calls in milliseconds |
7371
| `MIDSCENE_INSIGHT_MODEL_TEMPERATURE` | Optional; sampling temperature for Insight intent responses |
7472
| `MIDSCENE_INSIGHT_MODEL_RETRY_COUNT` | Optional; same effect as `MIDSCENE_MODEL_RETRY_COUNT` |
@@ -88,7 +86,6 @@ Set the following if the Planning intent needs a different model:
8886
| `MIDSCENE_PLANNING_MODEL_BASE_URL` | API endpoint URL (omit the trailing `/chat/completion`) |
8987
| `MIDSCENE_PLANNING_MODEL_NAME` | Model name |
9088
| `MIDSCENE_PLANNING_MODEL_FAMILY` | Model family |
91-
| `MIDSCENE_PLANNING_MODEL_MAX_TOKENS` | Optional; `max_tokens` for Planning intent responses |
9289
| `MIDSCENE_PLANNING_MODEL_TIMEOUT` | Optional; timeout for Planning intent AI API calls in milliseconds |
9390
| `MIDSCENE_PLANNING_MODEL_TEMPERATURE` | Optional; sampling temperature for Planning intent responses |
9491
| `MIDSCENE_PLANNING_MODEL_RETRY_COUNT` | Optional; same effect as `MIDSCENE_MODEL_RETRY_COUNT` |
@@ -133,7 +130,6 @@ The following environment variables are deprecated but still compatible. We reco
133130
| `MIDSCENE_OPENAI_INIT_CONFIG_JSON` | Deprecated but supported | Prefer `MIDSCENE_MODEL_INIT_CONFIG_JSON` |
134131
| `MIDSCENE_OPENAI_HTTP_PROXY` | Deprecated but supported | Prefer `MIDSCENE_MODEL_HTTP_PROXY` |
135132
| `MIDSCENE_OPENAI_SOCKS_PROXY` | Deprecated but supported | Prefer `MIDSCENE_MODEL_SOCKS_PROXY` |
136-
| `OPENAI_MAX_TOKENS` | Deprecated but supported | Prefer `MIDSCENE_MODEL_MAX_TOKENS` |
137133

138134
## Configure settings via JavaScript
139135

apps/site/docs/zh/model-config.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export MIDSCENE_MODEL_FAMILY="gpt-5"
4141
|------|-------------|
4242
| `MIDSCENE_MODEL_TIMEOUT` | AI 接口调用硬超时(毫秒,默认意图),默认 `180000`(180 秒)。设为 `0` 可禁用硬超时,只有调用方传入的 `AbortSignal` 能取消请求。说明:Midscene 控制的是完整请求生命周期,而不只是首个响应 header 返回的时间,因此即使响应体读取阶段卡住,也能被及时终止 |
4343
| `MIDSCENE_MODEL_TEMPERATURE` | 模型采样温度 |
44-
| `MIDSCENE_MODEL_MAX_TOKENS` | 模型响应的 max_tokens 数配置,默认是 2048 |
4544
| `MIDSCENE_MODEL_RETRY_COUNT` | AI 调用失败时的重试次数,默认 1(即失败后重试 1 次)|
4645
| `MIDSCENE_MODEL_RETRY_INTERVAL` | AI 调用重试间隔毫秒数,默认 2000 |
4746
| `MIDSCENE_MODEL_REASONING_ENABLED` | 开启或关闭模型原生推理/思考。设为 `"true"``"false"`。对于已适配的模型系列,如果不配置该变量,Midscene 会默认关闭模型原生思考。见[模型原生的思考模式](./model-strategy#模型原生的思考模式)。显式配置 reasoning 时必须使用已支持的 `MIDSCENE_MODEL_FAMILY` |
@@ -66,7 +65,6 @@ export MIDSCENE_MODEL_FAMILY="gpt-5"
6665
| `MIDSCENE_INSIGHT_MODEL_BASE_URL` | API 的接入 URL,常见以版本号结尾(如`/v1`);不需要编写最后的 `/chat/completion` 部分 |
6766
| `MIDSCENE_INSIGHT_MODEL_NAME` | 模型名称 |
6867
| `MIDSCENE_INSIGHT_MODEL_FAMILY` | 模型 family |
69-
| `MIDSCENE_INSIGHT_MODEL_MAX_TOKENS` | 可选,Insight 意图模型响应的 max_tokens 数配置 |
7068
| `MIDSCENE_INSIGHT_MODEL_TIMEOUT` | 可选,Insight 意图的 AI 接口调用超时时间(毫秒)|
7169
| `MIDSCENE_INSIGHT_MODEL_TEMPERATURE` | 可选,Insight 意图的模型采样温度 |
7270
| `MIDSCENE_INSIGHT_MODEL_RETRY_COUNT` | 可选,效果等同于 `MIDSCENE_MODEL_RETRY_COUNT` |
@@ -86,7 +84,6 @@ export MIDSCENE_MODEL_FAMILY="gpt-5"
8684
| `MIDSCENE_PLANNING_MODEL_BASE_URL` | API 的接入 URL,常见以版本号结尾(如`/v1`);不需要编写最后的 `/chat/completion` 部分 |
8785
| `MIDSCENE_PLANNING_MODEL_NAME` | 模型名称 |
8886
| `MIDSCENE_PLANNING_MODEL_FAMILY` | 模型 family |
89-
| `MIDSCENE_PLANNING_MODEL_MAX_TOKENS` | 可选,Planning 意图模型响应的 max_tokens 数配置 |
9087
| `MIDSCENE_PLANNING_MODEL_TIMEOUT` | 可选,Planning 意图的 AI 接口调用超时时间(毫秒)|
9188
| `MIDSCENE_PLANNING_MODEL_TEMPERATURE` | 可选,Planning 意图的模型采样温度 |
9289
| `MIDSCENE_PLANNING_MODEL_RETRY_COUNT` | 可选,效果等同于 `MIDSCENE_MODEL_RETRY_COUNT` |
@@ -133,7 +130,6 @@ export MIDSCENE_MODEL_FAMILY="gpt-5"
133130
| `MIDSCENE_OPENAI_INIT_CONFIG_JSON` | 已弃用但仍兼容 | 使用 `MIDSCENE_MODEL_INIT_CONFIG_JSON` |
134131
| `MIDSCENE_OPENAI_HTTP_PROXY` | 已弃用但仍兼容 | 使用 `MIDSCENE_MODEL_HTTP_PROXY` |
135132
| `MIDSCENE_OPENAI_SOCKS_PROXY` | 已弃用但仍兼容 | 使用 `MIDSCENE_MODEL_SOCKS_PROXY` |
136-
| `OPENAI_MAX_TOKENS` | 已弃用但仍兼容 | 使用 `MIDSCENE_MODEL_MAX_TOKENS` |
137133

138134
## 使用 JavaScript 配置参数
139135

packages/core/src/ai-model/service-caller/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ export async function callAI(
275275

276276
const extraBody = modelConfig.extraBody;
277277

278-
const maxTokens = modelConfig.maxTokens;
279278
const debugCall = getDebug('ai:call');
280279
const warnCall = getDebug('ai:call', { console: true });
281280
const debugProfileStats = getDebug('ai:profile:stats');
@@ -329,7 +328,6 @@ export async function callAI(
329328
const commonConfig = {
330329
temperature,
331330
stream: !!isStreaming,
332-
max_tokens: maxTokens,
333331
...(modelFamily === 'qwen2.5-vl' // qwen vl v2 specific config
334332
? {
335333
vl_high_resolution_images: true,

packages/core/tests/unit-test/agent-custom-model.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('Agent with custom OpenAI client', () => {
6565
"extraBody": undefined,
6666
"httpProxy": undefined,
6767
"intent": "default",
68-
"maxTokens": undefined,
6968
"modelDescription": "qwen2.5-vl mode",
7069
"modelFamily": "qwen2.5-vl",
7170
"modelName": "qwen2.5-vl-max",
@@ -94,7 +93,6 @@ describe('Agent with custom OpenAI client', () => {
9493
"extraBody": undefined,
9594
"httpProxy": undefined,
9695
"intent": "planning",
97-
"maxTokens": undefined,
9896
"modelDescription": "qwen2.5-vl mode",
9997
"modelFamily": "qwen2.5-vl",
10098
"modelName": "qwen2.5-vl-max",
@@ -123,7 +121,6 @@ describe('Agent with custom OpenAI client', () => {
123121
"extraBody": undefined,
124122
"httpProxy": undefined,
125123
"intent": "insight",
126-
"maxTokens": undefined,
127124
"modelDescription": "qwen2.5-vl mode",
128125
"modelFamily": "qwen2.5-vl",
129126
"modelName": "qwen2.5-vl-max",
@@ -164,7 +161,6 @@ describe('Agent with custom OpenAI client', () => {
164161
"extraBody": undefined,
165162
"httpProxy": undefined,
166163
"intent": "default",
167-
"maxTokens": undefined,
168164
"modelDescription": "qwen2.5-vl mode",
169165
"modelFamily": "qwen2.5-vl",
170166
"modelName": "qwen2.5-vl-max",
@@ -193,7 +189,6 @@ describe('Agent with custom OpenAI client', () => {
193189
"extraBody": undefined,
194190
"httpProxy": undefined,
195191
"intent": "planning",
196-
"maxTokens": undefined,
197192
"modelDescription": "",
198193
"modelFamily": undefined,
199194
"modelName": "gpt-5.1",
@@ -222,7 +217,6 @@ describe('Agent with custom OpenAI client', () => {
222217
"extraBody": undefined,
223218
"httpProxy": undefined,
224219
"intent": "insight",
225-
"maxTokens": undefined,
226220
"modelDescription": "",
227221
"modelFamily": undefined,
228222
"modelName": "model-for-insight",

packages/core/tests/unit-test/service-caller-timeout.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ describe('service-caller request timeout', () => {
157157
expect(lastCallOptions?.maxRetries).toBe(0);
158158
});
159159

160-
it('passes maxTokens from the resolved model config', async () => {
161-
const { callAI } = await import('@/ai-model/service-caller');
162-
163-
mockCreate.mockResolvedValue({
164-
choices: [{ message: { content: 'ok' } }],
165-
usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 },
166-
_request_id: 'req_max_tokens',
167-
});
168-
169-
await callAI(
170-
[{ role: 'user', content: 'hello' }],
171-
baseConfig({ maxTokens: 1234 }),
172-
);
173-
174-
const lastCreateBody = mockCreate.mock.calls.at(-1)?.[0];
175-
expect(lastCreateBody?.max_tokens).toBe(1234);
176-
});
177-
178160
it('retries after a hard timeout and returns the next successful response', async () => {
179161
const { callAI } = await import('@/ai-model/service-caller');
180162

packages/shared/src/env/constants.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
MIDSCENE_INSIGHT_MODEL_FAMILY,
66
MIDSCENE_INSIGHT_MODEL_HTTP_PROXY,
77
MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON,
8-
MIDSCENE_INSIGHT_MODEL_MAX_TOKENS,
98
MIDSCENE_INSIGHT_MODEL_NAME,
109
MIDSCENE_INSIGHT_MODEL_REASONING_BUDGET,
1110
MIDSCENE_INSIGHT_MODEL_REASONING_EFFORT,
@@ -21,7 +20,6 @@ import {
2120
MIDSCENE_MODEL_FAMILY,
2221
MIDSCENE_MODEL_HTTP_PROXY,
2322
MIDSCENE_MODEL_INIT_CONFIG_JSON,
24-
MIDSCENE_MODEL_MAX_TOKENS,
2523
MIDSCENE_MODEL_NAME,
2624
MIDSCENE_MODEL_REASONING_BUDGET,
2725
MIDSCENE_MODEL_REASONING_EFFORT,
@@ -40,7 +38,6 @@ import {
4038
MIDSCENE_PLANNING_MODEL_FAMILY,
4139
MIDSCENE_PLANNING_MODEL_HTTP_PROXY,
4240
MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON,
43-
MIDSCENE_PLANNING_MODEL_MAX_TOKENS,
4441
MIDSCENE_PLANNING_MODEL_NAME,
4542
MIDSCENE_PLANNING_MODEL_REASONING_BUDGET,
4643
MIDSCENE_PLANNING_MODEL_REASONING_EFFORT,
@@ -52,7 +49,6 @@ import {
5249
MIDSCENE_PLANNING_MODEL_TIMEOUT,
5350
OPENAI_API_KEY,
5451
OPENAI_BASE_URL,
55-
OPENAI_MAX_TOKENS,
5652
} from './types';
5753

5854
interface IModelConfigKeys {
@@ -69,7 +65,6 @@ interface IModelConfigKeys {
6965
openaiApiKey: string;
7066
openaiExtraConfig: string;
7167
extraBody: string;
72-
maxTokens: string;
7368
/**
7469
* Extra
7570
*/
@@ -106,7 +101,6 @@ export const INSIGHT_MODEL_CONFIG_KEYS: IModelConfigKeys = {
106101
openaiApiKey: MIDSCENE_INSIGHT_MODEL_API_KEY,
107102
openaiExtraConfig: MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON,
108103
extraBody: MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON,
109-
maxTokens: MIDSCENE_INSIGHT_MODEL_MAX_TOKENS,
110104
/**
111105
* Extra
112106
*/
@@ -143,7 +137,6 @@ export const PLANNING_MODEL_CONFIG_KEYS: IModelConfigKeys = {
143137
openaiApiKey: MIDSCENE_PLANNING_MODEL_API_KEY,
144138
openaiExtraConfig: MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON,
145139
extraBody: MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON,
146-
maxTokens: MIDSCENE_PLANNING_MODEL_MAX_TOKENS,
147140
/**
148141
* Extra
149142
*/
@@ -181,7 +174,6 @@ export const DEFAULT_MODEL_CONFIG_KEYS: IModelConfigKeys = {
181174
openaiApiKey: MIDSCENE_MODEL_API_KEY,
182175
openaiExtraConfig: MIDSCENE_MODEL_INIT_CONFIG_JSON,
183176
extraBody: MIDSCENE_MODEL_EXTRA_BODY_JSON,
184-
maxTokens: MIDSCENE_MODEL_MAX_TOKENS,
185177
/**
186178
* Extra
187179
*/
@@ -219,7 +211,6 @@ export const DEFAULT_MODEL_CONFIG_KEYS_LEGACY: IModelConfigKeys = {
219211
openaiApiKey: OPENAI_API_KEY,
220212
openaiExtraConfig: MIDSCENE_OPENAI_INIT_CONFIG_JSON,
221213
extraBody: MIDSCENE_MODEL_EXTRA_BODY_JSON,
222-
maxTokens: OPENAI_MAX_TOKENS,
223214
/**
224215
* Extra
225216
*/

packages/shared/src/env/parse-model-config.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
MODEL_FAMILY_VALUES,
1919
OPENAI_API_KEY,
2020
OPENAI_BASE_URL,
21-
OPENAI_MAX_TOKENS,
2221
type TIntent,
2322
type TModelFamily,
2423
UITarsModelVersion,
@@ -201,9 +200,6 @@ export const parseOpenaiSdkConfig = ({
201200
const legacyOpenaiExtraConfig = useLegacyLogic
202201
? provider[MIDSCENE_OPENAI_INIT_CONFIG_JSON]
203202
: undefined;
204-
const legacyMaxTokens = useLegacyLogic
205-
? provider[OPENAI_MAX_TOKENS]
206-
: undefined;
207203
const legacyModelFamily = useLegacyLogic
208204
? legacyConfigToModelFamily(provider)
209205
: undefined;
@@ -226,13 +222,6 @@ export const parseOpenaiSdkConfig = ({
226222
);
227223
const extraBodyStr: string | undefined = provider[keys.extraBody];
228224
const extraBody = parseJson(keys.extraBody, extraBodyStr);
229-
const maxTokensStr = provider[keys.maxTokens] || legacyMaxTokens;
230-
const maxTokens = (() => {
231-
const val = maxTokensStr?.trim();
232-
if (!val) return undefined;
233-
const num = Number(val);
234-
return Number.isFinite(num) ? num : undefined;
235-
})();
236225
const temperature = provider[keys.temperature]
237226
? Number(provider[keys.temperature])
238227
: 0;
@@ -250,7 +239,6 @@ export const parseOpenaiSdkConfig = ({
250239
openaiApiKey,
251240
openaiExtraConfig: normalizeOpenaiExtraConfig(openaiExtraConfig),
252241
extraBody,
253-
maxTokens,
254242
modelFamily,
255243
uiTarsModelVersion,
256244
modelName: modelName!,

packages/shared/src/env/types.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const MIDSCENE_MODEL_HTTP_PROXY = 'MIDSCENE_MODEL_HTTP_PROXY';
2424
// New primary names for public API
2525
export const MIDSCENE_MODEL_API_KEY = 'MIDSCENE_MODEL_API_KEY';
2626
export const MIDSCENE_MODEL_BASE_URL = 'MIDSCENE_MODEL_BASE_URL';
27-
export const MIDSCENE_MODEL_MAX_TOKENS = 'MIDSCENE_MODEL_MAX_TOKENS';
2827
export const MIDSCENE_MODEL_TIMEOUT = 'MIDSCENE_MODEL_TIMEOUT';
2928
export const MIDSCENE_MODEL_TEMPERATURE = 'MIDSCENE_MODEL_TEMPERATURE';
3029
export const MIDSCENE_MODEL_RETRY_COUNT = 'MIDSCENE_MODEL_RETRY_COUNT';
@@ -57,11 +56,6 @@ export const MIDSCENE_OPENAI_HTTP_PROXY = 'MIDSCENE_OPENAI_HTTP_PROXY';
5756
* @deprecated Use MIDSCENE_MODEL_SOCKS_PROXY instead. This is kept for backward compatibility.
5857
*/
5958
export const MIDSCENE_OPENAI_SOCKS_PROXY = 'MIDSCENE_OPENAI_SOCKS_PROXY';
60-
/**
61-
* @deprecated Use MIDSCENE_MODEL_MAX_TOKENS instead. This is kept for backward compatibility.
62-
*/
63-
export const OPENAI_MAX_TOKENS = 'OPENAI_MAX_TOKENS';
64-
6559
export const MIDSCENE_ADB_PATH = 'MIDSCENE_ADB_PATH';
6660
export const MIDSCENE_ADB_REMOTE_HOST = 'MIDSCENE_ADB_REMOTE_HOST';
6761
export const MIDSCENE_ADB_REMOTE_PORT = 'MIDSCENE_ADB_REMOTE_PORT';
@@ -106,8 +100,6 @@ export const MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON =
106100
'MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON';
107101
export const MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON =
108102
'MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON';
109-
export const MIDSCENE_INSIGHT_MODEL_MAX_TOKENS =
110-
'MIDSCENE_INSIGHT_MODEL_MAX_TOKENS';
111103
export const MIDSCENE_INSIGHT_MODEL_TIMEOUT = 'MIDSCENE_INSIGHT_MODEL_TIMEOUT';
112104
export const MIDSCENE_INSIGHT_MODEL_TEMPERATURE =
113105
'MIDSCENE_INSIGHT_MODEL_TEMPERATURE';
@@ -137,8 +129,6 @@ export const MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON =
137129
'MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON';
138130
export const MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON =
139131
'MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON';
140-
export const MIDSCENE_PLANNING_MODEL_MAX_TOKENS =
141-
'MIDSCENE_PLANNING_MODEL_MAX_TOKENS';
142132
export const MIDSCENE_PLANNING_MODEL_TIMEOUT =
143133
'MIDSCENE_PLANNING_MODEL_TIMEOUT';
144134
export const MIDSCENE_PLANNING_MODEL_TEMPERATURE =
@@ -225,7 +215,6 @@ export const MODEL_ENV_KEYS = [
225215
MIDSCENE_MODEL_BASE_URL,
226216
MIDSCENE_MODEL_SOCKS_PROXY,
227217
MIDSCENE_MODEL_HTTP_PROXY,
228-
MIDSCENE_MODEL_MAX_TOKENS,
229218
MIDSCENE_MODEL_TIMEOUT,
230219
MIDSCENE_MODEL_TEMPERATURE,
231220
MIDSCENE_MODEL_RETRY_COUNT,
@@ -242,7 +231,6 @@ export const MODEL_ENV_KEYS = [
242231
// model default legacy
243232
OPENAI_API_KEY,
244233
OPENAI_BASE_URL,
245-
OPENAI_MAX_TOKENS,
246234
MIDSCENE_OPENAI_INIT_CONFIG_JSON,
247235
MIDSCENE_OPENAI_HTTP_PROXY,
248236
MIDSCENE_OPENAI_SOCKS_PROXY,
@@ -254,7 +242,6 @@ export const MODEL_ENV_KEYS = [
254242
MIDSCENE_INSIGHT_MODEL_API_KEY,
255243
MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON,
256244
MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON,
257-
MIDSCENE_INSIGHT_MODEL_MAX_TOKENS,
258245
MIDSCENE_INSIGHT_MODEL_TIMEOUT,
259246
MIDSCENE_INSIGHT_MODEL_TEMPERATURE,
260247
MIDSCENE_INSIGHT_MODEL_RETRY_COUNT,
@@ -271,7 +258,6 @@ export const MODEL_ENV_KEYS = [
271258
MIDSCENE_PLANNING_MODEL_API_KEY,
272259
MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON,
273260
MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON,
274-
MIDSCENE_PLANNING_MODEL_MAX_TOKENS,
275261
MIDSCENE_PLANNING_MODEL_TIMEOUT,
276262
MIDSCENE_PLANNING_MODEL_TEMPERATURE,
277263
MIDSCENE_PLANNING_MODEL_RETRY_COUNT,
@@ -340,8 +326,6 @@ export interface IModelConfigForInsight {
340326
[MIDSCENE_INSIGHT_MODEL_API_KEY]?: string;
341327
[MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON]?: string;
342328
[MIDSCENE_INSIGHT_MODEL_EXTRA_BODY_JSON]?: string;
343-
// max tokens
344-
[MIDSCENE_INSIGHT_MODEL_MAX_TOKENS]?: string;
345329
// timeout
346330
[MIDSCENE_INSIGHT_MODEL_TIMEOUT]?: string;
347331
// temperature
@@ -361,8 +345,6 @@ export interface IModelConfigForPlanning {
361345
[MIDSCENE_PLANNING_MODEL_API_KEY]?: string;
362346
[MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON]?: string;
363347
[MIDSCENE_PLANNING_MODEL_EXTRA_BODY_JSON]?: string;
364-
// max tokens
365-
[MIDSCENE_PLANNING_MODEL_MAX_TOKENS]?: string;
366348
// timeout
367349
[MIDSCENE_PLANNING_MODEL_TIMEOUT]?: string;
368350
// temperature
@@ -390,8 +372,6 @@ export interface IModelConfigForDefault {
390372
[MIDSCENE_MODEL_API_KEY]?: string;
391373
[MIDSCENE_MODEL_INIT_CONFIG_JSON]?: string;
392374
[MIDSCENE_MODEL_EXTRA_BODY_JSON]?: string;
393-
// max tokens
394-
[MIDSCENE_MODEL_MAX_TOKENS]?: string;
395375
// extra
396376
[MIDSCENE_MODEL_FAMILY]?: TModelFamily;
397377
// temperature
@@ -414,7 +394,6 @@ export interface IModelConfigForDefaultLegacy {
414394
[OPENAI_BASE_URL]?: string;
415395
[OPENAI_API_KEY]?: string;
416396
[MIDSCENE_OPENAI_INIT_CONFIG_JSON]?: string;
417-
[OPENAI_MAX_TOKENS]?: string;
418397
}
419398

420399
/**
@@ -491,10 +470,6 @@ export interface IModelConfig {
491470
* Example: { "chat_template_kwargs": { "enable_thinking": true } }
492471
*/
493472
extraBody?: Record<string, unknown>;
494-
/**
495-
* max_tokens for model responses.
496-
*/
497-
maxTokens?: number;
498473
/**
499474
* Timeout for API calls in milliseconds.
500475
* If not set, uses OpenAI SDK default (10 minutes).

0 commit comments

Comments
 (0)