dsh-lcx-codex 0.4.2-pre.1 → 0.4.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.md +177 -125
- package/README_EN.md +180 -116
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,68 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
# dsh-lcx-codex
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
6
4
|
[](https://github.com/kk3ya03-star/dsh-lcx-codex/actions/workflows/publish.yml)
|
|
7
5
|

|
|
8
|
-

|
|
7
|
+

|
|
9
8
|

|
|
10
9
|
|
|
11
|
-
**简体中文** · [English](README_EN.md) · [Architecture](ARCHITECTURE.md) · [Changelog](CHANGELOG.md)
|
|
10
|
+
**简体中文** · [English](README_EN.md) · [Architecture](ARCHITECTURE.md) · [Changelog](CHANGELOG.md) · [Releases](https://github.com/kk3ya03-star/dsh-lcx-codex/releases)
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
> **让 DSH 的 GPT Responses 会话从第一轮普通请求开始,到工具调用、Native V2 Compact / Replay、重启恢复和 GPT 模型切换,始终保持同一个最终 Responses wire owner。**
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
`dsh-lcx-codex` 不替换 DSH。DSH 仍负责 Agent、Session、模型选择、工具执行、附件和 compaction policy;当 **LCX ON** 时,LCX 接管当前 GPT Responses 会话的最终 request / SSE wire。
|
|
16
15
|
|
|
17
16
|
## 当前稳定版
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
**`0.4.2`** 是当前稳定版,也是已完成真实 DSH + Sub2API 验收的 `0.4.2-pre.1` 的 **zero-functional-change stable promotion**。
|
|
20
19
|
|
|
21
20
|
```powershell
|
|
22
21
|
dsh plugin --profile web add dsh-lcx-codex
|
|
23
22
|
dsh web
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
npm
|
|
25
|
+
- npm dist-tag:`latest`
|
|
26
|
+
- DSH:`0.1.1-rc.2`
|
|
27
|
+
- Plugin Pi:`0.84.3`
|
|
28
|
+
- Node.js:`^22.19.0 || >=24.0.0`
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
`0.4.2-pre.1` 保留为历史 prerelease;新用户直接安装 `latest` 即可。
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
## 产品约定
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| Hosted Search 高级参数 | 普通搜索入口保持简洁 | 按需增加 `websearch_gpt_advanced`,提供域名过滤、近似位置、search context、图片搜索等 |
|
|
36
|
-
| 连续网页 / PDF 浏览 | DSH 继续拥有 Web 生命周期 | 按需增加 Codex / Alpha Web Actions:`search → open → find/click → screenshot` |
|
|
37
|
-
| 长会话压缩 | DSH 继续负责 pressure、事务与 recovery | 在现有 compaction seam 上优先请求 Responses Native V2 checkpoint |
|
|
34
|
+
```text
|
|
35
|
+
LCX OFF
|
|
36
|
+
= 完全使用 DSH 原生 LLM 流程
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
LCX ON
|
|
39
|
+
= 当前 GPT Responses 会话从 ordinary turn 1 开始
|
|
40
|
+
由 LCX 持有最终 Responses request / SSE wire
|
|
41
|
+
```
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
切换 Claude、Gemini、DeepSeek 等非 GPT 模型前先关闭 LCX;模型切换本身不需要重启 DSH。
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
## 为什么需要 LCX
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
DSH 原本已经拥有 Agent、Session、Tools 和 compaction lifecycle。LCX 解决的是 GPT Responses provider-native 路径的最后一层一致性:ordinary、tools、Native Compact、Replay、restart/resume 和 GPT route migration 不再在同一个会话中切换最终 wire owner。
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
```text
|
|
50
|
+
DSH
|
|
51
|
+
Agent / Session / Tools
|
|
52
|
+
│
|
|
53
|
+
llm / stream seam
|
|
54
|
+
│
|
|
55
|
+
┌──────────┴──────────┐
|
|
56
|
+
│ │
|
|
57
|
+
LCX OFF LCX ON
|
|
58
|
+
│ │
|
|
59
|
+
native DSH adapter LCX Responses Core
|
|
60
|
+
│
|
|
61
|
+
ordinary turn 1
|
|
62
|
+
↓
|
|
63
|
+
tools
|
|
64
|
+
↓
|
|
65
|
+
Native V2 Compact
|
|
66
|
+
↓
|
|
67
|
+
Replay
|
|
68
|
+
↓
|
|
69
|
+
Restart / Resume
|
|
70
|
+
↓
|
|
71
|
+
GPT Model Migration
|
|
72
|
+
```
|
|
48
73
|
|
|
49
|
-
|
|
74
|
+
Compact 因此只改变 history representation,不再同时改变 request owner。
|
|
50
75
|
|
|
51
|
-
|
|
76
|
+
## 核心能力
|
|
52
77
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
78
|
+
### 1. Full GPT Responses lifecycle ownership
|
|
79
|
+
|
|
80
|
+
LCX ON 后,ordinary、tool continuation、Native Compact、Native Replay、restart/resume 和 portable GPT migration 使用同一套 LCX Responses request builder / transport owner。
|
|
81
|
+
|
|
82
|
+
DSH 仍是 canonical session/history owner;LCX 不创建第二套会话数据库,也不替换 DSH Tool Executor。
|
|
83
|
+
|
|
84
|
+
### 2. GPT-5.6 Prompt Cache
|
|
85
|
+
|
|
86
|
+
`0.4.2` 使用 GPT-5.6 当前 cache-options 路径,并保持同一会话的稳定 cache identity:
|
|
87
|
+
|
|
88
|
+
- 默认使用 implicit caching;
|
|
89
|
+
- 当前支持 route 发送 `prompt_cache_options.ttl = 30m`;
|
|
90
|
+
- 普通连续 turn / tool-heavy workload 可以复用已 warm 前缀;
|
|
91
|
+
- Native Compact 会按设计建立新的 history/cache epoch,旧未压缩前缀不会被承诺继续复用;
|
|
92
|
+
- 真实长会话中,稳定 topology 下 warm request 多次观察到接近完整前缀复用。
|
|
56
93
|
|
|
57
|
-
|
|
94
|
+
缓存命中由 provider、模型、请求前缀、工具 schema 和会话状态共同决定,不是固定性能承诺。
|
|
58
95
|
|
|
59
|
-
`0.
|
|
96
|
+
一个已确认的边界:运行中激活 skill 若改变顶层 tool schema,会发生一次 cache reset;新 tool topology 稳定后下一请求即可重新 warm。当前支持 route 会拒绝 content-level `prompt_cache_breakpoint`,而 DSH `0.1.1-rc.2` 也没有可靠的 dynamic-tool provenance,因此 `0.4.2` 保留一次安全 reset,而不靠猜测重写工具历史。
|
|
60
97
|
|
|
61
|
-
### 3. Native V2
|
|
98
|
+
### 3. Native V2 Compact + Replay
|
|
62
99
|
|
|
63
|
-
|
|
100
|
+
DSH 仍决定 **何时压缩、压缩范围、事务与 recovery**;LCX 只负责 provider-native Responses V2 wire。
|
|
64
101
|
|
|
65
|
-
|
|
102
|
+
默认 pressure coordination:
|
|
66
103
|
|
|
67
104
|
```text
|
|
68
105
|
0% ─────────────────── 90% ───── 95% ───── 100%
|
|
@@ -70,140 +107,156 @@ LCX 不创建第二套 compaction engine。DSH 仍然拥有 pressure、compactab
|
|
|
70
107
|
V2 DSH prune
|
|
71
108
|
```
|
|
72
109
|
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- provider-confirmed
|
|
76
|
-
-
|
|
110
|
+
- `90%`:优先 Native V2;
|
|
111
|
+
- `95%`:允许 DSH emergency tool-result prune;
|
|
112
|
+
- provider-confirmed overflow:继续交给 DSH recovery;
|
|
113
|
+
- manual `/compact`:仍使用 DSH 原生 compaction transaction。
|
|
77
114
|
|
|
78
|
-
|
|
115
|
+
Native checkpoint v5 会持久化 provider-native compaction state 与必要的可移植保留历史;同 session / compatible route 可 Native replay,不兼容 route 不会错误复用 opaque state。
|
|
79
116
|
|
|
80
|
-
|
|
117
|
+
### 4. Restart / Resume + GPT 热切换
|
|
81
118
|
|
|
82
|
-
|
|
119
|
+
同一个 DSH session 可以跨越:
|
|
83
120
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
121
|
+
```text
|
|
122
|
+
Terra
|
|
123
|
+
→ Compact
|
|
124
|
+
→ Replay
|
|
125
|
+
→ Restart DSH
|
|
126
|
+
→ Resume same session
|
|
127
|
+
→ Switch to Sol
|
|
128
|
+
→ Continue
|
|
129
|
+
```
|
|
90
130
|
|
|
91
|
-
|
|
131
|
+
compatible route/model 可恢复 Native opaque state;不兼容的 GPT model / route 会丢弃不安全 opaque state并重建 portable history,但仍保持 LCX Responses transport ownership。
|
|
92
132
|
|
|
93
|
-
|
|
133
|
+
### 5. Hosted Search + Stateful Web Actions
|
|
94
134
|
|
|
95
|
-
|
|
135
|
+
普通联网搜索仍使用 DSH 原生 `web_search`。LCX 可以把 SearchProvider 映射到当前 GPT Hosted Search,而不是再给模型暴露第二个普通搜索工具。
|
|
96
136
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
137
|
+
| 需求 | 使用入口 |
|
|
138
|
+
|---|---|
|
|
139
|
+
| 普通联网搜索 | DSH `web_search` |
|
|
140
|
+
| Hosted Search 高级参数 | `websearch_gpt_advanced` |
|
|
141
|
+
| 连续网页 / PDF 操作 | `websearch_alpha` |
|
|
101
142
|
|
|
102
|
-
|
|
143
|
+
Alpha 支持:
|
|
103
144
|
|
|
104
|
-
```
|
|
105
|
-
|
|
145
|
+
```text
|
|
146
|
+
search → open → find / click → screenshot
|
|
106
147
|
```
|
|
107
148
|
|
|
108
|
-
|
|
149
|
+
Alpha 默认关闭;只有当前 endpoint / provider / model / schema 通过 capability probe 后才注册。未知部署 fail-closed。
|
|
109
150
|
|
|
110
|
-
###
|
|
151
|
+
### 6. Pi 0.84.3 隔离升级
|
|
111
152
|
|
|
112
|
-
|
|
153
|
+
插件独立使用 `@earendil-works/pi-ai 0.84.3`,不 override DSH host:
|
|
113
154
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
| Use GPT Hosted Search | 需要 GPT Hosted Search 时 **On** |
|
|
118
|
-
| Advanced Hosted Search | **Off**,需要高级参数再开 |
|
|
119
|
-
| Alpha Search | **Off**,确认当前 route 支持后再开 |
|
|
120
|
-
| Native V2 remote compaction | 上游实际支持 Native V2 时 **On** |
|
|
121
|
-
| Native-first auto compaction | 使用 Native V2 时 **On** |
|
|
155
|
+
```text
|
|
156
|
+
DSH 0.1.1-rc.2
|
|
157
|
+
└─ host Pi 0.82.1 ← 不改
|
|
122
158
|
|
|
123
|
-
|
|
159
|
+
dsh-lcx-codex 0.4.2
|
|
160
|
+
└─ plugin Pi 0.84.3 ← 插件隔离依赖
|
|
161
|
+
```
|
|
124
162
|
|
|
125
|
-
|
|
126
|
-
- DSH 中已有可工作的 GPT `openai-responses` route
|
|
127
|
-
- 上游 endpoint 实际支持你准备启用的 Hosted Search / Native V2 / Alpha 能力
|
|
163
|
+
Pi 负责 canonical Responses message/tool serialization、reasoning、IDs、strict/grammar/custom tools、`additional_tools`、`tool_search`、namespace 和 stream semantics;LCX 不维护第二套通用 provider framework。
|
|
128
164
|
|
|
129
|
-
|
|
165
|
+
## 30 秒配置
|
|
130
166
|
|
|
131
|
-
|
|
132
|
-
|---|---|
|
|
133
|
-
| GPT Hosted Search | 普通工具入口仍是 DSH `web_search`,实际请求走当前 GPT Responses route |
|
|
134
|
-
| Advanced Hosted | 启用后出现 `websearch_gpt_advanced` |
|
|
135
|
-
| Alpha Web Actions | 只有 capability probe 通过时才出现 `websearch_alpha` |
|
|
136
|
-
| Native V2 | compact 时出现 provider-native checkpoint 路径;普通 Basic Compaction 不会被伪装成 Native V2 成功 |
|
|
167
|
+
### 前提条件
|
|
137
168
|
|
|
138
|
-
|
|
169
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
170
|
+
- DSH `0.1.1-rc.2`
|
|
171
|
+
- DSH 中已有可工作的 GPT Responses route
|
|
172
|
+
- 上游 endpoint 实际支持准备启用的 Hosted Search / Native V2 / Alpha 能力
|
|
139
173
|
|
|
140
|
-
|
|
141
|
-
|---|---|---|
|
|
142
|
-
| 普通联网搜索 | DSH `web_search` | 找资料、查网页、一般检索 |
|
|
143
|
-
| 控制 Hosted Search 参数 | `websearch_gpt_advanced` | 域名 allow/block、近似位置、search context、图片搜索等 |
|
|
144
|
-
| 连续浏览网页或 PDF | `websearch_alpha` | `search/open/find/click/screenshot` 与结构化 Web actions |
|
|
174
|
+
### 推荐初始设置
|
|
145
175
|
|
|
146
|
-
|
|
176
|
+
| 设置 | 推荐值 | 说明 |
|
|
177
|
+
|---|---:|---|
|
|
178
|
+
| Enable LCX | **On** | 接管当前 GPT Responses 会话 |
|
|
179
|
+
| Use GPT Hosted Search | 按需 | 让 DSH `web_search` 使用 GPT Hosted Search |
|
|
180
|
+
| Advanced Hosted Search | Off | 需要高级 Hosted 参数时再开 |
|
|
181
|
+
| Alpha Search | Off | capability probe 通过后再开 |
|
|
182
|
+
| Native-first auto compaction | On | 使用 Native-first pressure coordination |
|
|
183
|
+
| Native threshold | `90%` | 主动 Native V2 阈值 |
|
|
184
|
+
| Emergency DSH prune | `95%` | 紧急 prune 阈值 |
|
|
185
|
+
| Fallback to Basic Compaction | On | Native 首次失败时允许受控回退 |
|
|
186
|
+
| `web_search` timeout | `240s` | 避免较慢 Hosted Search 被过早中断 |
|
|
147
187
|
|
|
148
|
-
|
|
149
|
-
DSH Agent / Session / Web
|
|
150
|
-
├─ web_search ──────────> LCX SearchProvider ──> GPT Hosted Search
|
|
151
|
-
├─ Advanced / Alpha ────> LCX Web tools ───────> GPT Web actions
|
|
152
|
-
└─ compact / replay ────> LCX Native bridge ───> Responses Native V2
|
|
153
|
-
```
|
|
188
|
+
### 如何确认生效
|
|
154
189
|
|
|
155
|
-
|
|
190
|
+
| 能力 | 预期行为 |
|
|
191
|
+
|---|---|
|
|
192
|
+
| LCX ownership | LCX ON 后第一轮 GPT ordinary request 就进入 LCX Responses path |
|
|
193
|
+
| Prompt Cache | 稳定 warm turn 可出现 provider `cached_tokens` |
|
|
194
|
+
| Hosted Search | 普通入口仍是 DSH `web_search` |
|
|
195
|
+
| Advanced Hosted | 开启后出现 `websearch_gpt_advanced` |
|
|
196
|
+
| Alpha | capability probe 通过后才出现 `websearch_alpha` |
|
|
197
|
+
| Native V2 | Compact 产生 provider-native checkpoint,而不是把 Basic Compaction 伪装成 Native |
|
|
198
|
+
| Replay | Compact 后继续同一 DSH session;restart/resume 仍可续接 |
|
|
156
199
|
|
|
157
|
-
|
|
200
|
+
## DSH 与 LCX 的责任边界
|
|
158
201
|
|
|
159
|
-
|
|
202
|
+
| 组件 | 负责什么 |
|
|
203
|
+
|---|---|
|
|
204
|
+
| **DSH** | Agent loop、Session/history、GenerateOptions、模型/credential、工具执行、AttachmentStore、pressure policy、compaction transaction |
|
|
205
|
+
| **DSH compatibility seam** | 把 DSH message / GenerateOptions 投影到 Pi Context,并把结果桥接回 DSH |
|
|
206
|
+
| **Plugin Pi 0.84.3** | canonical Responses serialization / parser semantics |
|
|
207
|
+
| **LCX** | ON/OFF ownership、最终 Responses body + HTTP/SSE wire、ordinary/compact/replay orchestration、Native opaque state、Search capabilities |
|
|
208
|
+
|
|
209
|
+
更多 checkpoint、portable replay、cache identity、RefStore、pressure coordination 与 protocol 细节见 [ARCHITECTURE.md](ARCHITECTURE.md)。
|
|
160
210
|
|
|
161
|
-
|
|
211
|
+
## 兼容性
|
|
162
212
|
|
|
163
213
|
| Plugin | DSH | DSH host Pi | Plugin Pi | 状态 |
|
|
164
214
|
|---|---|---|---|---|
|
|
165
|
-
| `0.4.
|
|
215
|
+
| `0.4.2` | `0.1.1-rc.2` | `0.82.1` | `0.84.3` | **VERIFIED STABLE** |
|
|
216
|
+
| `0.4.1` | `0.1.1-rc.2` | `0.82.1` | `0.82.1` | historical stable |
|
|
166
217
|
|
|
167
|
-
`0.
|
|
218
|
+
DSH `0.1.2-alpha.1` 和更新的 Pi 版本目前不属于 `0.4.2` 的正式兼容性声明;后续会按受影响 seam 单独验证,而不是自动视为兼容。
|
|
168
219
|
|
|
169
|
-
|
|
170
|
-
<summary><strong>完整推荐设置</strong></summary>
|
|
220
|
+
## 当前边界
|
|
171
221
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
222
|
+
- 当前支持 route 使用 implicit Prompt Cache;content-level explicit breakpoint 在该 route 上会被拒绝,因此没有作为产品设置开放。
|
|
223
|
+
- dynamic skill / plugin 若改变 top-level tool schema,可能触发一次 prompt-cache reset;功能不受影响,新 topology 会重新 warm。
|
|
224
|
+
- `reasoning.context` / `reasoning.mode` 仍取决于 host/Pi 暴露能力,LCX 不额外造第二套控制面。
|
|
225
|
+
- normal operational context 仍使用约 `262K` 级别配置;1.05M long context 不是默认开启项。
|
|
226
|
+
- credentialed `ALPHA-004` runtime 仍为 `NOT_COVERED`,fail-closed 行为已有测试覆盖。
|
|
227
|
+
- Programmatic Tool Calling 当前不作为已支持能力宣传。
|
|
228
|
+
|
|
229
|
+
## 常见问题
|
|
230
|
+
|
|
231
|
+
<details>
|
|
232
|
+
<summary><strong>为什么切非 GPT 前要关闭 LCX?</strong></summary>
|
|
183
233
|
|
|
184
|
-
|
|
234
|
+
LCX ON 是 GPT Responses lifecycle ownership switch,不是通用多模型代理层。非 GPT 模型继续走 DSH 原生 adapter。
|
|
185
235
|
|
|
186
236
|
</details>
|
|
187
237
|
|
|
188
238
|
<details>
|
|
189
|
-
<summary><strong
|
|
239
|
+
<summary><strong>为什么 web_search 还是同一个工具?</strong></summary>
|
|
190
240
|
|
|
191
|
-
|
|
192
|
-
确认插件和 Hosted Search 已启用,并且当前 Agent 能解析到兼容的 GPT `openai-responses` route。
|
|
241
|
+
这是刻意设计。LCX 改的是 DSH `web_search` 后面的 SearchProvider,不给模型重复暴露两个普通搜索工具。
|
|
193
242
|
|
|
194
|
-
|
|
195
|
-
这是预期的 fail-closed 行为。Alpha 必须对当前 route/schema 完成可信 capability probe 后才注册。
|
|
243
|
+
</details>
|
|
196
244
|
|
|
197
|
-
|
|
198
|
-
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>为什么 Alpha 有时不出现?</strong></summary>
|
|
199
247
|
|
|
200
|
-
|
|
201
|
-
确认安装的是 `0.4.1` 或更高版本,并重启/刷新 DSH Web;`0.4.1` 已包含正式安装态 settings lifecycle 修复。
|
|
248
|
+
这是 fail-closed 行为。当前 route/schema 没通过 capability probe 时,`websearch_alpha` 不注册。
|
|
202
249
|
|
|
203
250
|
</details>
|
|
204
251
|
|
|
205
252
|
<details>
|
|
206
|
-
<summary><strong
|
|
253
|
+
<summary><strong>为什么加载 skill 后有时缓存会重新 warm?</strong></summary>
|
|
254
|
+
|
|
255
|
+
某些 skill 会动态注册新的顶层工具。工具 schema 属于可缓存 prompt prefix 的一部分,topology 改变时 provider 可能建立新的 cache epoch。`0.4.2` 优先保证工具定义正确,不通过猜测 provenance 来强行维持旧 cache。
|
|
256
|
+
|
|
257
|
+
</details>
|
|
258
|
+
|
|
259
|
+
## 开发与验证
|
|
207
260
|
|
|
208
261
|
```bash
|
|
209
262
|
npm run typecheck
|
|
@@ -212,12 +265,11 @@ npm run test:schema
|
|
|
212
265
|
npm pack --ignore-scripts
|
|
213
266
|
```
|
|
214
267
|
|
|
215
|
-
-
|
|
216
|
-
-
|
|
268
|
+
- 架构:[ARCHITECTURE.md](ARCHITECTURE.md)
|
|
269
|
+
- 版本记录:[CHANGELOG.md](CHANGELOG.md)
|
|
270
|
+
- GitHub Releases:[Releases](https://github.com/kk3ya03-star/dsh-lcx-codex/releases)
|
|
217
271
|
- npm:[`dsh-lcx-codex`](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
218
272
|
|
|
219
|
-
</details>
|
|
220
|
-
|
|
221
273
|
## License
|
|
222
274
|
|
|
223
275
|
MIT
|
package/README_EN.md
CHANGED
|
@@ -1,64 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
# dsh-lcx-codex
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
6
4
|
[](https://github.com/kk3ya03-star/dsh-lcx-codex/actions/workflows/publish.yml)
|
|
7
5
|

|
|
8
|
-

|
|
7
|
+

|
|
9
8
|

|
|
10
9
|
|
|
11
|
-
[简体中文](README.md) · **English** · [Architecture](ARCHITECTURE.md) · [Changelog](CHANGELOG.md)
|
|
10
|
+
[简体中文](README.md) · **English** · [Architecture](ARCHITECTURE.md) · [Changelog](CHANGELOG.md) · [Releases](https://github.com/kk3ya03-star/dsh-lcx-codex/releases)
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
> **Keep a DSH GPT Responses conversation on one final Responses wire owner from the first ordinary turn through tools, Native V2 Compact / Replay, restart recovery, and GPT model switching.**
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
`dsh-lcx-codex` does not replace DSH. DSH still owns the Agent, Session, model selection, tool execution, attachments, and compaction policy. When **LCX is ON**, LCX owns the final request / SSE wire for the selected GPT Responses conversation.
|
|
16
15
|
|
|
17
16
|
## Current stable release
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
**`0.4.2`** is the current stable release and a **zero-functional-change stable promotion** of the fully validated `0.4.2-pre.1` runtime.
|
|
20
19
|
|
|
21
20
|
```powershell
|
|
22
21
|
dsh plugin --profile web add dsh-lcx-codex
|
|
23
22
|
dsh web
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
npm
|
|
25
|
+
- npm dist-tag: `latest`
|
|
26
|
+
- DSH: `0.1.1-rc.2`
|
|
27
|
+
- Plugin Pi: `0.84.3`
|
|
28
|
+
- Node.js: `^22.19.0 || >=24.0.0`
|
|
29
|
+
|
|
30
|
+
`0.4.2-pre.1` remains a historical prerelease; new users should install `latest`.
|
|
31
|
+
|
|
32
|
+
## Product contract
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
LCX OFF
|
|
36
|
+
= use the native DSH LLM path
|
|
37
|
+
|
|
38
|
+
LCX ON
|
|
39
|
+
= LCX owns the final Responses request / SSE wire
|
|
40
|
+
for the selected GPT Responses conversation starting at ordinary turn 1
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Turn LCX off before switching to Claude, Gemini, DeepSeek, or another non-GPT model. Model switching itself does not require a DSH restart.
|
|
27
44
|
|
|
28
|
-
##
|
|
45
|
+
## Why LCX exists
|
|
29
46
|
|
|
30
|
-
|
|
47
|
+
DSH already owns the Agent, Session, tools, and compaction lifecycle. LCX addresses the final provider-native GPT Responses layer: ordinary requests, tools, Native Compact, Replay, restart/resume, and GPT route migration no longer switch final wire owners inside one conversation.
|
|
31
48
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
```text
|
|
50
|
+
DSH
|
|
51
|
+
Agent / Session / Tools
|
|
52
|
+
│
|
|
53
|
+
llm / stream seam
|
|
54
|
+
│
|
|
55
|
+
┌──────────┴──────────┐
|
|
56
|
+
│ │
|
|
57
|
+
LCX OFF LCX ON
|
|
58
|
+
│ │
|
|
59
|
+
native DSH adapter LCX Responses Core
|
|
60
|
+
│
|
|
61
|
+
ordinary turn 1
|
|
62
|
+
↓
|
|
63
|
+
tools
|
|
64
|
+
↓
|
|
65
|
+
Native V2 Compact
|
|
66
|
+
↓
|
|
67
|
+
Replay
|
|
68
|
+
↓
|
|
69
|
+
Restart / Resume
|
|
70
|
+
↓
|
|
71
|
+
GPT Model Migration
|
|
72
|
+
```
|
|
38
73
|
|
|
39
|
-
|
|
74
|
+
Compact therefore changes history representation without also changing request ownership.
|
|
40
75
|
|
|
41
76
|
## Core capabilities
|
|
42
77
|
|
|
43
|
-
### GPT
|
|
78
|
+
### 1. Full GPT Responses lifecycle ownership
|
|
44
79
|
|
|
45
|
-
|
|
80
|
+
With LCX ON, ordinary requests, tool continuations, Native Compact, Native Replay, restart/resume, and portable GPT migration use one LCX Responses request-builder / transport owner.
|
|
46
81
|
|
|
47
|
-
|
|
82
|
+
DSH remains the canonical session/history owner. LCX does not create a second conversation database or replace the DSH Tool Executor.
|
|
48
83
|
|
|
49
|
-
|
|
84
|
+
### 2. GPT-5.6 Prompt Cache
|
|
50
85
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
86
|
+
`0.4.2` uses the current GPT-5.6 cache-options path and maintains stable cache identity inside a session:
|
|
87
|
+
|
|
88
|
+
- implicit caching by default;
|
|
89
|
+
- the supported route sends `prompt_cache_options.ttl = 30m`;
|
|
90
|
+
- ordinary consecutive turns and tool-heavy workloads can reuse warm prefixes;
|
|
91
|
+
- Native Compact intentionally creates a new history/cache epoch, so the old uncompressed prefix is not promised to remain reusable;
|
|
92
|
+
- real long-session validation repeatedly observed near-complete prefix reuse while request topology remained stable.
|
|
54
93
|
|
|
55
|
-
|
|
94
|
+
Cache reuse depends on provider behavior, model, request prefix, tool schemas, and session state; it is not a fixed performance guarantee.
|
|
56
95
|
|
|
57
|
-
`0.
|
|
96
|
+
One confirmed boundary: activating a skill at runtime can change the top-level tool schema and cause a one-time cache reset. The new topology warms again on the next request. The currently supported route rejects content-level `prompt_cache_breakpoint`, and DSH `0.1.1-rc.2` does not expose authoritative dynamic-tool provenance, so `0.4.2` preserves the safe one-time reset instead of guessing tool history.
|
|
58
97
|
|
|
59
|
-
### Native V2
|
|
98
|
+
### 3. Native V2 Compact + Replay
|
|
60
99
|
|
|
61
|
-
|
|
100
|
+
DSH still decides **when to compact, what range to compact, transaction boundaries, and recovery**. LCX owns only the provider-native Responses V2 wire.
|
|
101
|
+
|
|
102
|
+
Default pressure coordination:
|
|
62
103
|
|
|
63
104
|
```text
|
|
64
105
|
0% ─────────────────── 90% ───── 95% ───── 100%
|
|
@@ -66,132 +107,156 @@ LCX does not create a second compaction engine. DSH still owns pressure, compact
|
|
|
66
107
|
V2 DSH prune
|
|
67
108
|
```
|
|
68
109
|
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
- provider-confirmed
|
|
72
|
-
- manual `/compact
|
|
110
|
+
- `90%`: prefer Native V2;
|
|
111
|
+
- `95%`: allow emergency DSH tool-result pruning;
|
|
112
|
+
- provider-confirmed overflow stays with DSH recovery;
|
|
113
|
+
- manual `/compact` keeps the native DSH compaction transaction.
|
|
73
114
|
|
|
74
|
-
Native
|
|
115
|
+
Native checkpoint v5 persists provider-native compaction state plus the portable retained history needed for fidelity. Compatible same-session routes can use Native replay; incompatible routes never reuse unsafe opaque state.
|
|
75
116
|
|
|
76
|
-
|
|
117
|
+
### 4. Restart / Resume + hot GPT switching
|
|
77
118
|
|
|
78
|
-
|
|
119
|
+
A single DSH session can continue through:
|
|
79
120
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
121
|
+
```text
|
|
122
|
+
Terra
|
|
123
|
+
→ Compact
|
|
124
|
+
→ Replay
|
|
125
|
+
→ Restart DSH
|
|
126
|
+
→ Resume same session
|
|
127
|
+
→ Switch to Sol
|
|
128
|
+
→ Continue
|
|
129
|
+
```
|
|
86
130
|
|
|
87
|
-
|
|
131
|
+
Compatible route/model resumes may restore Native opaque state. An incompatible GPT model / route drops unsafe opaque state and reconstructs portable history while remaining on LCX Responses transport.
|
|
88
132
|
|
|
89
|
-
|
|
133
|
+
### 5. Hosted Search + stateful Web Actions
|
|
90
134
|
|
|
91
|
-
|
|
135
|
+
Ordinary web search still uses DSH's native `web_search`. LCX can map its SearchProvider to the active GPT Hosted Search route instead of exposing a second ordinary-search tool.
|
|
92
136
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
137
|
+
| Need | Entry |
|
|
138
|
+
|---|---|
|
|
139
|
+
| Ordinary web search | DSH `web_search` |
|
|
140
|
+
| Advanced Hosted Search controls | `websearch_gpt_advanced` |
|
|
141
|
+
| Stateful page / PDF actions | `websearch_alpha` |
|
|
97
142
|
|
|
98
|
-
|
|
143
|
+
Alpha supports:
|
|
99
144
|
|
|
100
|
-
```
|
|
101
|
-
|
|
145
|
+
```text
|
|
146
|
+
search → open → find / click → screenshot
|
|
102
147
|
```
|
|
103
148
|
|
|
104
|
-
|
|
149
|
+
Alpha is off by default and is registered only after the current endpoint / provider / model / schema passes a capability probe. Unknown deployments fail closed.
|
|
105
150
|
|
|
106
|
-
###
|
|
151
|
+
### 6. Isolated Pi 0.84.3 upgrade
|
|
152
|
+
|
|
153
|
+
The plugin uses `@earendil-works/pi-ai 0.84.3` without overriding the DSH host dependency:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
DSH 0.1.1-rc.2
|
|
157
|
+
└─ host Pi 0.82.1 ← unchanged
|
|
107
158
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
| Use GPT Hosted Search | On when needed |
|
|
112
|
-
| Advanced Hosted Search | Off until needed |
|
|
113
|
-
| Alpha Search | Off until route capability is confirmed |
|
|
114
|
-
| Native V2 remote compaction | On only when upstream supports it |
|
|
115
|
-
| Native-first auto compaction | On when using Native V2 |
|
|
159
|
+
dsh-lcx-codex 0.4.2
|
|
160
|
+
└─ plugin Pi 0.84.3 ← isolated plugin dependency
|
|
161
|
+
```
|
|
116
162
|
|
|
117
|
-
|
|
163
|
+
Pi owns canonical Responses message/tool serialization, reasoning, IDs, strict/grammar/custom tools, `additional_tools`, `tool_search`, namespace, and stream semantics. LCX does not maintain a second generic provider framework.
|
|
118
164
|
|
|
119
|
-
##
|
|
165
|
+
## Configure in 30 seconds
|
|
120
166
|
|
|
121
|
-
|
|
122
|
-
|---|---|
|
|
123
|
-
| GPT Hosted Search | Ordinary entry remains DSH `web_search`; the request follows the active GPT Responses route |
|
|
124
|
-
| Advanced Hosted | `websearch_gpt_advanced` appears only when enabled |
|
|
125
|
-
| Alpha Web Actions | `websearch_alpha` appears only after capability validation |
|
|
126
|
-
| Native V2 | Compaction follows the provider-native checkpoint path; Basic Compaction is not mislabeled as Native V2 |
|
|
167
|
+
### Requirements
|
|
127
168
|
|
|
128
|
-
|
|
169
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
170
|
+
- DSH `0.1.1-rc.2`
|
|
171
|
+
- a working GPT Responses route in DSH
|
|
172
|
+
- actual upstream support for the Hosted Search / Native V2 / Alpha capabilities you enable
|
|
129
173
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
|
133
|
-
|
|
134
|
-
|
|
|
174
|
+
### Suggested first-run settings
|
|
175
|
+
|
|
176
|
+
| Setting | Suggested | Notes |
|
|
177
|
+
|---|---:|---|
|
|
178
|
+
| Enable LCX | **On** | Own the current GPT Responses conversation |
|
|
179
|
+
| Use GPT Hosted Search | As needed | Use GPT Hosted Search behind DSH `web_search` |
|
|
180
|
+
| Advanced Hosted Search | Off | Enable only for advanced Hosted parameters |
|
|
181
|
+
| Alpha Search | Off | Enable after capability validation |
|
|
182
|
+
| Native-first auto compaction | On | Use Native-first pressure coordination |
|
|
183
|
+
| Native threshold | `90%` | Proactive Native V2 threshold |
|
|
184
|
+
| Emergency DSH prune | `95%` | Emergency prune threshold |
|
|
185
|
+
| Fallback to Basic Compaction | On | Allow bounded fallback after Native failure |
|
|
186
|
+
| `web_search` timeout | `240s` | Avoid premature timeout on slower Hosted Search |
|
|
135
187
|
|
|
136
|
-
|
|
188
|
+
### Verify observable behavior
|
|
137
189
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
190
|
+
| Capability | Expected behavior |
|
|
191
|
+
|---|---|
|
|
192
|
+
| LCX ownership | With LCX ON, the first GPT ordinary request already uses the LCX Responses path |
|
|
193
|
+
| Prompt Cache | Stable warm turns may report provider `cached_tokens` |
|
|
194
|
+
| Hosted Search | Ordinary entry remains DSH `web_search` |
|
|
195
|
+
| Advanced Hosted | `websearch_gpt_advanced` appears when enabled |
|
|
196
|
+
| Alpha | `websearch_alpha` appears only after capability validation |
|
|
197
|
+
| Native V2 | Compact produces provider-native checkpoint behavior rather than relabeling Basic Compaction |
|
|
198
|
+
| Replay | The same DSH session continues after Compact and remains resumable after restart |
|
|
144
199
|
|
|
145
|
-
|
|
200
|
+
## DSH / LCX responsibility boundary
|
|
146
201
|
|
|
147
|
-
|
|
202
|
+
| Component | Owns |
|
|
203
|
+
|---|---|
|
|
204
|
+
| **DSH** | Agent loop, Session/history, GenerateOptions, model/credential selection, tool execution, AttachmentStore, pressure policy, compaction transaction |
|
|
205
|
+
| **DSH compatibility seam** | Projects DSH messages / GenerateOptions into Pi Context and bridges results back to DSH |
|
|
206
|
+
| **Plugin Pi 0.84.3** | Canonical Responses serialization / parser semantics |
|
|
207
|
+
| **LCX** | ON/OFF ownership, final Responses body + HTTP/SSE wire, ordinary/compact/replay orchestration, Native opaque state, Search capabilities |
|
|
148
208
|
|
|
149
|
-
|
|
209
|
+
See [ARCHITECTURE.md](ARCHITECTURE.md) for checkpoint, portable replay, cache identity, RefStore, pressure coordination, and protocol details.
|
|
150
210
|
|
|
151
|
-
|
|
211
|
+
## Compatibility
|
|
152
212
|
|
|
153
213
|
| Plugin | DSH | DSH host Pi | Plugin Pi | Status |
|
|
154
214
|
|---|---|---|---|---|
|
|
155
|
-
| `0.4.
|
|
215
|
+
| `0.4.2` | `0.1.1-rc.2` | `0.82.1` | `0.84.3` | **VERIFIED STABLE** |
|
|
216
|
+
| `0.4.1` | `0.1.1-rc.2` | `0.82.1` | `0.82.1` | historical stable |
|
|
217
|
+
|
|
218
|
+
DSH `0.1.2-alpha.1` and newer Pi versions are not part of the formal `0.4.2` compatibility claim. They will be validated by affected seam rather than assumed compatible automatically.
|
|
219
|
+
|
|
220
|
+
## Current boundaries
|
|
221
|
+
|
|
222
|
+
- The supported route uses implicit Prompt Cache. Content-level explicit breakpoints are rejected on that route and are not exposed as a product setting.
|
|
223
|
+
- Dynamic skills/plugins that change the top-level tool schema can trigger a one-time prompt-cache reset; functionality remains correct and the new topology warms again.
|
|
224
|
+
- `reasoning.context` / `reasoning.mode` remain host/Pi exposure boundaries; LCX does not invent a second control surface.
|
|
225
|
+
- The normal operational context profile remains in the ~`262K` class; 1.05M long context is not enabled by default.
|
|
226
|
+
- Credentialed `ALPHA-004` runtime coverage remains `NOT_COVERED`, while fail-closed behavior is covered by tests.
|
|
227
|
+
- Programmatic Tool Calling is not currently advertised as supported.
|
|
156
228
|
|
|
157
|
-
|
|
229
|
+
## FAQ
|
|
158
230
|
|
|
159
231
|
<details>
|
|
160
|
-
<summary><strong>
|
|
232
|
+
<summary><strong>Why do I need to turn LCX off before switching to a non-GPT model?</strong></summary>
|
|
161
233
|
|
|
162
|
-
|
|
163
|
-
|---|---:|---|
|
|
164
|
-
| Enable plugin | On | Enables LCX |
|
|
165
|
-
| Use GPT Hosted Search | As needed | Routes DSH `web_search` through GPT Hosted Search |
|
|
166
|
-
| Advanced Hosted Search | Off | Enable only for advanced Hosted parameters |
|
|
167
|
-
| Alpha Search | Off | Enable after capability verification |
|
|
168
|
-
| Native V2 remote compaction | On* | *When the upstream route actually supports Native V2 |
|
|
169
|
-
| Native-first auto compaction | On | Enables automatic pressure coordination |
|
|
170
|
-
| Native threshold | 90% | Prefer Native V2 from 90% |
|
|
171
|
-
| Emergency DSH prune | 95% | Allow emergency prune from 95% |
|
|
172
|
-
| `web_search` timeout | 240 s | Avoid false timeout on longer searches |
|
|
234
|
+
LCX ON is a GPT Responses lifecycle ownership switch, not a universal multi-model proxy. Non-GPT models continue through native DSH adapters.
|
|
173
235
|
|
|
174
236
|
</details>
|
|
175
237
|
|
|
176
238
|
<details>
|
|
177
|
-
<summary><strong>
|
|
239
|
+
<summary><strong>Why is web_search still the same tool?</strong></summary>
|
|
178
240
|
|
|
179
|
-
|
|
180
|
-
Make sure the plugin and Hosted Search are enabled and that the active Agent resolves to a compatible GPT `openai-responses` route.
|
|
241
|
+
By design. LCX changes the SearchProvider behind DSH `web_search` instead of exposing two ordinary search tools to the model.
|
|
181
242
|
|
|
182
|
-
|
|
183
|
-
That is expected fail-closed behavior. Alpha is registered only after a trusted capability probe succeeds for the current route/schema.
|
|
243
|
+
</details>
|
|
184
244
|
|
|
185
|
-
|
|
186
|
-
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>Why is Alpha sometimes missing?</strong></summary>
|
|
187
247
|
|
|
188
|
-
|
|
189
|
-
Make sure you are on `0.4.1` or later and restart/refresh DSH Web. `0.4.1` includes the installed settings lifecycle fix.
|
|
248
|
+
That is fail-closed behavior. `websearch_alpha` is not registered until the active route/schema passes capability probing.
|
|
190
249
|
|
|
191
250
|
</details>
|
|
192
251
|
|
|
193
252
|
<details>
|
|
194
|
-
<summary><strong>
|
|
253
|
+
<summary><strong>Why can a skill load cause the cache to warm again?</strong></summary>
|
|
254
|
+
|
|
255
|
+
Some skills dynamically register new top-level tools. Tool schemas are part of the cacheable prompt prefix, so a topology change can establish a new cache epoch. `0.4.2` prioritizes correct tool definitions instead of guessing provenance to force reuse of an old cache.
|
|
256
|
+
|
|
257
|
+
</details>
|
|
258
|
+
|
|
259
|
+
## Development and verification
|
|
195
260
|
|
|
196
261
|
```bash
|
|
197
262
|
npm run typecheck
|
|
@@ -200,12 +265,11 @@ npm run test:schema
|
|
|
200
265
|
npm pack --ignore-scripts
|
|
201
266
|
```
|
|
202
267
|
|
|
203
|
-
-
|
|
204
|
-
-
|
|
268
|
+
- Architecture: [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
269
|
+
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
270
|
+
- GitHub Releases: [Releases](https://github.com/kk3ya03-star/dsh-lcx-codex/releases)
|
|
205
271
|
- npm: [`dsh-lcx-codex`](https://www.npmjs.com/package/dsh-lcx-codex)
|
|
206
272
|
|
|
207
|
-
</details>
|
|
208
|
-
|
|
209
273
|
## License
|
|
210
274
|
|
|
211
275
|
MIT
|
package/package.json
CHANGED