dsh-lcx-codex 0.7.0-pre.1 → 0.7.0

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 CHANGED
@@ -1,212 +1,109 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://raw.githubusercontent.com/kk3ya03-star/dsh-lcx-codex/main/assets/dsh-lcx-codex-banner.svg" alt="LCX Codex" width="100%" />
3
+ <img src="https://raw.githubusercontent.com/kk3ya03-star/dsh-lcx-codex/main/assets/dsh-lcx-codex-banner.svg" alt="LCX — DeepSeek Harness 的 GPT & Grok 增强插件" width="100%" />
4
4
 
5
- # LCX Codex
5
+ # LCX — DeepSeek Harness 的 GPT & Grok 增强插件
6
6
 
7
- **给 DeepSeek Harness 里的 GPT 和 Grok 加上联网搜索和长对话自动压缩。**
7
+ **让 [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) 原生用好 GPT 与 Grok:实时联网 / X 搜索、超长对话自动压缩、图文视频预览与缓存命中率显示。**
8
8
 
9
- [![npm latest](https://img.shields.io/npm/v/dsh-lcx-codex/latest?label=latest)](https://www.npmjs.com/package/dsh-lcx-codex)
10
- [![npm prelatest](https://img.shields.io/npm/v/dsh-lcx-codex/prelatest?label=prelatest&color=orange)](https://www.npmjs.com/package/dsh-lcx-codex?activeTab=versions)
11
- [![License](https://img.shields.io/badge/license-MIT-555)](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/LICENSE)
9
+ [![npm](https://img.shields.io/npm/v/dsh-lcx-codex?label=latest)](https://www.npmjs.com/package/dsh-lcx-codex)
10
+ [![DSH](https://img.shields.io/badge/DSH-0.2.2--rc.5-16803c)](#安装与版本选择)
11
+ [![License](https://img.shields.io/badge/license-MIT-555)](LICENSE)
12
12
 
13
- **简体中文** · [English](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/README_EN.md) · [更新日志](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/CHANGELOG.md) · [问题反馈](https://github.com/kk3ya03-star/dsh-lcx-codex/issues)
13
+ **简体中文** · [English](README_EN.md) · [更新日志](CHANGELOG.md) · [问题反馈](https://github.com/kk3ya03-star/dsh-lcx-codex/issues)
14
14
 
15
15
  </div>
16
16
 
17
- LCX Codex 是 [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness)(DSH)的社区插件。装上之后,你在 DSH 里用的 GPT 和 Grok 可以:
17
+ [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/DeepSeek-Harness) 本身已经帮你管好了模型配置、API 密钥、会话与工具体系,但在对接 **GPT(OpenAI Responses)** 与 **Grok(xAI Responses)** 时,还缺少服务端联网搜索、超长上下文远端无损压缩以及搜索富媒体呈现等能力。
18
18
 
19
- - **联网搜索**:GPT 使用 Responses 服务端搜索(Hosted Search),Grok 使用 xAI 原生 Web Search 和 X Search;
20
- - **长任务不中断**:对话接近上下文上限时自动压缩并继续,不用手动开新会话;
21
- - **直接看到图片和视频**:搜索返回的图片、回答里的图片直链排成一行显示在回答下方,点击用 DSH 自带的看图器放大;视频直链显示为卡片,点击后在回答里直接播放。
19
+ **LCX** 就是为补齐这些能力而生的轻量插件:它**不改变你在 DSH 中的任何原有配置、不接管 DeepSeek 等其他模型**,只在你启用后为 GPT 与 Grok 对话打开更顺手的工具链与长对话体验。(npm 包名保持 `dsh-lcx-codex`,确保已有用户可直接无感升级。)
22
20
 
23
- 模型、API Key、会话和其他工具仍由 DSH 管理,不需要额外配置。其他模型(如 DeepSeek)照常走 DSH 自己的逻辑,不受影响。
21
+ ---
24
22
 
25
- ## 使用前提
23
+ ## 能帮你做到什么?
26
24
 
27
- - 已安装 DSH,并在 DSH 中配置好 **GPT 或 Grok 的 Responses API 路由**(官方 API 或兼容网关均可)。
28
- - Node.js `^22.19.0` 或 `>=24.0.0`。
29
-
30
- > 搜索和压缩依赖服务端能力。你的网关能正常聊天,不代表它一定支持这些功能,详见[已知限制](#已知限制)。
31
-
32
- ## 安装
33
-
34
- ### 1. 按 DSH 版本选择插件版本
35
-
36
- 先运行 `dsh --version` 查看 DSH 版本,再按下表选择:
37
-
38
- | 你的 DSH 版本 | 安装的 LCX 版本 | 安装命令中的标签 |
39
- | --- | --- | --- |
40
- | `0.2.2-alpha.3` 及以后(DSH `0.2.2` 预发布系列) | `0.7.0-pre.1`(预发布版) | `@prelatest` |
41
- | `0.2.1` 系列(`0.2.1-rc.5` 及以后的 `0.2.1` 版本,DSH `latest` 通道) | `0.6.0`(稳定版) | `@latest` |
42
- | `0.2.0` 系列(`0.2.0-rc.2`,早于 `0.2.1-alpha.2`) | `0.5.2`(旧稳定版) | `@0.5.2` |
43
- | `0.1.6` 系列(`0.1.6-alpha.2` 及以后) | `0.4.4-pre.1`(旧预发布版) | `@0.4.4-pre.1` |
44
- | `0.1.5` 系列(`0.1.5-rc.1` 及以后) | `0.4.3`(稳定版) | `@0.4.3` |
45
-
46
- 请务必按表格选择:几个版本互不兼容,装错版本时安装命令可能只给出依赖警告,但插件可能无法正常工作。`@latest` 是稳定版 `0.6.0`(发布基线 DSH `0.2.1-rc.5`,host / plugin Pi `1.5.0`);DSH `0.2.0` 用户请固定安装 `@0.5.2`,DSH `0.1.5` 用户请固定安装 `@0.4.3`。历史说明:`0.6.0-pre.2` 是面向 DSH `0.2.1-alpha.2` 的历史预发布版,只在 DSH `0.2.1-alpha.2` 上验证过;`0.2.1-rc.5` 之前的其他早期 `0.2.1` 构建都没有经过验证。使用早期 `0.2.1` 构建时,请把 DSH 升级到 `0.2.1-rc.5`,再安装 `0.6.0`(`@latest`)。DSH `0.2.2-alpha.1` / `0.2.2-alpha.2` 没有经过验证的 LCX 版本,请升级到 `0.2.2-alpha.3` 或更新版本。
47
-
48
- 稳定版 `0.6.0` 的安装范围是 `>=0.2.1-rc.5 <0.2.2-0`:之后的 DSH `0.2.1` 版本也能装上,但**没有经过验证**;上限写成 `<0.2.2-0` 是为了不放行 DSH `0.2.2` 的预发布版。本版本的验证基线只有 DSH `0.2.1-rc.5`(host Pi `1.5.0`,plugin Pi `1.5.0`)。
49
-
50
- `0.7.0-pre.1` 是预发布版,面向 DSH `0.2.2` 预发布系列(从 `0.2.2-alpha.3` 起)。它的安装范围**只有下限**(`>=0.2.2-alpha.3`),没有上限:更新的 DSH 版本也能装上,但**没有经过验证**。本次预发布的验证基线只有 DSH `0.2.2-alpha.3`(host Pi `1.5.0`,plugin Pi `1.5.0`),请不要据此认为其他 DSH 版本受支持。
51
-
52
- `0.6.0` 和 `0.7.0-pre.1` 的主要变化(详见[更新日志](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/CHANGELOG.md)):
53
-
54
- - **内置 Pi 跟随 DSH 升级到 `1.5.0`**:GPT-5.6 / GPT-6 系列模型的工具声明与 DSH 自己的发送方式一致(全部以 `additional_tools` 形式声明,不再发送顶层 `tools`),会话中途新增或删除工具、重启、分叉和压缩之后也保持一致。
55
- - **切换推理强度不再让缓存失效**:在 `openai` 的 GPT-6 系列模型上,会话中途切换推理强度会保留已缓存的前缀,与 DSH 自己的处理一致。
56
- - **自动审查修复**:GPT 路由上 DSH 自动审查(auto-review)的请求现在会带上它自己的系统提示词,不再以 `AUTO_REVIEW_FAILED` 失败。
57
- - **仅 `0.7.0-pre.1`**:适配 DSH `0.2.2` 的插件接口;LCX 发出的 GPT 请求也会应用其他插件通过 `llm-pi-ai/request-headers` 提供的请求头,但这些插件不能替换凭据、会话亲和和请求关联相关的请求头。
58
-
59
- 从 `0.6.0-pre` 系列开始适配的 DSH `0.2.1` 插件新能力(`0.6.0` 和 `0.7.0-pre.1` 都包含):
60
-
61
- - **增量工具更新(只增不改)**:在 DSH 声明支持该模式的 GPT Responses 路由上,会话中途新增工具(例如打开联网搜索、启用 MCP 或技能)时,请求里的工具列表保持不变,新增的工具以历史项的形式声明,因此不再改变已缓存的前缀。设置卡片里有“增量工具更新”开关,默认开启,关闭后每次请求都发送完整的当前工具列表。删除工具或同名重定义仍会让缓存失效一次。Grok、自定义命名路由、分叉与路由迁移的回放、压缩检查点仍然发送完整工具列表。
62
- - **程序化工具调用里的搜索**:在 `run_code` 程序里调用 `web_search` / `websearch_gpt_advanced` 时,搜索用量和返回的图片也会计入并显示。
63
- - **插件管理页卡片**:LCX 在插件管理页显示自己的名称(LCX Codex)、简介和图标。
64
-
65
- > 注意:旧稳定版 `0.5.x` 的安装范围写作 `>=0.2.0-rc.2 <0.2.1`,按 DSH 的版本范围规则,`0.2.1` 的预发布版(如 `0.2.1-rc.5`)也可能被放行安装,但这些版本**不在** `0.5.x` 的支持和验证范围内;DSH `0.2.1-rc.5` 及以后的 `0.2.1` 版本请使用 `@latest`(`0.6.0`),DSH `0.2.2-alpha.3` 及以后请使用 `@prelatest`。
66
-
67
- ### 2. 安装并启动
25
+ | 功能 | 实际体验 |
26
+ | --- | --- |
27
+ | **GPT 原生联网搜索** | 让 GPT 直接通过 DSH 标准的 `web_search` 入口查资料并给出带来源引用的回答。 |
28
+ | **GPT 高级搜索与过滤** | 额外提供图片搜索、指定域名范围、地区定位等精确检索控制。 |
29
+ | **Grok 原生网页与 X 搜索** | 直连 xAI Responses 服务端 **Web Search** 与 **X Search**,同时保留本地读文件 / MCP 等工具。 |
30
+ | **超长对话远端压缩(Native V2)** | 长任务接近上下文上限时,支持兼容的 GPT 路线在服务端自动压缩并续跑,不断档、不丢线索。 |
31
+ | **搜索图文与视频预览** | 在回答下方自动整理搜索返回图片横排墙(支持点击放大预览)与可点击行内播放的视频卡片。 |
32
+ | **单轮缓存命中率显示** | 当上游返回缓存计数时,在每轮回答末尾展示只读的 `缓存命中 XX%` 胶囊,一眼看清前缀缓存效果。 |
33
+ | **第三方中转网关兼容开关** | 新增可选的 **「网关兼容回退」** 开关,适配不支持 `additional_tools` / `configuration_update` 的第三方中转站。 |
68
34
 
69
- DSH `0.2.2-alpha.3` 及以后(预发布版):
35
+ ---
70
36
 
71
- ```sh
72
- dsh plugin --profile web add dsh-lcx-codex@prelatest
73
- dsh web
74
- ```
37
+ ## 安装与版本选择
75
38
 
76
- DSH `0.2.1` 系列(`0.2.1-rc.5` 及以后,稳定版;更早的 `0.2.1` 构建请先把 DSH 升级到 `0.2.1-rc.5`):
39
+ 安装 DSH 当前稳定版对应的最新插件(`dsh-lcx-codex@0.7.0`):
77
40
 
78
41
  ```sh
79
42
  dsh plugin --profile web add dsh-lcx-codex@latest
80
43
  dsh web
81
44
  ```
82
45
 
83
- DSH `0.2.0` 系列(注意固定版本号,不要用 `@latest`):
84
-
85
- ```sh
86
- dsh plugin --profile web add dsh-lcx-codex@0.5.2
87
- dsh web
88
- ```
89
-
90
- DSH `0.1.6` 系列:
91
-
92
- ```sh
93
- dsh plugin --profile web add dsh-lcx-codex@0.4.4-pre.1
94
- dsh web
95
- ```
96
-
97
- DSH `0.1.5` 系列(注意固定版本号,不要用 `@latest`):
46
+ > 装好后,进入 DSH Web 左侧 **插件 → LCX Codex** 即可一键开启需要的功能。
98
47
 
99
- ```sh
100
- dsh plugin --profile web add dsh-lcx-codex@0.4.3
101
- dsh web
102
- ```
48
+ 请按你本地使用的 **DSH 版本** 选择对应插件版本:
103
49
 
104
- 以后更新插件,重新运行同一条 `add` 命令即可。
105
-
106
- ### 3. 打开功能开关
107
-
108
- 打开 DSH Web 的插件页面,在 LCX 的配置卡片 **Responses / Codex 能力** 中按需打开下列开关,然后点击 **保存**。
109
-
110
- <img src="https://raw.githubusercontent.com/kk3ya03-star/dsh-lcx-codex/main/assets/settings-card.png" alt="LCX 插件配置卡片" width="720" />
111
-
112
- **GPT**
113
-
114
- | 开关 | 作用 | 建议 |
50
+ | 你正在使用的 DSH 版本 | 对应插件安装命令 | 说明 |
115
51
  | --- | --- | --- |
116
- | **启用 LCX** | GPT 功能的总开关,包括长对话自动压缩 | 用 GPT 时打开 |
117
- | **使用 GPT Hosted Search 作为 DSH web_search 后端** | GPT 联网搜索 | 需要联网时打开 |
118
- | **启用高级 Hosted 工具** | 图片搜索、限定网站、指定位置等(需先打开上一项) | 按需 |
119
- | **启用 Alpha command** | 实验功能:让 GPT 继续打开、查找搜索结果中的页面 | 日常不需要 |
120
- | **增量工具更新(addition-only)** | 会话中途新增工具时保持请求前缀不变以保护缓存,仅对 DSH 声明支持的 GPT 路由生效;关闭后每次请求都发送完整工具列表 | 默认开启,一般不用改 |
52
+ | **DSH `0.2.2`**(推荐,基线 `0.2.2-rc.5`,Pi `1.6.0`) | `dsh plugin --profile web add dsh-lcx-codex@latest` | **`0.7.0`(当前 `@latest`)**,支持 GPT-6.2 / Grok 4.6-4.7、缓存命中胶囊与网关回退开关 |
53
+ | DSH `0.2.1`(基线 `0.2.1-rc.5`,Pi `1.5.0`) | `dsh plugin --profile web add dsh-lcx-codex@0.6.0` | 旧稳定版 `0.6.0`(维护分支 `stable/0.6.x`) |
54
+ | DSH `0.2.0`(基线 `0.2.0-rc.2`,Pi `0.87.1`) | `dsh plugin --profile web add dsh-lcx-codex@0.5.2` | 历史版本 `0.5.2`(维护分支 `stable/0.5.x`) |
55
+ | DSH `0.1.5`(基线 `0.1.5-rc.1`,Pi `0.85.1`) | `dsh plugin --profile web add dsh-lcx-codex@0.4.3` | 历史固定版本 `0.4.3` |
121
56
 
122
- **Grok 原生搜索**(与“启用 LCX”相互独立)
57
+ 运行环境要求:Node.js `^22.19.0 || >=24.0.0`。
123
58
 
124
- | 开关 | 作用 |
125
- | --- | --- |
126
- | **启用原生 Web Search** | Grok 搜索网页 |
127
- | **启用原生 X Search** | Grok 搜索 X 内容 |
59
+ ---
128
60
 
129
- 开启任一项后,Grok 改用 xAI 原生搜索;网页读取和其他 DSH / MCP 工具仍可正常使用。
61
+ ## 三步开启推荐配置
130
62
 
131
- **显示**
63
+ 打开 DSH Web → 左侧边栏 **「插件」** → 点击 **「LCX Codex」** → 展开 **「Responses / Codex 能力」**:
132
64
 
133
- | 开关 | 作用 |
134
- | --- | --- |
135
- | **搜索媒体预览** | 在回答下方显示搜索返回的图片、回答里的图片直链和可直接播放的视频直链;图片横排显示、点击放大,视频点击后在回答里播放。回答里用 Markdown 写的图片由 DSH 原生显示,不会重复;普通网页链接保持为链接。只改变界面显示,不影响发给模型的内容 |
136
-
137
- ## 怎么用
138
-
139
- 像平时一样和模型说话即可,不需要写任何工具参数:
140
-
141
- > 搜索 Python 官方文档,告诉我 `asyncio.TaskGroup` 应该怎么用。
142
-
143
- > 搜几张金门大桥的照片,显示一张,并附上来源网页。
144
-
145
- > 用 Grok 看看 X 上最近关于这个项目的讨论。
146
-
147
- 长对话会在接近上限时自动压缩;你也可以随时输入 `/compact` 手动压缩。
148
-
149
- ## 从旧版本升级
150
-
151
- - **DSH 升级到 `0.2.2-alpha.3` 或更新版本(DSH `0.2.2` 预发布系列)**:把插件换成 `@prelatest`(`0.7.0-pre.1`),`0.6.x` 没有在这些 DSH 版本上验证。
152
- - **DSH 升级到 `0.2.1-rc.5`(DSH `latest` 通道)**:把插件换成 `@latest`(`0.6.0`);已装 `0.6.0-pre.2` 的用户也用这条命令换到稳定版。
153
- - **DSH `0.2.0` 系列**:继续使用 `@0.5.2`;`@latest` 现在指向支持 DSH `0.2.1` 的 `0.6.0`,旧版 `0.4.x` 不支持 DSH `0.2`。
154
- - **DSH `0.1.6` 系列**:继续使用 `@0.4.4-pre.1`。
155
- - **DSH `0.1.5` 系列**:继续使用 `@0.4.3`;`@latest` 现在指向支持 DSH `0.2.1` 的 `0.6.0`。
156
- - **已装了 `0.5.0`、`0.5.1` 或 `0.5.0-pre.1`**:DSH `0.2.0` 系列运行 `@0.5.2` 的 `add` 命令即可升到 `0.5.2`(只包含缺陷修复,安装范围不变)。
157
- - **升级后建议新建会话**:旧版本保存的压缩状态不保证兼容。DSH `0.2` 迁移过的旧长会话如果带有旧版 LCX 压缩检查点,LCX 会提示 `LCX_CHECKPOINT_UNSUPPORTED`,新建会话即可;其他模型不受影响。
158
-
159
- ## 停用与卸载
65
+ <div align="center">
160
66
 
161
- - **临时停用**:在配置卡片中关闭 **启用 LCX** 和 Grok 原生搜索开关并保存,GPT 和 Grok 即恢复 DSH 原生行为。
162
- - **卸载**:
67
+ <img src="assets/settings-card.png" alt="LCX Codex v0.7.0 在 DeepSeek Harness 中的插件设置页" width="680" />
163
68
 
164
- ```sh
165
- dsh plugin --profile web remove dsh-lcx-codex
166
- ```
69
+ </div>
167
70
 
168
- ## 已知限制
71
+ 1. **开启 GPT 核心能力**:打开 **启用 LCX** 与 **使用 GPT Hosted Search**(需要图搜/按域名检索时再打开 **启用 GPT 高级搜索工具**;**增量工具更新** 建议保持默认开启以保护前缀缓存)。
72
+ 2. **开启 Grok 原生搜索**(独立于 GPT 开关):按需勾选 **Grok 原生联网搜索** 与 **Grok 原生 X 搜索**。
73
+ 3. **开启视觉增强与按需适配网关**:建议开启 **搜索媒体预览**;如果你使用的是 **第三方 OpenAI 中转站** 且遇到丢工具或报错,再勾选 **网关兼容回退(标准 tools / reasoning.effort)**(官转 / 官方渠道保持关闭即可)。
169
74
 
170
- - **网关能力因人而异**:搜索、压缩、Alpha 都依赖对应的服务端能力,不同网关支持程度不同。
171
- - **Grok**:支持 API Key / API 网关路由,不支持 xAI OAuth / SuperGrok 登录。本次发布的真实运行验证了 `grok-4.6` 的原生 Web Search;原生 X Search 没有在本次发布的真实运行中单独重新验证(上一次单独验证是 `0.4.4-pre.1` 在 `grok-4.6` 上)。`grok-4.7` 在本次发布的测试网关上没有可用渠道,原生搜索没有在它上面验证。
172
- - **Grok 的 `maxTokens` 设置(DSH `0.2.2`)**:如果 provider 配置里 Grok 模型的 `maxTokens` 等于 `contextWindow`,DSH `0.2.2` 不允许在会话中从其他模型切换到这个 Grok 模型(这是 DSH 的行为,DSH `0.2.1` 只给出警告)。请把 `maxTokens` 设得明显小于 `contextWindow`,为输入上下文和 DSH 的压缩预留留出空间;只是比 `contextWindow` 小一点,并不能保证可以切换过去。
173
- - **Grok 长对话压力**:xAI 的智能体调用会把多次内部请求的用量累加计费。LCX 在服务端返回完整的实时上下文数据时,用它来判断何时压缩,缺失时退回估算;计费数字本身保持不变。
174
- - **Alpha 仍是实验功能**:连续打开/查找页面在已测试的 OAuth 类上游上可用;API Key 类上游账号不在支持范围内。目标页面抓取失败时会提示 `LCX_ALPHA_PAGE_FETCH_FAILED`,模型可以换一个结果继续。
175
- - **Markdown 图片换行**:为避免 DSH `0.2` 中图片后的文字挤到图片右侧,LCX 会让回答里的 Markdown 图片单独占一行,这一点与“搜索媒体预览”开关无关;句中的小图也会因此换行。
176
- - **DSH `0.1.5` + LCX `0.4.3`**:在插件设置中启用或停用 LCX 后,已打开的浏览器页面可能需要刷新。
177
- - **DSH `0.2.1` 的工具更新**:增量工具更新只在 DSH 声明“只增不改”的 GPT Responses 路由上生效;当 DSH 的工具历史或模型信息缺失、路由不支持或设置卡片里关闭了开关时,LCX 回到每次发送完整工具列表。删除工具或同名重定义仍会让缓存失效一次。缓存命中受上游影响有波动:在 `openai/gpt-6-sol` 上用同一操作序列对比,开启时新增工具后的首个请求约 80% 命中缓存,关闭时为 0%。LCX 内置与 DSH 相同的 Pi `1.5.0` 模型目录,目录里没有的更新模型按 DSH 的声明处理。GPT-5.6 / GPT-6 系列模型的工具全部以 `additional_tools` 形式声明(与 DSH 一致),网关需要支持这种请求格式。
178
- - **验证范围**:`0.6.0` 的验证基线只有 DSH `0.2.1-rc.5`,`0.7.0-pre.1` 的验证基线只有 DSH `0.2.2-alpha.3`(两者都是 host / plugin Pi `1.5.0`);各自安装范围内更新的 DSH 版本未经验证。两个基线上的真实运行验证覆盖 GPT 路由(`gpt-6-sol`、`gpt-6.1-sol`)、联网搜索(含高级搜索和 `run_code` 内的搜索)、手动压缩和自然触发的压缩压力档位、重启恢复、分叉与路由迁移、推理强度切换、自动审查、搜索媒体预览、插件管理页卡片和 `grok-4.6` 原生 Web Search。以下情况没有单独的完整实机验证:`gpt-5.6-sol` 的首轮对话、`gpt-5.4` / `gpt-5.5` 这类不带推理档的模型、`gpt-6-sol` 上的推理强度切换(切换验证在 `gpt-6.1-sol` 上进行)、从 GPT 切换到非 GPT 模型时的压缩、需要生成摘要的 GPT 到 GPT 模型切换、在当前 Grok 配置下从 GPT 切换到 Grok 的实际对话,以及 Alpha 搜索。旧版本:`0.6.0-pre.2` 的验证基线为 DSH `0.2.1-alpha.2`;稳定版 `0.5.2` 的发布基线为 DSH `0.2.0-rc.2`(`0.5.0` 同);`0.4.4-pre.1` 在 DSH `0.1.6-alpha.2` 上完整验证;`0.4.3` 的稳定发布基线是 DSH `0.1.5-rc.1`,并已另外验证 DSH `0.1.5-rc.2`。同一安装范围内其他后续版本仍需单独评估,遇到问题欢迎反馈。
75
+ ---
179
76
 
180
- ## 常见问题
77
+ ## 日常怎么用?
181
78
 
182
- **装完没有变化?**
183
- 确认安装命令和启动命令用的是同一个 profile(上面的示例都是 `web`),并检查插件设置里的开关已经保存。
79
+ 配置完后直接用自然语言对话即可,无需手动写任何工具参数:
184
80
 
185
- **能正常聊天,但搜索或压缩失败?**
186
- 大概率是当前 GPT / Grok 路由没有提供对应的服务端能力。可以换官方 API 或其他网关对比一下。
81
+ > 帮我查一下 Python 3.13 里 `asyncio.TaskGroup` 的异常处理注意事项,并附上官方文档依据。
187
82
 
188
- **安装时出现依赖版本警告,或插件加载失败?**
189
- 通常是 DSH 版本和插件版本不匹配,按[上面的表格](#1-按-dsh-版本选择插件版本)重新选择。
83
+ > 搜几张秋天的富士山高清图片展示在回答里,顺便给出图片来源页面。
190
84
 
191
- **升级到 DSH 0.2 后插件“导入失败”(failed to import)?**
192
- 从较早版本一路升级上来的配置目录里可能残留旧的依赖包。先停止 `dsh web`,把 DSH 主目录(默认 `~/.dsh`,或 `DSH_HOME` 指定的目录)下 `profiles/web/` 里的 `node_modules` 和 `pnpm-lock.yaml` 移走或删除,再按[上面的表格](#1-按-dsh-版本选择插件版本)重新运行对应的 `dsh plugin --profile web add` 命令,然后启动 `dsh web`。
85
+ > 用 Grok 在 X 上搜一下大家最近对这个项目的讨论要点。
193
86
 
194
- **刚发布新版时 `@latest` / `@prelatest` 装到了旧版本?**
195
- 包管理器的缓存可能还没刷新,DSH 会因版本不兼容拒绝安装。稍等几分钟重试,或直接指定版本号,例如 `dsh-lcx-codex@0.6.0` 或 `dsh-lcx-codex@0.7.0-pre.1`。
87
+ 做超长代码库排查或连续任务时也不用盯着上下文条:兼容的 GPT 路线会自动在临界点触发远端无损压缩,也可以随时输入 `/compact` 手动压缩。
196
88
 
197
- ## 反馈问题
89
+ ---
198
90
 
199
- 请在 [Issues](https://github.com/kk3ya03-star/dsh-lcx-codex/issues) 中附上:插件版本、DSH 版本、Node.js 版本、使用的模型/网关类型和复现步骤。
91
+ ## 常见问题排查
200
92
 
201
- **请不要上传 API Key、完整请求内容或未脱敏的会话日志。**
93
+ - **装完插件好像没变化?**
94
+ 请确认 `dsh plugin add` 和 `dsh web` 使用的是同一个 profile(比如都是 `--profile web`),打开插件开关并点击保存后,如页面早已开着请刷新一次浏览器标签页。
95
+ - **切换到 Grok 时报错 `MODEL_SWITCH_COMPACTION_FAILED`?**
96
+ DSH `0.2.2` 会拒绝 `maxTokens >= contextWindow` 的模型配置。请在你的 `llm-pi-ai` Grok 提供商配置里把 `maxTokens` 调到明显小于 `contextWindow`(例如窗口 `500000` 时把 `maxTokens` 设为 `64000` 或 `128000`)。
97
+ - **接入第三方中转网关后,GPT-6 对话报 `configuration_update` / `additional_tools` 错误或调用不到工具?**
98
+ 部分第三方网关尚不支持 OpenAI 最新的增量包结构。请在插件设置里勾选 **「网关兼容回退(标准 tools / reasoning.effort)」**,保存后在新一轮对话重试即可。
99
+ - **Grok 原生搜索支持哪些认证方式?**
100
+ 支持 API Key 与兼容的 API 网关;xAI 浏览器 OAuth / SuperGrok 账号登录暂不在支持范围内。Alpha 网页深读目前仍属实验性能力,部分站点可能受上游限制。
202
101
 
203
- ## 更多
102
+ 遇到 bug 请前往 [Issues](https://github.com/kk3ya03-star/dsh-lcx-codex/issues) 提交,附上 **插件版本、DSH 版本、Node.js 版本与复现步骤** 即可(请勿粘贴 API Key 或完整原始日志)。
204
103
 
205
- - [更新日志](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/CHANGELOG.md)
206
- - [架构说明](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/ARCHITECTURE.md)
207
- - [第三方许可](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/THIRD_PARTY_NOTICES.md)
208
- - [参与贡献](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/CONTRIBUTING.md)
104
+ ---
209
105
 
210
- ## 许可证
106
+ ## 更多资料与许可
211
107
 
212
- [MIT](https://github.com/kk3ya03-star/dsh-lcx-codex/blob/main/LICENSE)。独立社区插件,与 OpenAI、xAI、DeepSeek、Sub2API、NewAPI 无隶属关系,也未获得其官方背书。
108
+ - [更新日志 (CHANGELOG)](CHANGELOG.md) · [技术架构说明 (ARCHITECTURE)](ARCHITECTURE.md) · [第三方许可声明](THIRD_PARTY_NOTICES.md)
109
+ - 基于 [MIT 协议](LICENSE) 开源。本项目为独立社区插件,与 OpenAI、xAI、DeepSeek 无隶属或背书关系。
@@ -2,15 +2,18 @@
2
2
 
3
3
  `lib/pi-responses-runtime.js` is generated from public exports of the packages below. The build recipe in `scripts/build-pi-runtime.mjs` verifies that no other third-party package contributes output bytes.
4
4
 
5
- ## @earendil-works/pi-ai 1.5.0
5
+ ## @earendil-works/pi-ai 1.6.0
6
6
 
7
- Upstream source: https://github.com/earendil-works/pi/tree/v1.5.0/packages/ai
7
+ Upstream source: https://github.com/earendil-works/pi/tree/v1.6.0/packages/ai
8
8
 
9
9
  Included public Responses helpers and model catalogs:
10
10
 
11
11
  - `api/openai-responses-shared`
12
12
  - `api/constrained-sampling`
13
13
  - `api/openai-prompt-cache`
14
+ - `api/simple-options`
15
+ - `utils/diagnostics`
16
+ - `utils/estimate`
14
17
  - `utils/event-stream`
15
18
  - `utils/transcript`
16
19
  - model helpers from the package root
package/lib/client.js CHANGED
@@ -902,6 +902,40 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
902
902
  function tokenCount(value) {
903
903
  return String(value);
904
904
  }
905
+ function isSafeCount(value) {
906
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
907
+ }
908
+ function promptCacheHitRate(usage) {
909
+ if (!object(usage)) return null;
910
+ const cacheReadTokens = usage.cacheReadTokens;
911
+ if (!isSafeCount(cacheReadTokens)) return null;
912
+ let promptTokens;
913
+ if (usage.totalTokens !== void 0) {
914
+ if (!isSafeCount(usage.totalTokens) || !isSafeCount(usage.outputTokens)) return null;
915
+ if (usage.totalTokens < usage.outputTokens) return null;
916
+ promptTokens = usage.totalTokens - usage.outputTokens;
917
+ const hasUncached = usage.uncachedInputTokens !== void 0;
918
+ const hasWrite = usage.cacheWriteTokens !== void 0;
919
+ if (hasUncached && !isSafeCount(usage.uncachedInputTokens)) return null;
920
+ if (hasWrite && !isSafeCount(usage.cacheWriteTokens)) return null;
921
+ const knownPrompt = BigInt(hasUncached ? usage.uncachedInputTokens : 0) + BigInt(cacheReadTokens) + BigInt(hasWrite ? usage.cacheWriteTokens : 0);
922
+ if (knownPrompt > BigInt(promptTokens)) return null;
923
+ } else {
924
+ if (!isSafeCount(usage.uncachedInputTokens)) return null;
925
+ if (usage.cacheWriteTokens !== void 0 && !isSafeCount(usage.cacheWriteTokens)) return null;
926
+ const sum = BigInt(usage.uncachedInputTokens) + BigInt(cacheReadTokens) + BigInt(usage.cacheWriteTokens ?? 0);
927
+ if (sum > BigInt(Number.MAX_SAFE_INTEGER)) return null;
928
+ promptTokens = Number(sum);
929
+ }
930
+ if (promptTokens <= 0 || cacheReadTokens > promptTokens) return null;
931
+ if (cacheReadTokens === promptTokens) {
932
+ return { percent: 100, cacheReadTokens, promptTokens };
933
+ }
934
+ const numerator = BigInt(cacheReadTokens);
935
+ const denominator = BigInt(promptTokens);
936
+ const rounded = Number((numerator * 100n + denominator / 2n) / denominator);
937
+ return { percent: rounded >= 100 ? 99 : rounded, cacheReadTokens, promptTokens };
938
+ }
905
939
  function recordsTotal(records) {
906
940
  let total = 0;
907
941
  for (const record2 of records) {
@@ -932,9 +966,30 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
932
966
  title: `${label}: ${tokenCount(total)}`
933
967
  }, `${label}: ${tokenCount(total)}`);
934
968
  }
969
+ function cacheHitView(createElement, usage, t) {
970
+ const rate = promptCacheHitRate(usage);
971
+ if (!rate) return null;
972
+ const label = t?.("cacheHitTurn") ?? "Cache";
973
+ const titleLabel = t?.("cacheHitTurnTitle") ?? "Prompt cache hit rate";
974
+ return createElement("span", {
975
+ className: "lcx-cache-hit lcx-cache-hit-turn",
976
+ "data-lcx-cache-hit": "turn",
977
+ title: `${titleLabel}: ${rate.percent}% (${tokenCount(rate.cacheReadTokens)} / ${tokenCount(rate.promptTokens)})`
978
+ }, `${label} ${rate.percent}%`);
979
+ }
935
980
  function TurnTailUsage({ turn, t }, createElement) {
936
981
  if (!createElement) return null;
937
- return usageView(createElement, "turn", recordsTotal(turn.data.get("lcx-search-usage") ?? []), t);
982
+ const rawSearch = turn?.data?.get?.("lcx-search-usage");
983
+ const searchEl = usageView(createElement, "turn", recordsTotal(Array.isArray(rawSearch) ? rawSearch : []), t);
984
+ const rawTail = turn?.data?.get?.("turn-tail");
985
+ const cacheEl = cacheHitView(createElement, object(rawTail) ? rawTail.tokenUsage : void 0, t);
986
+ if (searchEl && cacheEl) {
987
+ return createElement("span", {
988
+ className: "lcx-turn-usage",
989
+ "data-lcx-turn-usage": "turn"
990
+ }, searchEl, cacheEl);
991
+ }
992
+ return searchEl ?? cacheEl ?? null;
938
993
  }
939
994
  function SessionUsage({ useProjection, t }, createElement) {
940
995
  if (!createElement) return null;
@@ -992,12 +1047,13 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
992
1047
  "grokNativeWebSearch",
993
1048
  "grokNativeXSearch",
994
1049
  "searchMediaPreview",
995
- "incrementalToolUpdates"
1050
+ "incrementalToolUpdates",
1051
+ "gatewayCompatibilityFallback"
996
1052
  ];
997
1053
  const DEFAULTS = Object.fromEntries(
998
1054
  FIELDS.map((field) => [field, field === "incrementalToolUpdates"])
999
1055
  );
1000
- const css = `.lcx-card{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;list-style:none}.lcx-head{width:100%;display:flex;justify-content:space-between;padding:14px 16px;border:0;background:transparent;color:inherit}.lcx-body{border-top:1px solid var(--dsw-alias-border-l2);padding:12px 16px}.lcx-row{display:flex;gap:9px;padding:8px 0}.lcx-row small,.lcx-help{display:block;font-size:12px;line-height:17px;color:var(--dsw-alias-label-tertiary)}.lcx-group{border-top:1px solid var(--dsw-alias-border-l2);margin-top:10px;padding-top:14px}.lcx-group strong{font-size:14px}.lcx-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.lcx-foot button{padding:6px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:inherit}.lcx-search-usage{display:inline-flex;align-items:center;gap:4px;margin:2px 0;color:var(--dsw-alias-label-tertiary);font:12px/18px system-ui}.lcx-search-usage-session{padding:0 4px}.lcx-search-usage-turn{padding:0 6px}` + inlineMediaCss + nativeMarkdownImageCss;
1056
+ const css = `.lcx-card{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;list-style:none}.lcx-head{width:100%;display:flex;justify-content:space-between;padding:14px 16px;border:0;background:transparent;color:inherit}.lcx-body{border-top:1px solid var(--dsw-alias-border-l2);padding:12px 16px}.lcx-row{display:flex;gap:9px;padding:8px 0}.lcx-row small,.lcx-help{display:block;font-size:12px;line-height:17px;color:var(--dsw-alias-label-tertiary)}.lcx-group{border-top:1px solid var(--dsw-alias-border-l2);margin-top:10px;padding-top:14px}.lcx-group strong{font-size:14px}.lcx-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.lcx-foot button{padding:6px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:inherit}.lcx-turn-usage{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px}.lcx-search-usage,.lcx-cache-hit{display:inline-flex;align-items:center;gap:4px;margin:2px 0;color:var(--dsw-alias-label-tertiary);font:12px/18px system-ui;font-variant-numeric:tabular-nums}.lcx-search-usage-session{padding:0 4px}.lcx-search-usage-turn{padding:0 6px}.lcx-cache-hit-turn{padding:0 7px;border-radius:var(--dsw-radius-sm,6px);background:var(--dsw-alias-interactive-bg-hover,transparent)}` + inlineMediaCss + nativeMarkdownImageCss;
1001
1057
  function mountCss() {
1002
1058
  if (typeof document === "undefined") return () => {
1003
1059
  };
@@ -1025,6 +1081,8 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
1025
1081
  alphaHelp: "\u4EC5 capability probe \u5BF9\u5F53\u524D route/schema \u9A8C\u8BC1\u901A\u8FC7\u540E\u624D\u771F\u6B63\u6CE8\u518C\u3002",
1026
1082
  tools: "\u589E\u91CF\u5DE5\u5177\u66F4\u65B0\uFF08addition-only\uFF09",
1027
1083
  toolsHelp: "\u4F1A\u8BDD\u4E2D\u9014\u65B0\u589E\u5DE5\u5177\u65F6\u4FDD\u6301\u8BF7\u6C42\u524D\u7F00\u4E0D\u53D8\u4EE5\u4FDD\u62A4 prompt \u7F13\u5B58\uFF0C\u65B0\u589E\u5DE5\u5177\u4F5C\u4E3A\u5386\u53F2\u9879\u58F0\u660E\u3002\u4EC5\u5BF9\u652F\u6301\u7684 GPT Responses \u6A21\u578B\u751F\u6548\uFF1B\u5173\u95ED\u540E\u6BCF\u6B21\u8BF7\u6C42\u53D1\u9001\u5B8C\u6574\u5DE5\u5177\u5217\u8868\uFF08\u56DE\u9000\u6216\u5BF9\u7167\u7528\uFF09\u3002\u5220\u9664\u6216\u4FEE\u6539\u5DE5\u5177\u4ECD\u4F1A\u91CD\u7F6E\u4E00\u6B21\u7F13\u5B58\u3002",
1084
+ gatewayCompatibility: "\u7F51\u5173\u517C\u5BB9\u56DE\u9000\uFF08\u6807\u51C6 tools / reasoning.effort\uFF09",
1085
+ gatewayCompatibilityHelp: "\u9ED8\u8BA4\u5173\u95ED\uFF0C\u4E0E DSH \u5BBF\u4E3B\u8BF7\u6C42\u683C\u5F0F\u4FDD\u6301\u4E00\u81F4\u3002\u4EC5\u5F53\u4E0A\u6E38\u7F51\u5173\u62D2\u7EDD\u6216\u4E22\u5F03\u7EAF additional_tools \u58F0\u660E\u6216 configuration_update \u5386\u53F2\u9879\u65F6\u5F00\u542F\uFF0C\u56DE\u9000\u4E3A\u6BCF\u8F6E\u53D1\u9001\u6807\u51C6\u9876\u5C42 tools \u6570\u7EC4\u4E0E reasoning.effort \u5B57\u6BB5\u3002",
1028
1086
  mediaPreview: "\u641C\u7D22\u5A92\u4F53\u9884\u89C8",
1029
1087
  mediaPreviewHelp: "\u5728\u56DE\u7B54\u4E0B\u65B9\u663E\u793A\u641C\u7D22\u8FD4\u56DE\u7684\u56FE\u7247\u3001\u56DE\u7B54\u91CC\u7684\u56FE\u7247\u76F4\u94FE\uFF0C\u4EE5\u53CA\u53EF\u76F4\u63A5\u64AD\u653E\u7684\u89C6\u9891\u76F4\u94FE\uFF1B\u70B9\u51FB\u653E\u5927\u6216\u64AD\u653E\u3002\u56DE\u7B54\u6B63\u6587\u91CC\u7684 Markdown \u56FE\u7247\u7531 DSH \u539F\u751F\u6E32\u67D3\uFF0C\u666E\u901A\u7F51\u9875\u94FE\u63A5\u4FDD\u6301\u4E3A\u94FE\u63A5\u3002\u6B64\u8BBE\u7F6E\u53EA\u6539\u53D8\u754C\u9762\u663E\u793A\u3002",
1030
1088
  mediaTitle: "\u89C6\u9891\u9884\u89C8",
@@ -1040,6 +1098,8 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
1040
1098
  mediaOpen: "\u6253\u5F00\u539F\u59CB\u5A92\u4F53",
1041
1099
  usageTurn: "\u672C\u8F6E\u641C\u7D22\u7528\u91CF",
1042
1100
  usageSession: "\u641C\u7D22\u7528\u91CF",
1101
+ cacheHitTurn: "\u7F13\u5B58\u547D\u4E2D",
1102
+ cacheHitTurnTitle: "\u672C\u8F6E\u63D0\u793A\u8BCD\u7F13\u5B58\u547D\u4E2D\u7387",
1043
1103
  grokTitle: "Grok \u539F\u751F\u641C\u7D22",
1044
1104
  grokDesc: "\u4F7F\u7528 DSH \u5F53\u524D\u9009\u62E9\u7684 Grok \u6A21\u578B\u53CA\u5176\u670D\u52A1\u914D\u7F6E\uFF1B\u4E0E GPT \u529F\u80FD\u5F00\u5173\u72EC\u7ACB\u3002\u5F00\u542F\u4EFB\u4E00\u641C\u7D22\u540E\uFF0CGrok \u4EC5\u4F7F\u7528\u539F\u751F\u641C\u7D22\uFF0C\u7F51\u9875\u8BFB\u53D6\u548C\u5176\u4ED6\u5DE5\u5177\u4ECD\u53EF\u7528\u3002",
1045
1105
  grokWeb: "\u542F\u7528\u539F\u751F Web Search",
@@ -1065,6 +1125,8 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
1065
1125
  alphaHelp: "Registered only after a matching capability probe.",
1066
1126
  tools: "Incremental tool updates (addition-only)",
1067
1127
  toolsHelp: "When a tool is added mid-session, keep the request prefix unchanged to protect the prompt cache; the new tool is declared in history. Applies only to supporting GPT Responses models. Off sends the complete tool list on every request (rollback or comparison). Removing or redefining a tool still resets the cache once.",
1128
+ gatewayCompatibility: "Gateway compatibility fallback (standard tools / reasoning.effort)",
1129
+ gatewayCompatibilityHelp: "Off by default for exact DSH host parity. Enable only for gateways that reject or drop additional_tools-only declarations or configuration_update items, falling back to standard top-level tools and reasoning.effort wire fields.",
1068
1130
  mediaPreview: "Search media previews",
1069
1131
  mediaPreviewHelp: "Show images returned by search, direct image links in the answer and directly playable video links below the answer; click to enlarge or play. Markdown images in the answer are rendered natively by DSH, and ordinary page links stay links. This setting changes presentation only.",
1070
1132
  mediaTitle: "Video preview",
@@ -1080,6 +1142,8 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
1080
1142
  mediaOpen: "Open original media",
1081
1143
  usageTurn: "Turn search usage",
1082
1144
  usageSession: "Search usage",
1145
+ cacheHitTurn: "Cache",
1146
+ cacheHitTurnTitle: "Prompt cache hit rate",
1083
1147
  grokTitle: "Grok native search",
1084
1148
  grokDesc: "Uses the Grok model and provider profile currently selected in DSH, independently of the GPT switch. When either search is enabled, Grok uses native search while page reading and other tools remain available.",
1085
1149
  grokWeb: "Enable native Web Search",
@@ -1443,6 +1507,14 @@ a.lcx-media-chip:hover{text-decoration:underline;text-underline-offset:2px}
1443
1507
  disabled,
1444
1508
  onChange: (value) => props.edit("incrementalToolUpdates", value)
1445
1509
  }),
1510
+ React.createElement(Row, {
1511
+ id: "lcx-gateway-compatibility",
1512
+ label: t("gatewayCompatibility"),
1513
+ help: t("gatewayCompatibilityHelp"),
1514
+ checked: s.gatewayCompatibilityFallback.value,
1515
+ disabled,
1516
+ onChange: (value) => props.edit("gatewayCompatibilityFallback", value)
1517
+ }),
1446
1518
  React.createElement(
1447
1519
  "section",
1448
1520
  { className: "lcx-group" },
package/lib/compact-v2.js CHANGED
@@ -30,7 +30,7 @@ export function responsesGenerationEnvelope(controls = {}) {
30
30
  maxTokens: controls.maxTokens,
31
31
  });
32
32
  }
33
- export function buildNativeCompactionBody({ model, modelDescriptor, input, tools, promptCacheKey, promptCacheRetention, cacheRetention, reasoningEffort, temperature, maxTokens, }) {
33
+ export function buildNativeCompactionBody({ model, modelDescriptor, input, tools, promptCacheKey, promptCacheRetention, cacheRetention, reasoningEffort, temperature, maxTokens, gatewayCompatibilityFallback, omitUnsupportedFields, apiKey, }) {
34
34
  return buildCompactionResponsesBody({
35
35
  model: modelDescriptor ?? model,
36
36
  input,
@@ -42,6 +42,9 @@ export function buildNativeCompactionBody({ model, modelDescriptor, input, tools
42
42
  reasoningEffort,
43
43
  temperature,
44
44
  maxTokens,
45
+ gatewayCompatibilityFallback,
46
+ omitUnsupportedFields,
47
+ apiKey,
45
48
  });
46
49
  }
47
50
  /**
@@ -206,7 +209,7 @@ export async function parseNativeCompactionSse(response, options = {}) {
206
209
  usage: usageFrom(terminal.usage),
207
210
  };
208
211
  }
209
- export async function requestNativeCompaction({ baseURL, model, modelDescriptor, input, tools, promptCacheKey, promptCacheRetention, cacheRetention, reasoningEffort, temperature, maxTokens, idempotencyKey, headers, signal, timeoutMs, maxAttempts, maxResponseBytes, }) {
212
+ export async function requestNativeCompaction({ baseURL, model, modelDescriptor, input, tools, promptCacheKey, promptCacheRetention, cacheRetention, reasoningEffort, temperature, maxTokens, gatewayCompatibilityFallback, omitUnsupportedFields, apiKey, idempotencyKey, headers, signal, timeoutMs, maxAttempts, maxResponseBytes, }) {
210
213
  const body = buildNativeCompactionBody({
211
214
  model,
212
215
  modelDescriptor,
@@ -218,6 +221,9 @@ export async function requestNativeCompaction({ baseURL, model, modelDescriptor,
218
221
  reasoningEffort,
219
222
  temperature,
220
223
  maxTokens,
224
+ gatewayCompatibilityFallback,
225
+ omitUnsupportedFields,
226
+ apiKey,
221
227
  });
222
228
  const requestHeaders = mergeFeatureHeader({
223
229
  ...headers,
package/lib/defaults.js CHANGED
@@ -12,4 +12,5 @@ export const DEFAULTS = Object.freeze({
12
12
  nativeRetentionTokenBudget: 64_000,
13
13
  assistantRetentionTokenReserve: 24_000,
14
14
  assistantRetentionPerMessageTokenCap: 3_000,
15
+ gatewayCompatibilityFallback: false,
15
16
  });