dsh-lcx-codex 0.4.0 → 0.4.1-pre.1
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 +6 -0
- package/README.md +120 -178
- package/README_EN.md +126 -108
- package/assets/dsh-lcx-codex-banner.jpg +0 -0
- package/lib/compact-v2.js +129 -16
- package/lib/dsh-compat.js +124 -0
- package/lib/index.js +126 -92
- package/lib/native-checkpoint.js +241 -22
- package/lib/route.js +174 -12
- package/lib/token-budget.js +165 -0
- package/lib/web-search-alpha.js +148 -7
- package/lib/web-search-capability.js +5 -3
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1-pre.1 - Candidate QA pending / not published
|
|
4
|
+
|
|
5
|
+
- Integrates the accepted Alpha stateful continuation and fail-closed capability work from #20, #21, and #22.
|
|
6
|
+
- Includes accepted compatibility seam isolation (#24), typed protocol-core hardening (#25), unified conservative token budgeting (#26), and the installed-plugin settings lifecycle fix (#36).
|
|
7
|
+
- This is an unpublished candidate for #19 installed-candidate and cross-feature QA; no npm publication, tag, or release is implied.
|
|
8
|
+
|
|
3
9
|
## 0.4.0 - 2026-08-23
|
|
4
10
|
|
|
5
11
|
### Stable promotion
|
package/README.md
CHANGED
|
@@ -1,211 +1,170 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="
|
|
4
|
-
|
|
5
|
-
# DSH-LCX-CODEX
|
|
6
|
-
|
|
7
|
-
**给 DeepSeek Harness 补上 GPT Responses / Codex 原生能力。**
|
|
3
|
+
<img src="assets/dsh-lcx-codex-banner.png" alt="dsh-lcx-codex — 为 DSH 增加 GPT Hosted Search、Codex 风格网页操作与 Native V2 Compaction" width="100%" />
|
|
8
4
|
|
|
9
5
|
[](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
10
|
-
](https://github.com/kk3ya03-star/dsh-lcx-codex/actions/workflows/publish.yml)
|
|
11
7
|

|
|
12
|
-

|
|
9
|
+

|
|
13
10
|
|
|
14
|
-
**简体中文** · [English](README_EN.md)
|
|
11
|
+
**简体中文** · [English](README_EN.md) · [Architecture](ARCHITECTURE.md) · [Changelog](CHANGELOG.md)
|
|
15
12
|
|
|
16
13
|
</div>
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`dsh-lcx-codex` 是一个社区维护的 DSH 插件,面向已经通过 `llm-pi-ai / openai-responses` 接入的 GPT 路由。它尽量复用 DSH 自己的 Agent、Web、Session 和 Compaction 架构,只在缺少 OpenAI/Codex 原生语义的地方补能力。
|
|
15
|
+
> **DSH 仍然是 host。LCX 只补齐 GPT Responses 路径缺失的原生能力,不修改 DSH 核心,也不替换 Agent / Session / Web / Compaction。**
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
## 它解决什么
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
如果你的 DSH 已经有一个可工作的 GPT `openai-responses` route,`dsh-lcx-codex` 让这条 route 更完整地使用 GPT Responses 原生能力,同时尽量保持 DSH 原有入口和生命周期不变。
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
| 场景 | DSH 原有入口 | LCX 增强后 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| 普通联网搜索 | DSH `web_search` | **仍然使用同一个 `web_search`**,由 LCX SearchProvider 映射到当前 GPT Hosted Search |
|
|
24
|
+
| Hosted Search 高级参数 | 普通搜索入口保持简洁 | 按需增加 `websearch_gpt_advanced`,提供域名过滤、近似位置、search context、图片搜索等 |
|
|
25
|
+
| 连续网页 / PDF 浏览 | DSH 继续拥有 Web 生命周期 | 按需增加 Codex / Alpha Web Actions:`search → open → find/click → screenshot` |
|
|
26
|
+
| 长会话压缩 | DSH 继续负责 pressure、事务与 recovery | 在现有 compaction seam 上优先请求 Responses Native V2 checkpoint |
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|---|---|---:|
|
|
30
|
-
| **DSH 原生 `web_search` → GPT Hosted Search** | 不新增重复的普通搜索工具;rc.7+ 自动跟随当前 Agent 的 GPT Responses 模型 | 可开启 |
|
|
31
|
-
| **Advanced Hosted Search** | 域名过滤、location、search context、图片搜索等 OpenAI Hosted 参数 | 关闭 |
|
|
32
|
-
| **Alpha Search** | `search/open/find/click/screenshot` 等 Codex/Alpha 风格命令;能力探针通过后才注册 | 关闭 |
|
|
33
|
-
| **Native Remote Compaction V2** | 通过 Responses `compaction_trigger` 获取 provider-native opaque checkpoint | 可开启 |
|
|
34
|
-
| **Conversation fidelity retention** | 显式保留 bounded user / assistant 可见事实,避免只记得“问过什么”却忘记“答了什么” | 内置 |
|
|
35
|
-
| **Session-native checkpoint** | checkpoint 存在 DSH append-only session log,不再以 sidecar 作为新会话真相源 | 内置 |
|
|
36
|
-
| **Native-first 自动压缩** | 90% 主动 Native V2,95% emergency 才允许 DSH prune;阈值可调 | 可开启 |
|
|
37
|
-
| **长搜索超时** | DSH `web_search` 外层 timeout 默认提升到 240 秒,可调 30–600 秒 | 内置 |
|
|
28
|
+
**目标不是再造一套 Agent,而是让 DSH 的 GPT route 用上它本来就应该拥有的原生能力。**
|
|
38
29
|
|
|
39
|
-
##
|
|
30
|
+
## 三大能力
|
|
40
31
|
|
|
41
|
-
|
|
32
|
+
### 1. GPT Hosted Search:普通搜索不换入口
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```text
|
|
46
|
-
Agent: lcx / gpt-5.6-luna
|
|
47
|
-
│
|
|
48
|
-
└─ DSH web_search
|
|
49
|
-
│
|
|
50
|
-
└─ Hosted Search: lcx / gpt-5.6-luna
|
|
51
|
-
|
|
52
|
-
Agent: lcx / gpt-5.6-sol
|
|
53
|
-
│
|
|
54
|
-
└─ DSH web_search
|
|
55
|
-
│
|
|
56
|
-
└─ Hosted Search: lcx / gpt-5.6-sol
|
|
57
|
-
```
|
|
34
|
+
启用后,模型看到的普通搜索工具依然是 DSH 原生 `web_search`。LCX 替换的是 SearchProvider 路径,而不是再注册一个重复的“普通搜索”工具。
|
|
58
35
|
|
|
59
|
-
|
|
36
|
+
需要更细控制时,再单独启用 `websearch_gpt_advanced`。
|
|
60
37
|
|
|
61
|
-
|
|
38
|
+
### 2. Codex 风格 Web Actions:需要时再打开
|
|
62
39
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Hosted Search 是一笔独立 Responses 请求,不等于主会话推理。rc.8 继续给搜索使用独立 cache namespace:
|
|
40
|
+
`websearch_alpha` 面向连续浏览和结构化 Web action:
|
|
66
41
|
|
|
67
42
|
```text
|
|
68
|
-
|
|
69
|
-
Hosted Search: dsh-lcx-search:<route hash>
|
|
43
|
+
search → open → find / click → screenshot
|
|
70
44
|
```
|
|
71
45
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
## Native V2 Compaction
|
|
46
|
+
它默认关闭,并且只有当前 endpoint / provider / model / schema 通过 capability probe 后才注册。未知部署采用 **fail-closed**,不会被误报成“支持 Alpha”。
|
|
75
47
|
|
|
76
|
-
DSH
|
|
48
|
+
### 3. Native V2 Compaction:保留 DSH 会话语义
|
|
77
49
|
|
|
78
|
-
-
|
|
79
|
-
- compactable range selection;
|
|
80
|
-
- tool-result pruning;
|
|
81
|
-
- durable session transaction;
|
|
82
|
-
- `/compact`;
|
|
83
|
-
- context-overflow recovery。
|
|
50
|
+
LCX 不创建第二套 compaction engine。DSH 仍然拥有 pressure、compactable range、`/compact`、durable session transaction、tool-result pruning 与 overflow recovery;LCX 只在已有 compaction LLM seam 上请求 Responses Native V2。
|
|
84
51
|
|
|
85
|
-
|
|
52
|
+
默认自动策略:
|
|
86
53
|
|
|
87
54
|
```text
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
│
|
|
92
|
-
└─ POST /responses
|
|
93
|
-
x-codex-beta-features: remote_compaction_v2
|
|
94
|
-
input: [...history, { type: "compaction_trigger" }]
|
|
55
|
+
0% ─────────────────── 90% ───── 95% ───── 100%
|
|
56
|
+
normal Native emergency hard cap
|
|
57
|
+
V2 DSH prune
|
|
95
58
|
```
|
|
96
59
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
## 为什么压缩后还能记住模型自己说过的话
|
|
60
|
+
- **90%**:优先尝试 Native V2。
|
|
61
|
+
- **95%**:才允许 emergency DSH prune。
|
|
62
|
+
- provider-confirmed context overflow:继续使用 DSH 原有恢复逻辑。
|
|
63
|
+
- 手动 `/compact`:继续使用 DSH 原生会话事务。
|
|
102
64
|
|
|
103
|
-
|
|
65
|
+
同一 source session 可以继续复用自己的 Native checkpoint;fork 或模型迁移不会跨 session 发送 parent 的 opaque state,而是走 portable migration;重启后从 DSH session log 恢复。
|
|
104
66
|
|
|
105
|
-
|
|
106
|
-
- 搜索后模型给出的具体姓名;
|
|
107
|
-
- 只在 assistant 最终回答里出现的数字。
|
|
67
|
+
## 30 秒开始使用
|
|
108
68
|
|
|
109
|
-
|
|
69
|
+
### 1. 安装
|
|
110
70
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
+ opaque Native V2 compaction item
|
|
71
|
+
```powershell
|
|
72
|
+
dsh plugin --profile web add dsh-lcx-codex
|
|
73
|
+
dsh web
|
|
115
74
|
```
|
|
116
75
|
|
|
117
|
-
|
|
76
|
+
### 2. 在 DSH Settings 启用
|
|
118
77
|
|
|
119
|
-
|
|
78
|
+
第一次使用建议从最小配置开始:
|
|
120
79
|
|
|
121
|
-
|
|
80
|
+
| 设置 | 建议 |
|
|
81
|
+
|---|---:|
|
|
82
|
+
| Enable plugin | **On** |
|
|
83
|
+
| Use GPT Hosted Search | 需要 GPT Hosted Search 时 **On** |
|
|
84
|
+
| Advanced Hosted Search | **Off**,需要高级参数再开 |
|
|
85
|
+
| Alpha Search | **Off**,确认当前 route 支持后再开 |
|
|
86
|
+
| Native V2 remote compaction | 上游实际支持 Native V2 时 **On** |
|
|
87
|
+
| Native-first auto compaction | 使用 Native V2 时 **On** |
|
|
122
88
|
|
|
123
|
-
|
|
89
|
+
**前提条件**
|
|
124
90
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
V2 DSH prune
|
|
129
|
-
```
|
|
91
|
+
- Node.js `>=20`
|
|
92
|
+
- DSH 中已有可工作的 GPT `openai-responses` route
|
|
93
|
+
- 上游 endpoint 实际支持你准备启用的 Hosted Search / Native V2 / Alpha 能力
|
|
130
94
|
|
|
131
|
-
|
|
95
|
+
### 3. 确认它真的生效
|
|
132
96
|
|
|
133
|
-
|
|
134
|
-
- `90%–95%`:优先 Native V2;
|
|
135
|
-
- `>= 95%`:允许 DSH replay-safe tool-result pruner 救场;
|
|
136
|
-
- provider 明确返回 context overflow:仍保留 DSH 原生 recovery;
|
|
137
|
-
- 手动 `/compact`:不受阈值影响。
|
|
97
|
+
不要只看开关是否打开,按能力检查实际行为:
|
|
138
98
|
|
|
139
|
-
|
|
99
|
+
| 能力 | 应看到什么 |
|
|
100
|
+
|---|---|
|
|
101
|
+
| GPT Hosted Search | 普通工具入口仍是 DSH `web_search`,实际请求走当前 GPT Responses route |
|
|
102
|
+
| Advanced Hosted | 启用后出现 `websearch_gpt_advanced`,高级参数可以单独控制 |
|
|
103
|
+
| Alpha Web Actions | 只有 capability probe 通过时才出现 `websearch_alpha` |
|
|
104
|
+
| Native V2 | compact 时出现 provider-native checkpoint 路径;普通 Basic Compaction 不会被伪装成 Native V2 成功 |
|
|
140
105
|
|
|
141
|
-
##
|
|
106
|
+
## 搜索工具怎么选
|
|
142
107
|
|
|
143
|
-
|
|
108
|
+
三个入口用途不同,**不需要全部开启**:
|
|
144
109
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
110
|
+
| 你要做什么 | 使用入口 | 适合场景 |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| 普通联网搜索 | DSH `web_search` | 找资料、查网页、一般检索 |
|
|
113
|
+
| 控制 Hosted Search 参数 | `websearch_gpt_advanced` | 域名 allow/block、近似位置、search context、图片搜索等 |
|
|
114
|
+
| 连续浏览网页或 PDF | `websearch_alpha` | `search/open/find/click/screenshot` 与结构化 Web actions |
|
|
150
115
|
|
|
151
|
-
|
|
116
|
+
## 它如何接入 DSH
|
|
152
117
|
|
|
153
118
|
```text
|
|
154
|
-
|
|
155
|
-
|
|
119
|
+
DSH Agent / Session / Web
|
|
120
|
+
├─ web_search ──────────> LCX SearchProvider ──> GPT Hosted Search
|
|
121
|
+
├─ Advanced / Alpha ────> LCX Web tools ───────> GPT Web actions
|
|
122
|
+
└─ compact / replay ────> LCX Native bridge ───> Responses Native V2
|
|
156
123
|
```
|
|
157
124
|
|
|
158
|
-
|
|
125
|
+
**DSH 是 host,LCX 是兼容扩展层。** 插件优先复用当前 DSH route 的 `baseURL`、credential reference、headers、模型与 retry policy,而不是维护第二套账号配置。
|
|
159
126
|
|
|
160
|
-
|
|
127
|
+
checkpoint、canonical replay、Pi serializer、cache identity、fork safety 与 pressure coordination 等实现细节见 [ARCHITECTURE.md](ARCHITECTURE.md)。
|
|
161
128
|
|
|
162
|
-
|
|
163
|
-
2. emergency tool-result pruning;
|
|
164
|
-
3. 换模型 / provider / baseURL;
|
|
165
|
-
4. DSH 自己发生其他 surface replacement。
|
|
129
|
+
## 兼容性
|
|
166
130
|
|
|
167
|
-
|
|
131
|
+
当前正式验证组合:
|
|
168
132
|
|
|
169
|
-
|
|
133
|
+
| Plugin | DSH | DSH host Pi | Plugin Pi | 状态 |
|
|
134
|
+
|---|---|---|---|---|
|
|
135
|
+
| `0.4.0` | `0.1.1-rc.2` | `0.82.1` | `0.82.1` | **VERIFIED** |
|
|
170
136
|
|
|
171
|
-
|
|
137
|
+
新的 DSH 版本**不会自动视为兼容**。项目会先检查受影响的 DSH / Pi seam,再按风险运行对应测试;Pi registry 单独出现新版本也不会自动升级插件依赖。
|
|
172
138
|
|
|
173
|
-
|
|
139
|
+
<details>
|
|
140
|
+
<summary><strong>完整推荐设置</strong></summary>
|
|
174
141
|
|
|
175
|
-
|
|
142
|
+
| 设置 | 推荐值 | 说明 |
|
|
143
|
+
|---|---:|---|
|
|
144
|
+
| Enable plugin | On | 启用插件 |
|
|
145
|
+
| Use GPT Hosted Search | 按需 | 让 DSH `web_search` 走 GPT Hosted Search |
|
|
146
|
+
| Advanced Hosted Search | Off | 需要高级 Hosted 参数时再开 |
|
|
147
|
+
| Alpha Search | Off | capability 验证后再开 |
|
|
148
|
+
| Native V2 remote compaction | On* | *上游 route 实际支持 Native V2 时 |
|
|
149
|
+
| Native-first auto compaction | On | 启用自动 pressure 策略 |
|
|
150
|
+
| Native threshold | 90% | 90% 开始优先 Native V2 |
|
|
151
|
+
| Emergency DSH prune | 95% | 95% 才允许 emergency prune |
|
|
152
|
+
| `web_search` timeout | 240 s | 避免长搜索被过早终止 |
|
|
176
153
|
|
|
177
|
-
|
|
154
|
+
主要配置字段:`remoteCompaction`、`autoCompaction`、`fallbackToBasicCompaction`、`autoCompactionThresholdPercent`、`emergencyPruneThresholdPercent`、`webSearchTimeoutSeconds`、`advancedHostedSearch`、`alphaSearch`。
|
|
178
155
|
|
|
179
|
-
|
|
180
|
-
- approximate user location;
|
|
181
|
-
- `search_context_size`;
|
|
182
|
-
- image search;
|
|
183
|
-
- external web access;
|
|
184
|
-
- return token budget。
|
|
156
|
+
</details>
|
|
185
157
|
|
|
186
|
-
|
|
158
|
+
<details>
|
|
159
|
+
<summary><strong>其他安装方式</strong></summary>
|
|
187
160
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
面向 stateful Codex/Alpha 风格搜索:`search/open/find/click/screenshot` 等。只有 capability probe 与当前 endpoint/provider/model/schema 匹配后才注册。
|
|
191
|
-
|
|
192
|
-
## 安装
|
|
193
|
-
|
|
194
|
-
### npm
|
|
195
|
-
|
|
196
|
-
稳定版:
|
|
197
|
-
|
|
198
|
-
```powershell
|
|
199
|
-
dsh plugin --profile web add dsh-lcx-codex
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
预发布版(当前 rc.8):
|
|
161
|
+
**预发布版**
|
|
203
162
|
|
|
204
163
|
```powershell
|
|
205
164
|
dsh plugin --profile web add dsh-lcx-codex@next
|
|
206
165
|
```
|
|
207
166
|
|
|
208
|
-
|
|
167
|
+
**本地 tarball**
|
|
209
168
|
|
|
210
169
|
```powershell
|
|
211
170
|
dsh plugin --profile web remove dsh-lcx-codex
|
|
@@ -213,49 +172,26 @@ dsh plugin --profile web add .\dsh-lcx-codex-0.4.0.tgz
|
|
|
213
172
|
dsh web
|
|
214
173
|
```
|
|
215
174
|
|
|
216
|
-
|
|
175
|
+
升级插件时,不要为了“清理”删除 DSH session 或 `$DSH_HOME/storages/lcx-codex/`。旧会话可能仍引用历史兼容数据。
|
|
217
176
|
|
|
218
|
-
|
|
177
|
+
</details>
|
|
219
178
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
Use GPT Hosted Search ✅
|
|
223
|
-
Advanced Hosted Search ❌
|
|
224
|
-
Alpha Search ❌
|
|
225
|
-
|
|
226
|
-
Native V2 remote compaction ✅
|
|
227
|
-
Native-first auto compaction ✅
|
|
228
|
-
Native threshold 90%
|
|
229
|
-
Emergency DSH prune 95%
|
|
230
|
-
web_search timeout 240s
|
|
231
|
-
```
|
|
179
|
+
<details>
|
|
180
|
+
<summary><strong>常见情况</strong></summary>
|
|
232
181
|
|
|
233
|
-
|
|
182
|
+
**`web_search` 没走 GPT Hosted Search**
|
|
183
|
+
确认插件和 Hosted Search 已启用,并且当前 Agent 能解析到兼容的 GPT `openai-responses` route。
|
|
234
184
|
|
|
235
|
-
|
|
185
|
+
**`websearch_alpha` 没出现**
|
|
186
|
+
这是预期的 fail-closed 行为。Alpha 必须对当前 route/schema 完成可信 capability probe 后才注册。
|
|
236
187
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- DSH 中已经能正常使用的 GPT `openai-responses` route
|
|
240
|
-
- upstream 实际支持你启用的 Hosted Search / Native V2 / Alpha 能力
|
|
241
|
-
|
|
242
|
-
典型路径:
|
|
243
|
-
|
|
244
|
-
```text
|
|
245
|
-
DSH → llm-pi-ai/openai-responses → Sub2API
|
|
246
|
-
DSH → llm-pi-ai/openai-responses → NewAPI → upstream
|
|
247
|
-
```
|
|
188
|
+
**Native V2 没有生效**
|
|
189
|
+
确认当前 GPT Responses endpoint 实际支持 `remote_compaction_v2`。插件不会把普通 Basic Compaction 假装成 Native V2 成功。
|
|
248
190
|
|
|
249
|
-
|
|
191
|
+
</details>
|
|
250
192
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
- npm stable:正式稳定版本
|
|
254
|
-
- npm `next`:`0.4.0-rc.*` 预发布测试版本
|
|
255
|
-
|
|
256
|
-
GitHub tag 与 `package.json` version 必须一致;Trusted Publishing workflow 会先跑测试再发布。
|
|
257
|
-
|
|
258
|
-
## 开发
|
|
193
|
+
<details>
|
|
194
|
+
<summary><strong>开发</strong></summary>
|
|
259
195
|
|
|
260
196
|
```bash
|
|
261
197
|
npm test
|
|
@@ -263,8 +199,14 @@ npm run test:schema
|
|
|
263
199
|
npm pack --ignore-scripts
|
|
264
200
|
```
|
|
265
201
|
|
|
266
|
-
|
|
202
|
+
- 设计与协议细节:[ARCHITECTURE.md](ARCHITECTURE.md)
|
|
203
|
+
- 版本变化:[CHANGELOG.md](CHANGELOG.md)
|
|
204
|
+
- npm:[`dsh-lcx-codex`](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
205
|
+
|
|
206
|
+
</details>
|
|
267
207
|
|
|
268
208
|
## License
|
|
269
209
|
|
|
270
210
|
MIT
|
|
211
|
+
|
|
212
|
+
> `LCX` 只是项目名称。本项目是社区项目,不隶属于 OpenAI、DeepSeek、Sub2API 或 NewAPI。
|