You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(env): add backward compatibility for MIDSCENE_OPENAI_* environment variables (#1388)
Add backward compatibility support for legacy MIDSCENE_OPENAI_* environment variables:
- MIDSCENE_OPENAI_INIT_CONFIG_JSON (now MIDSCENE_MODEL_INIT_CONFIG_JSON)
- MIDSCENE_OPENAI_HTTP_PROXY (now MIDSCENE_MODEL_HTTP_PROXY)
- MIDSCENE_OPENAI_SOCKS_PROXY (now MIDSCENE_MODEL_SOCKS_PROXY)
Changes:
- Add deprecated constants to types.ts with @deprecated tags
- Add legacy variables to MODEL_ENV_KEYS for overrideAIConfig support
- Update DEFAULT_MODEL_CONFIG_KEYS_LEGACY to use legacy variable names
- Implement priority fallback logic in decide-model-config.ts (new variables take precedence)
- Update documentation (zh/en model-provider.mdx) with deprecation notices
All 139 tests pass, confirming backward compatibility works correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>
Copy file name to clipboardExpand all lines: apps/site/docs/en/model-provider.mdx
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,12 @@ Some advanced configs are also supported. Usually you don't need to use them.
45
45
46
46
| Name | Description |
47
47
|------|-------------|
48
-
|`MIDSCENE_OPENAI_INIT_CONFIG_JSON`| Optional. Custom JSON config for OpenAI SDK initialization |
49
-
|`MIDSCENE_OPENAI_HTTP_PROXY`| Optional. HTTP/HTTPS proxy configuration (e.g. `http://127.0.0.1:8080` or `https://proxy.example.com:8080`). This option has higher priority than `MIDSCENE_OPENAI_SOCKS_PROXY`|
|`MIDSCENE_MODEL_HTTP_PROXY`| Optional (recommended). HTTP/HTTPS proxy configuration (e.g. `http://127.0.0.1:8080` or `https://proxy.example.com:8080`). This option has higher priority than `MIDSCENE_MODEL_SOCKS_PROXY`|
|`MIDSCENE_OPENAI_INIT_CONFIG_JSON`| Deprecated but still compatible. Recommended to use `MIDSCENE_MODEL_INIT_CONFIG_JSON`|
52
+
|`MIDSCENE_OPENAI_HTTP_PROXY`| Deprecated but still compatible. Recommended to use `MIDSCENE_MODEL_HTTP_PROXY`|
53
+
|`MIDSCENE_OPENAI_SOCKS_PROXY`| Deprecated but still compatible. Recommended to use `MIDSCENE_MODEL_SOCKS_PROXY`|
51
54
|`MIDSCENE_PREFERRED_LANGUAGE`| Optional. The preferred language for the model response. The default is `Chinese` if the current timezone is GMT+8 and `English` otherwise. |
52
55
|`MIDSCENE_REPLANNING_CYCLE_LIMIT`| Optional. The maximum number of replanning cycles, default is 10 |
53
56
|`OPENAI_MAX_TOKENS`| Optional. Maximum tokens for model response, default is 2048 |
0 commit comments