@pure01fx/dsh-openai-codex-auth 0.7.1 → 0.7.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/CHANGELOG.md +7 -0
- package/README.md +2 -0
- package/lib/responses.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.7.2
|
|
6
|
+
|
|
7
|
+
### Auxiliary-call compatibility
|
|
8
|
+
|
|
9
|
+
- Accepts DSH's purpose-tagged compaction and session-title `maxTokens` budgets without serializing an unsupported Native Codex output-cap field, while ordinary model calls continue to reject unsupported explicit caps.
|
|
10
|
+
- Restores automatic compaction for long Native Codex sessions that previously accumulated failed `compaction/end` events.
|
|
11
|
+
|
|
5
12
|
## 0.7.1
|
|
6
13
|
|
|
7
14
|
### Native stream compatibility
|
package/README.md
CHANGED
|
@@ -187,6 +187,8 @@ $DSH_HOME/openai-codex-auth.json
|
|
|
187
187
|
|
|
188
188
|
本包只定义 Codex Provider,不发布或改写任何具体 Profile。整合包必须在挂载本插件前释放已有的 `openai-codex` route,例如从自己的 `llm-pi-ai` provider map 中移除该项;本包不会清空未知的 sibling providers。只想复用 OAuth/UI 并继续使用外部 Provider 的组合可以显式设置 `nativeAdapter: false`。从 pi-ai 切到 Native 时,旧 foreign replay 会降级为可见持久历史;反向切回 pi-ai 后,已产生 Native replay 的进行中 session 不保证可续跑,应新建 session。
|
|
189
189
|
|
|
190
|
+
上游 Native Codex Responses 请求没有输出 token 上限字段,因此普通会话若显式设置 `maxTokens` 仍会在 Provider I/O 前失败。DSH 的压缩与会话标题辅助调用会固定携带 `maxTokens`,并分别通过 `purpose: compaction` 与 `purpose: session-title` 标识;本适配器允许这两类 hint 通过,但不会把它序列化为 `max_output_tokens`,实际输出长度仍由 Native Codex 决定。
|
|
191
|
+
|
|
190
192
|
原生 route 默认使用 Responses WebSocket v2,在会话首个请求上执行 `generate: false` prewarm,并仅在请求历史严格延伸时发送 `previous_response_id` 与增量后缀。连接重建会清除增量链;纯 WebSocket/HTTP 连接建立失败不消耗普通 stream retry 预算,而是按 Codex 的网络恢复策略从 5 秒指数退避到 60 秒并持续等待成功或取消,因此可跨越半分钟断网。连接已经建立后的首个 DSH chunk 前错误仍使用默认 5 次 stream retry 与 200ms 起步的有界指数退避,安全重试耗尽或握手返回 HTTP 426 后,该 DSH 会话会确定性地回退到 HTTP/SSE。transport 层在任何 DSH chunk 已输出后仍不会直接重放原始 stream;它会把瞬态中断重新分类为只允许 durable failed-step 恢复的错误,标准 Agent Profile 中的 `dsh-llm-retry` 再按默认 5 次策略重建请求。该外层策略不会再次匹配 transport 已在首个 chunk 前耗尽的有限 stream 错误,避免两层预算相乘;失败 attempt 的原始事件可以留作非 surface 诊断,但不会组装成模型可见的持久 assistant message。未加载该恢复插件的直接 `ctx.llm.stream()` 调用在首个 chunk 后仍保持 single-attempt,避免重复输出。WebSocket `codex.rate_limits` 事件、握手/错误 metadata 以及 HTTP/SSE response headers 中的 `x-codex-*` quota 会被边界校验后直接写入 Host 用量缓存;额外 metered limit 不会覆盖默认 `codex` 套餐卡片。`response.completed.usage_metadata.amount` 会按原始高精度字符串保留,并作为当前账号的最近响应观测出现在 status JSON 中。
|
|
191
193
|
|
|
192
194
|
`<base>-fast` 只是公开选择别名:wire model 仍是 `<base>`,请求携带 `service_tier: priority`。若账号目录不声明 priority 能力,或请求前账号 authority 已改变,Fast 会直接失败,不会静默降级。Reasoning 选择在 adapter 边界按上游规则转换:`persistent` 在线上请求中写为 `disabled`;`ultra` 优先使用 Catalog 的 `multi_agent_reasoning_effort`,否则回退到 `max`、最高非 Ultra 档或 `medium`。
|
package/lib/responses.js
CHANGED
|
@@ -132,7 +132,12 @@ function assertSupportedOptions(options) {
|
|
|
132
132
|
if (options.temperature !== undefined) {
|
|
133
133
|
throw fixedError('native Codex does not support temperature', 'UNSUPPORTED');
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
// DSH's compaction and title helpers always carry a bounded output budget, but
|
|
136
|
+
// Codex's native Responses wire has no corresponding request field. Accept the
|
|
137
|
+
// hint only for those purpose-tagged auxiliary calls and leave it off the wire.
|
|
138
|
+
if (options.maxTokens !== undefined
|
|
139
|
+
&& options.purpose !== 'compaction'
|
|
140
|
+
&& options.purpose !== 'session-title') {
|
|
136
141
|
throw fixedError('native Codex does not support maxTokens', 'UNSUPPORTED');
|
|
137
142
|
}
|
|
138
143
|
if (options.stop !== undefined) {
|
package/package.json
CHANGED