@eddyskywalker/dsh-chatgpt-subscription 0.48.3 → 0.49.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/CHANGELOG.md +21 -0
- package/lib/client.js +2381 -179
- package/lib/client.js.map +1 -1
- package/lib/index.js +875 -33
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/kimi-code/locales.d.ts +14 -2
- package/lib/types/client/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
- package/lib/types/client/subagent/SubagentCard.d.ts +35 -0
- package/lib/types/client/subagent/SubagentCard.d.ts.map +1 -0
- package/lib/types/client/subagent/index.d.ts +28 -0
- package/lib/types/client/subagent/index.d.ts.map +1 -0
- package/lib/types/client/subagent/locales.d.ts +172 -0
- package/lib/types/client/subagent/locales.d.ts.map +1 -0
- package/lib/types/client/subagent/styles.d.ts +20 -0
- package/lib/types/client/subagent/styles.d.ts.map +1 -0
- package/lib/types/client/subagent/subagent-card-controller.d.ts +329 -0
- package/lib/types/client/subagent/subagent-card-controller.d.ts.map +1 -0
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/common/llm-compat.d.ts +3 -1
- package/lib/types/host/common/llm-compat.d.ts.map +1 -1
- package/lib/types/host/common/request-images.d.ts +66 -0
- package/lib/types/host/common/request-images.d.ts.map +1 -1
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts +53 -3
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/kimi-code/session-cache-state.d.ts +14 -0
- package/lib/types/host/kimi-code/session-cache-state.d.ts.map +1 -1
- package/lib/types/host/kimi-code/types.d.ts +29 -4
- package/lib/types/host/kimi-code/types.d.ts.map +1 -1
- package/lib/types/host/preferences.d.ts.map +1 -1
- package/lib/types/host/routes.d.ts.map +1 -1
- package/lib/types/host/subagent-model-authorization.d.ts +130 -2
- package/lib/types/host/subagent-model-authorization.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +28 -0
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +10 -1
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/preferences.d.ts +52 -1
- package/lib/types/shared/preferences.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.49.0 - 2026-10-31
|
|
6
|
+
|
|
7
|
+
- **[kimi-code] 图片预算对齐原生 `kimi-cli`(20 MiB 高水位 / 10 MiB 低水位)并实现会话级粘性淘汰(Closes #79)**
|
|
8
|
+
- **预算提升与双水位迟滞**:`DEFAULT_MAX_REQUEST_IMAGE_BYTES` 从 2 MB 时代的 `1.5 MB` 提升至对齐原生 `kimi-cli`(`REQUEST_MEDIA_BUDGET_BYTES`)的 `20 MiB`(`20,971,520` bytes),触发淘汰时的恢复低水位设为 `10 MiB`(`10,485,760` bytes);支持 `DSH_KIMI_CODE_MAX_IMAGE_BYTES` 环境变量覆盖(自动以其 50% 作为恢复低水位)。保持 `src/host/common/request-images.ts` 的共享默认常量 `1,500,000` 不变,不影响其他线路。
|
|
9
|
+
- **会话级粘性淘汰(`budgetDropped`)与持久化**:新增图片身份标识 `requestImageKey`(`attachment:<id>` 或 `inline:<sha256>`)与 `offloadRequestImagesWithStickyBudget`。一旦某张旧图因超预算被替换为占位文本,该会话后续请求始终将其替换为占位文本,不再随每张新图进入而反复重算淘汰集合、打断前缀缓存;淘汰集合同步持久化到 `sessionCacheState`(`dsh-chatgpt-subscription-kimi-cache.json`),跨进程重启后依然保持稳定。
|
|
10
|
+
- **前缀漂移归因与设置页展示**:`KimiCodeCacheStatsDto['lastDrift']` 新增 `'image-offload'`(当本轮新淘汰了历史图片且前缀原本为 `'stable'` 时归因为「旧图片超预算淘汰(缓存重建)」);Kimi 设置页「缓存与 K3 调优」卡片新增「请求图片预算」行展示本轮图片体积、预算上限及低水位/已粘性淘汰张数(中/英/俄三语字典同步补齐)。
|
|
11
|
+
|
|
12
|
+
- **[subagent] 支持按主模型分别配置子代理模型白名单与运行时鉴权**
|
|
13
|
+
- 设置页「子代理模型授权」卡片支持为不同主模型绑定各自允许派发的子代理模型列表,并在运行时路由守卫中按当前会话主模型精确解析与校验白名单。
|
|
14
|
+
|
|
15
|
+
## 0.48.4 - 2026-10-31
|
|
16
|
+
|
|
17
|
+
- **[llm-compat] 修复 `role: 'tool'` 消息的 `toolCallId` 读错位置:整轮请求被判 `11148 tool calls and tool results do not match`**
|
|
18
|
+
- **现象**:某条线路的会话在第 N 轮整轮失败,网关报 `11148` / "tool calls and tool results do not match",同一条会话重试也无效。工具其实都执行完了,结果也都在历史里。
|
|
19
|
+
- **根因**:`normalizeMessages()` 只从消息顶层 `raw.toolCallId` 与 `source.callId` 取调用 id。harness 把结果 id 放在**消息体里的 `tool-result` 块**上时(`{ role: 'tool', content: [{ type: 'tool-result', toolCallId }], source: { kind: 'tool' } }`),两处都取不到,`callId` 退成空串。
|
|
20
|
+
- **连锁**:① mapper 发出 `tool_call_id: ""`,结果成孤儿;② `fillMissingToolResults()` 用 `tool_call_id` 建"已作答"集合,空串匹配不上任何真实 id,于是判定每个调用都没有结果,为每一个补一条伪造的 `[no result: the tool call did not complete]`;③ 网关看到"声明了 N 个调用、回来的全是空 id 且多出 N 条无主占位",直接拒绝整单。
|
|
21
|
+
- **两个附加缺陷**(同一次修复):路由用 `??` 串联,**空串不会被跳过**,一个空的 `raw.toolCallId` 会遮住 `source.callId` 里的真 id;消息体里已经带着 `tool-result` 块时,重包装会再套一层,让网关看到一个"内容是另一个 result"的 result。
|
|
22
|
+
- **修法**(`src/host/common/llm-compat.ts`):新增 `firstNonEmptyString()` 按"第一个非空串"依次取 `raw.toolCallId` → `raw.callId` → `source.callId` → 消息体内 `tool-result` 块的 `toolCallId`;体内已带 result 块时复用其 `content` 而不是再包一层,`isError` 同时认消息级与块级两处。
|
|
23
|
+
- **影响面**:`normalizeMessages` 是 12 条线路共用的归一化入口(antigravity / command-code / ollama / kimi-code / minimax-code / workbuddy / claude / glm-coding-plan / step-code / cline-pass / qoder / responses-client),不是单条线路的补丁。三种形态取到真 id 后产出的归一化消息**逐字节相同**,老形态行为不变。
|
|
24
|
+
- **验证**:`test/llm-compat.test.ts` 新增 5 例——体内取 id、不重复包裹、空串不遮真 id、块级 `isError` 透传、无体内 block 时回落到消息级 id。**变异验证**:只回退 `src/host/common/llm-compat.ts`、保留新用例,4 例当场变红;恢复后 10 例全绿。`npm run typecheck` 三工程 0 错误;全量 `npx vitest run` **5730 passed / 15 skipped**,失败的 7 条(token-store-linux 3、token-store-macos 2、claude-oauth 1、glm-coding-plan-routes 1)在**未改动的干净工作树上同样失败**(`git stash` 验证),与本次无关。
|
|
25
|
+
|
|
5
26
|
## 0.48.3 - 2026-10-30
|
|
6
27
|
|
|
7
28
|
- **[WorkBuddy] 修复调整本地额度护栏时设置页白屏**
|