@classicicn/codex-transfer 0.3.1 → 0.3.2
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.en.md +5 -5
- package/README.md +5 -5
- package/dist/codex-transfer.mjs +6 -6
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -48,7 +48,7 @@ Options:
|
|
|
48
48
|
-m, --model MODEL Force override model name (highest priority)
|
|
49
49
|
-c, --config PATH Path to config file (JSON)
|
|
50
50
|
-k, --insecure Skip TLS certificate verification
|
|
51
|
-
--
|
|
51
|
+
--reasoning-effort Send reasoning effort to upstream (default: off)
|
|
52
52
|
-d, --daemon Run in background, logs to logs/ directory
|
|
53
53
|
-h, --help Show this help
|
|
54
54
|
```
|
|
@@ -91,7 +91,7 @@ Create a JSON config file at one of these locations (searched in order):
|
|
|
91
91
|
"upstream": "https://api.deepseek.com/v1",
|
|
92
92
|
"apiKey": "sk-your-key-here",
|
|
93
93
|
"insecure": false,
|
|
94
|
-
"reasoningEffort":
|
|
94
|
+
"reasoningEffort": false,
|
|
95
95
|
"modelMap": {
|
|
96
96
|
"*": "deepseek-v4-pro",
|
|
97
97
|
"codex-auto-review": "deepseek-v4-pro"
|
|
@@ -108,7 +108,7 @@ Create a JSON config file at one of these locations (searched in order):
|
|
|
108
108
|
| `CODEX_TRANSFER_API_KEY` | _(empty)_ | API key forwarded to upstream |
|
|
109
109
|
| `CODEX_TRANSFER_CONFIG` | _(auto)_ | Path to config file |
|
|
110
110
|
| `CODEX_TRANSFER_INSECURE` | `false` | Set to `"1"` or `"true"` to skip TLS verification |
|
|
111
|
-
| `CODEX_TRANSFER_REASONING_EFFORT` | `
|
|
111
|
+
| `CODEX_TRANSFER_REASONING_EFFORT` | `false` | Set to `"1"` or `"true"` to enable sending reasoning_effort |
|
|
112
112
|
|
|
113
113
|
### Model Name Mapping
|
|
114
114
|
|
|
@@ -211,7 +211,7 @@ Codex CLI controls model reasoning intensity via `reasoning.effort` (none/low/me
|
|
|
211
211
|
| High | `high` | `thinking: {type: "enabled"}, reasoning_effort: "high"` | `thinking: {type: "enabled"}` |
|
|
212
212
|
| Ultra | `xhigh` | `thinking: {type: "enabled"}, reasoning_effort: "max"` | `thinking: {type: "enabled"}` |
|
|
213
213
|
|
|
214
|
-
**Compatibility strategy**: The `thinking` toggle is always sent (supported by all providers). `reasoning_effort` is sent by default (
|
|
214
|
+
**Compatibility strategy**: The `thinking` toggle is always sent (supported by all providers). `reasoning_effort` is not sent by default (to avoid 400 errors from incompatible providers); to enable it, use the `--reasoning-effort` CLI flag or `"reasoningEffort": true` in the config file.
|
|
215
215
|
|
|
216
216
|
### Session Management
|
|
217
217
|
|
|
@@ -380,7 +380,7 @@ const { app, port } = createTransfer({
|
|
|
380
380
|
- **Token usage**: Extract usage from upstream streaming responses — Codex now correctly displays context utilization (fixes 0% display issue)
|
|
381
381
|
- **Usage details**: Auto-map `cached_tokens` and `reasoning_tokens`, compatible with both OpenAI and DeepSeek upstream formats
|
|
382
382
|
- **Reasoning effort**: Map `reasoning.effort` to DeepSeek `thinking`/`reasoning_effort` and MiMo/Kimi/GLM `thinking` toggle
|
|
383
|
-
- **Config-driven control**:
|
|
383
|
+
- **Config-driven control**: `reasoning_effort` is off by default; enable via `--reasoning-effort` or `reasoningEffort` config option
|
|
384
384
|
|
|
385
385
|
### v0.2.0 (2026-05-07)
|
|
386
386
|
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ codex-transfer [options]
|
|
|
48
48
|
-m, --model MODEL 强制覆盖模型名称(最高优先级)
|
|
49
49
|
-c, --config PATH 配置文件路径(JSON 格式)
|
|
50
50
|
-k, --insecure 跳过 TLS 证书验证(企业代理/自签证书场景)
|
|
51
|
-
--
|
|
51
|
+
--reasoning-effort 向上游传递 reasoning_effort 参数(默认关闭)
|
|
52
52
|
-d, --daemon 后台运行,日志写入 logs/ 目录
|
|
53
53
|
-h, --help 显示帮助信息
|
|
54
54
|
```
|
|
@@ -91,7 +91,7 @@ CLI 参数 > 环境变量 > 配置文件 > 默认值
|
|
|
91
91
|
"upstream": "https://api.deepseek.com/v1",
|
|
92
92
|
"apiKey": "sk-your-key-here",
|
|
93
93
|
"insecure": false,
|
|
94
|
-
"reasoningEffort":
|
|
94
|
+
"reasoningEffort": false,
|
|
95
95
|
"modelMap": {
|
|
96
96
|
"*": "deepseek-v4-pro",
|
|
97
97
|
"codex-auto-review": "deepseek-v4-pro"
|
|
@@ -108,7 +108,7 @@ CLI 参数 > 环境变量 > 配置文件 > 默认值
|
|
|
108
108
|
| `CODEX_TRANSFER_API_KEY` | _(空)_ | 转发给上游的 API Key |
|
|
109
109
|
| `CODEX_TRANSFER_CONFIG` | _(自动)_ | 配置文件路径 |
|
|
110
110
|
| `CODEX_TRANSFER_INSECURE` | `false` | 设为 `"1"` 或 `"true"` 跳过 TLS 验证 |
|
|
111
|
-
| `CODEX_TRANSFER_REASONING_EFFORT` | `
|
|
111
|
+
| `CODEX_TRANSFER_REASONING_EFFORT` | `false` | 设为 `"1"` 或 `"true"` 开启 reasoning_effort 传递 |
|
|
112
112
|
|
|
113
113
|
### 模型名称映射
|
|
114
114
|
|
|
@@ -211,7 +211,7 @@ Codex CLI 通过 `reasoning.effort` 控制模型推理强度(极低/低/中/
|
|
|
211
211
|
| 高 | `high` | `thinking: {type: "enabled"}, reasoning_effort: "high"` | `thinking: {type: "enabled"}` |
|
|
212
212
|
| 超高 | `xhigh` | `thinking: {type: "enabled"}, reasoning_effort: "max"` | `thinking: {type: "enabled"}` |
|
|
213
213
|
|
|
214
|
-
**兼容策略**:`thinking` 参数始终发送(所有厂商支持)。`reasoning_effort`
|
|
214
|
+
**兼容策略**:`thinking` 参数始终发送(所有厂商支持)。`reasoning_effort` 默认不发送(避免不兼容的上游返回 400 错误);如需启用,可通过 `--reasoning-effort` CLI 参数或配置文件 `"reasoningEffort": true` 开启。
|
|
215
215
|
|
|
216
216
|
### 会话管理
|
|
217
217
|
|
|
@@ -380,7 +380,7 @@ const { app, port } = createTransfer({
|
|
|
380
380
|
- **Token 用量**:从上游流式响应中提取 usage,Codex 可正确显示上下文占用率(修复 0% 问题)
|
|
381
381
|
- **用量详情**:自动映射 `cached_tokens` 和 `reasoning_tokens`,兼容 OpenAI 和 DeepSeek 两种上游格式
|
|
382
382
|
- **推理强度**:映射 `reasoning.effort` 到 DeepSeek `thinking`/`reasoning_effort`、MiMo/Kimi/GLM `thinking` 开关
|
|
383
|
-
-
|
|
383
|
+
- **配置化控制**:`reasoning_effort` 默认关闭,可通过 `--reasoning-effort` 或 `reasoningEffort` 配置项按需开启
|
|
384
384
|
|
|
385
385
|
### v0.2.0 (2026-05-07)
|
|
386
386
|
|
package/dist/codex-transfer.mjs
CHANGED
|
@@ -3417,7 +3417,7 @@ var DEFAULT_CONFIG = {
|
|
|
3417
3417
|
apiKey: "",
|
|
3418
3418
|
insecure: false,
|
|
3419
3419
|
modelMap: {},
|
|
3420
|
-
reasoningEffort:
|
|
3420
|
+
reasoningEffort: false
|
|
3421
3421
|
};
|
|
3422
3422
|
function loadConfig(configPath) {
|
|
3423
3423
|
const fileConfig = loadConfigFile(configPath);
|
|
@@ -3430,7 +3430,7 @@ function loadConfig(configPath) {
|
|
|
3430
3430
|
),
|
|
3431
3431
|
modelMap: fileConfig.modelMap ?? DEFAULT_CONFIG.modelMap,
|
|
3432
3432
|
reasoningEffort: parseBool(
|
|
3433
|
-
process.env.CODEX_TRANSFER_REASONING_EFFORT ?? fileConfig.reasoningEffort ??
|
|
3433
|
+
process.env.CODEX_TRANSFER_REASONING_EFFORT ?? fileConfig.reasoningEffort ?? false
|
|
3434
3434
|
)
|
|
3435
3435
|
};
|
|
3436
3436
|
}
|
|
@@ -3674,8 +3674,8 @@ for (let i = 0; i < args.length; i++) {
|
|
|
3674
3674
|
overrides.configPath = args[++i];
|
|
3675
3675
|
} else if ((a === "--model" || a === "-m") && args[i + 1]) {
|
|
3676
3676
|
overrides.model = args[++i];
|
|
3677
|
-
} else if (a === "--
|
|
3678
|
-
overrides.reasoningEffort = "
|
|
3677
|
+
} else if (a === "--reasoning-effort") {
|
|
3678
|
+
overrides.reasoningEffort = "true";
|
|
3679
3679
|
} else if (a === "--help" || a === "-h") {
|
|
3680
3680
|
console.log(`
|
|
3681
3681
|
codex-transfer \u2014 Responses API \u2194 Chat Completions bridge
|
|
@@ -3690,7 +3690,7 @@ Options:
|
|
|
3690
3690
|
-m, --model MODEL Override model name (highest priority model mapping)
|
|
3691
3691
|
-c, --config PATH Path to config file (JSON)
|
|
3692
3692
|
-k, --insecure Skip TLS certificate verification
|
|
3693
|
-
--
|
|
3693
|
+
--reasoning-effort Send reasoning effort to upstream (default: off)
|
|
3694
3694
|
-d, --daemon Run in background, logs to logs/ directory
|
|
3695
3695
|
-h, --help Show this help
|
|
3696
3696
|
|
|
@@ -3700,7 +3700,7 @@ Environment variables:
|
|
|
3700
3700
|
CODEX_TRANSFER_API_KEY Same as --api-key
|
|
3701
3701
|
CODEX_TRANSFER_CONFIG Same as --config
|
|
3702
3702
|
CODEX_TRANSFER_INSECURE Set to "1" to skip TLS verification
|
|
3703
|
-
CODEX_TRANSFER_REASONING_EFFORT Set to "
|
|
3703
|
+
CODEX_TRANSFER_REASONING_EFFORT Set to "1" to enable reasoning_effort
|
|
3704
3704
|
|
|
3705
3705
|
Config file options:
|
|
3706
3706
|
modelMap Model name mapping, e.g. {"*": "deepseek-v4-pro"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classicicn/codex-transfer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Responses API ↔ Chat Completions translation bridge for Codex — use DeepSeek, Kimi, Qwen, and other providers with Codex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/codex-transfer.mjs",
|