codex-model-change 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/cx.py +21 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ env_key = "DEEPSEEK_API_KEY"
|
|
|
85
85
|
wire_api = "responses"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
并把顶部改为 `model_provider = "deepseek"` / `model = "deepseek-
|
|
88
|
+
并把顶部改为 `model_provider = "deepseek"` / `model = "deepseek-flash"`,同时生成模型目录 `~/.codex/cx-catalog.json`。
|
|
89
89
|
|
|
90
90
|
**第 4 步:完成桌面 App 配置**(见下方「桌面 App 的一次性配置」),然后完全退出并重开 App。
|
|
91
91
|
|
|
@@ -147,9 +147,9 @@ App 没读到 `DEEPSEEK_API_KEY`。执行上面「桌面 App 的一次性配置
|
|
|
147
147
|
|
|
148
148
|
- macOS(依赖 `launchctl` 做 GUI 环境变量注入;纯 CLI 使用则不依赖)
|
|
149
149
|
- Codex CLI / ChatGPT 桌面 App(内含 codex 的版本)
|
|
150
|
-
- DeepSeek `deepseek-
|
|
150
|
+
- DeepSeek `deepseek-flash`(V4.1,默认)/ `deepseek-v4-pro`(Responses API)
|
|
151
151
|
|
|
152
|
-
>
|
|
152
|
+
> 上下文:cx 生成的模型目录按官方 **1M** 窗口配置(`context_window = 1048576`、auto-compact 阈值 900K、最大输出 384K),对应官方 **DeepSeek-V4** 系列。V3.1 时代的 `deepseek-chat` / `deepseek-reasoner` 只有 128K 级,且已被服务端当作兼容别名静默指向 `deepseek-flash`;**cx 1.0.8 起不再使用这两个旧名**(如账号可用的模型名有变化,`cx doctor` 会告警)。
|
|
153
153
|
|
|
154
154
|
## License
|
|
155
155
|
|
package/cx.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"""
|
|
15
15
|
import json, os, re, glob, sqlite3, subprocess, sys, shutil, time, urllib.request, urllib.error
|
|
16
16
|
|
|
17
|
-
CX_VERSION = "1.0.
|
|
17
|
+
CX_VERSION = "1.0.8"
|
|
18
18
|
|
|
19
19
|
CODEX_HOME = os.environ.get("CODEX_HOME", os.path.expanduser("~/.codex"))
|
|
20
20
|
CONFIG = os.path.join(CODEX_HOME, "config.toml")
|
|
@@ -24,7 +24,7 @@ CATALOG = os.path.join(CODEX_HOME, "cx-catalog.json")
|
|
|
24
24
|
CODEX_BIN = "/opt/homebrew/bin/codex"
|
|
25
25
|
APP_PGREP = "/Applications/ChatGPT.app/Contents/MacOS/ChatGPT"
|
|
26
26
|
|
|
27
|
-
DS_MODEL = "deepseek-chat
|
|
27
|
+
DS_MODEL = "deepseek-flash" # V4.1-Flash;旧的 deepseek-chat/deepseek-reasoner 已被服务端别名到它,不再使用
|
|
28
28
|
DS_PROVIDER_BLOCK = """
|
|
29
29
|
# --- added by cx (direct deepseek) ---
|
|
30
30
|
[model_providers.deepseek]
|
|
@@ -61,6 +61,7 @@ HELP = """cx — Codex 模型直连切换器
|
|
|
61
61
|
def err(m): print("❌ " + m); sys.exit(1)
|
|
62
62
|
def ok(m): print("✅ " + m)
|
|
63
63
|
def info(m): print("ℹ️ " + m)
|
|
64
|
+
def warn(m): print("⚠️ " + m)
|
|
64
65
|
|
|
65
66
|
def read_cfg():
|
|
66
67
|
if not os.path.exists(CONFIG): err(f"找不到 {CONFIG}")
|
|
@@ -78,7 +79,7 @@ def load_key():
|
|
|
78
79
|
return open(KEY_FILE).read().strip() or None
|
|
79
80
|
|
|
80
81
|
# ---------- 目录文件 ----------
|
|
81
|
-
def _ds_entry(slug, name, desc, priority):
|
|
82
|
+
def _ds_entry(slug, name, desc, priority, ctx=1048576, compact=900000):
|
|
82
83
|
return {
|
|
83
84
|
"slug": slug, "display_name": name, "description": desc,
|
|
84
85
|
"default_reasoning_level": "high",
|
|
@@ -99,21 +100,19 @@ def _ds_entry(slug, name, desc, priority):
|
|
|
99
100
|
"supports_search_tool": False, "tool_mode": "default",
|
|
100
101
|
"node_repl_disabled": True, "node_repl_auto_review_required": False,
|
|
101
102
|
"include_plugin_usage_instructions": False, "include_apps_usage_instructions": False,
|
|
102
|
-
"supports_reasoning_summaries": False, "context_window":
|
|
103
|
-
"max_context_window":
|
|
103
|
+
"supports_reasoning_summaries": False, "context_window": ctx,
|
|
104
|
+
"max_context_window": ctx, "auto_compact_token_limit": compact,
|
|
104
105
|
"auto_review_model_override": None,
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
CATALOG_MODELS = [
|
|
108
|
-
_ds_entry("deepseek-
|
|
109
|
-
_ds_entry("deepseek-
|
|
109
|
+
_ds_entry("deepseek-flash", "DeepSeek Flash", "DeepSeek 直连 (deepseek-flash / V4.1, 1M 上下文)。", 5),
|
|
110
|
+
_ds_entry("deepseek-v4-pro", "DeepSeek V4 Pro", "DeepSeek 直连 (deepseek-v4-pro, 1M 上下文)。", 4),
|
|
110
111
|
]
|
|
111
112
|
for slug in ("gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4"):
|
|
112
|
-
e = _ds_entry(slug, slug, slug, 1)
|
|
113
|
+
e = _ds_entry(slug, slug, slug, 1, ctx=400000, compact=360000)
|
|
113
114
|
e["visibility"] = "hide"
|
|
114
115
|
e["input_modalities"] = ["text", "image"]
|
|
115
|
-
e["context_window"] = e["max_context_window"] = 400000
|
|
116
|
-
e["auto_compact_token_limit"] = 360000
|
|
117
116
|
e["supports_reasoning_summaries"] = True
|
|
118
117
|
CATALOG_MODELS.append(e)
|
|
119
118
|
|
|
@@ -291,7 +290,18 @@ def cmd_doctor():
|
|
|
291
290
|
req = urllib.request.Request("https://api.deepseek.com/v1/models",
|
|
292
291
|
headers={"Authorization": f"Bearer {key}"})
|
|
293
292
|
try:
|
|
294
|
-
urllib.request.urlopen(req, timeout=10)
|
|
293
|
+
with urllib.request.urlopen(req, timeout=10) as r:
|
|
294
|
+
ids = [m.get("id") for m in json.load(r).get("data", []) if m.get("id")]
|
|
295
|
+
ok("deepseek API 直连: key 有效")
|
|
296
|
+
if ids:
|
|
297
|
+
info("账号可用模型: " + ", ".join(ids))
|
|
298
|
+
gone = [m["slug"] for m in CATALOG_MODELS
|
|
299
|
+
if m.get("slug", "").startswith("deepseek") and m["slug"] not in ids]
|
|
300
|
+
if gone:
|
|
301
|
+
warn("模型目录里这些名字已不在账号可用列表: " + ", ".join(gone)
|
|
302
|
+
+ " (运行 cx use deepseek 重建目录,或升级 cx)")
|
|
303
|
+
else:
|
|
304
|
+
ok("模型目录中的 deepseek 模型名均可用")
|
|
295
305
|
except urllib.error.HTTPError as e:
|
|
296
306
|
err(f"deepseek API 返回 {e.code}(key 可能无效)")
|
|
297
307
|
except Exception as e:
|
package/package.json
CHANGED