@eddyskywalker/dsh-chatgpt-subscription 0.13.1 → 0.13.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 +12 -0
- package/lib/index.js +240 -57
- package/lib/types/host/common/request-images.d.ts +22 -1
- 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 +22 -0
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.13.2 - 2026-10-08
|
|
6
|
+
|
|
7
|
+
- **[Kimi Code] 读图请求按「实际发送体积」计量,超限时回收而非直接拒绝**
|
|
8
|
+
- **报错 `Kimi Code rejected the request before sending: the serialized body is N bytes, above the 2097152-byte limit` 的根因是三处计量缺陷叠加,2 MB 网关上限本身没有问题**(那是 Kimi 文档里的真实限制,见其错误参考 `total message size N exceeds limit 2097152`)。
|
|
9
|
+
- **图片按「存储原始字节」计量,但发出去的是「缩放后的请求版本」。** `resolveRequestImages` 会把长边超过 1024px 的图缩到 `REQUEST_IMAGE_VERSION_MAX_BYTES`(256 KiB,与官方 CLI 的 `read_byte_budget` 同量级)后再内联,而预算是拿 `attachment.bytes` 算的。一张 5 MB 截图因此被记成 ~6.7 MB base64,判定超预算 5 MB 被丢弃——可它真正上线时只有 ~350 KB,四张都装得下。官方 CLI 的做法是「送达模型前自动降采样并重新编码,避免供应商因图片过大而报错」,语义相同:**量的必须是送出去的那个版本**。现在先解析、再按解析后的真实 base64 长度计量。
|
|
10
|
+
- **工具结果里的图片从未被计入预算。** `collectRequestImageBytes` 只遍历顶层 block,不递归 `tool-result`,而 `toolResultBlocks` 是会发送那里的图的。重度使用 `read_image` 的会话——也就是这个报错的典型场景——恰好系统性地少算了自己最占地方的图片。计数器现在与 `collectImageRefs` 一致地递归。
|
|
11
|
+
- **超限时只会拒绝,不会回收。** `assertRequestBodyFits` 量完超限就抛 `PROVIDER_ERROR`,而此时再丢一张图很可能就装得下了。现在改为:量真实请求体 → 按需丢最旧的图 → 重新构造 → 直到塞进上限,一张不多丢。已经装得下的请求只序列化一次,字节级不变。丢无可丢时才报错,文本与工具 schema 不会被静默丢弃。
|
|
12
|
+
- **报错区分「图太多」和「文本太多」。** 旧文案一律让用户去压缩会话,于是图片占主导的用户会被引向错误的 remedy。现在报出构成(`images N bytes, tool schemas N bytes, conversation text and system prompt N bytes`),并按主导项给处方:图主导提示少带图,文本主导才提示压缩会话。
|
|
13
|
+
- 测试:新增 `test/kimi-code-body-fit.test.ts`(8 例),逐条锁住上述行为。
|
|
14
|
+
- 验证:`tsc -b --pretty false` 与 `tsc -p test/tsconfig.json` 均 0 错误;全量 `vitest run` 2784 passed / 7 skipped。
|
|
15
|
+
- **未一并处理的**:workbuddy / command-code / claude / antigravity 四条线路各有自己的本地实现,同样存在「按存储字节计量」与「工具结果图片漏算」两个缺陷,但各自预算数字不同,需逐条评估而非照搬。
|
|
16
|
+
|
|
5
17
|
- **[Codex] 请求级图片总量上限,以及请求路径失败的 cause 链([#50](https://github.com/Aa728848/dsh-chatgpt-subscription/issues/50))**
|
|
6
18
|
- **codex 此前是全插件唯一没有请求级图片总量约束的线路。** 历史里的每张图片每轮都会被重新内联,请求体随读图数量单调增长;超过传输层能接受的体积后整轮失败。报告方的现场日志:≤4 MB 稳过、4~5 MB 掉到 3/10;合成复现里 ≥4 MB 全挂(`ERR_HTTP2_STREAM_ERROR: NGHTTP2_ENHANCE_YOUR_CALM`),≤3 MB 全过。这是**概率关系**而非硬阈值——报告者自己也标明了这一点,所以修的是「无上限」,不是「阈值是多少」。
|
|
7
19
|
- 现在按**最旧优先**把超出预算的图片替换为明确的占位文本。**预算在构造好的请求体上执行**,而不是在 `options.messages` 上:图片有两种到达方式,粘贴附件是 `{ type: 'image', attachment }` 块,而工具读取的本地图片是 `` 链接、由 `mapUserText` 在构造时才取回并内联;消息块级方案看不到第二种,且共享的 `offloadOldestRequestImages` 也不递归 `tool-result`。在构造后测量是唯一能覆盖全部形态的位置。
|
package/lib/index.js
CHANGED
|
@@ -9272,17 +9272,17 @@ function base64Length$4(bytes) {
|
|
|
9272
9272
|
return Math.ceil(bytes / 3) * 4;
|
|
9273
9273
|
}
|
|
9274
9274
|
/** Request payload one inline image block occupies, when it can be measured. */
|
|
9275
|
-
function requestImageBytes$
|
|
9275
|
+
function requestImageBytes$3(block) {
|
|
9276
9276
|
const attachment = attachmentOf$5(block);
|
|
9277
9277
|
if (attachment) return base64Length$4(attachment.bytes);
|
|
9278
9278
|
const inline = asString$17(block.data) || asString$17(block.base64);
|
|
9279
9279
|
return inline ? inline.length : void 0;
|
|
9280
9280
|
}
|
|
9281
|
-
function collectRequestImageBytes$
|
|
9281
|
+
function collectRequestImageBytes$3(content, lengths) {
|
|
9282
9282
|
if (!Array.isArray(content)) return;
|
|
9283
9283
|
for (const block of content) {
|
|
9284
9284
|
if (!isRecord$27(block) || block.type !== "image") continue;
|
|
9285
|
-
const bytes = requestImageBytes$
|
|
9285
|
+
const bytes = requestImageBytes$3(block);
|
|
9286
9286
|
if (bytes !== void 0) lengths.push(bytes);
|
|
9287
9287
|
}
|
|
9288
9288
|
}
|
|
@@ -9301,7 +9301,7 @@ function collectRequestImageBytes$4(content, lengths) {
|
|
|
9301
9301
|
*/
|
|
9302
9302
|
function offloadOldestRequestImages$4(options) {
|
|
9303
9303
|
const lengths = [];
|
|
9304
|
-
for (const message of options.messages) collectRequestImageBytes$
|
|
9304
|
+
for (const message of options.messages) collectRequestImageBytes$3(message.content, lengths);
|
|
9305
9305
|
const excess = lengths.reduce((sum, bytes) => sum + bytes, 0) - MAX_REQUEST_IMAGE_BYTES$4;
|
|
9306
9306
|
if (excess <= 0) return options;
|
|
9307
9307
|
let omitted = 0;
|
|
@@ -9317,7 +9317,7 @@ function offloadOldestRequestImages$4(options) {
|
|
|
9317
9317
|
let replaced = false;
|
|
9318
9318
|
const content = message.content.map((block) => {
|
|
9319
9319
|
if (remaining.count === 0 || !isRecord$27(block) || block.type !== "image") return block;
|
|
9320
|
-
if (requestImageBytes$
|
|
9320
|
+
if (requestImageBytes$3(block) === void 0) return block;
|
|
9321
9321
|
remaining.count -= 1;
|
|
9322
9322
|
replaced = true;
|
|
9323
9323
|
return {
|
|
@@ -13216,17 +13216,17 @@ function collectImageRefs$3(content, refs) {
|
|
|
13216
13216
|
function base64Length$3(bytes) {
|
|
13217
13217
|
return Math.ceil(bytes / 3) * 4;
|
|
13218
13218
|
}
|
|
13219
|
-
function requestImageBytes$
|
|
13219
|
+
function requestImageBytes$2(block) {
|
|
13220
13220
|
const attachment = attachmentOf$4(block);
|
|
13221
13221
|
if (attachment) return base64Length$3(attachment.bytes);
|
|
13222
13222
|
const inline = asString$15(block.data) || asString$15(block.base64);
|
|
13223
13223
|
return inline ? inline.length : void 0;
|
|
13224
13224
|
}
|
|
13225
|
-
function collectRequestImageBytes$
|
|
13225
|
+
function collectRequestImageBytes$2(content, lengths) {
|
|
13226
13226
|
if (!Array.isArray(content)) return;
|
|
13227
13227
|
for (const block of content) {
|
|
13228
13228
|
if (!isRecord$25(block) || block.type !== "image") continue;
|
|
13229
|
-
const bytes = requestImageBytes$
|
|
13229
|
+
const bytes = requestImageBytes$2(block);
|
|
13230
13230
|
if (bytes !== void 0) lengths.push(bytes);
|
|
13231
13231
|
}
|
|
13232
13232
|
}
|
|
@@ -13237,7 +13237,7 @@ function collectRequestImageBytes$3(content, lengths) {
|
|
|
13237
13237
|
*/
|
|
13238
13238
|
function offloadOldestRequestImages$3(options) {
|
|
13239
13239
|
const lengths = [];
|
|
13240
|
-
for (const message of options.messages) collectRequestImageBytes$
|
|
13240
|
+
for (const message of options.messages) collectRequestImageBytes$2(message.content, lengths);
|
|
13241
13241
|
const excess = lengths.reduce((sum, bytes) => sum + bytes, 0) - MAX_REQUEST_IMAGE_BYTES$3;
|
|
13242
13242
|
if (excess <= 0) return options;
|
|
13243
13243
|
let omitted = 0;
|
|
@@ -13253,7 +13253,7 @@ function offloadOldestRequestImages$3(options) {
|
|
|
13253
13253
|
let replaced = false;
|
|
13254
13254
|
const content = message.content.map((block) => {
|
|
13255
13255
|
if (remaining.count === 0 || !isRecord$25(block) || block.type !== "image") return block;
|
|
13256
|
-
if (requestImageBytes$
|
|
13256
|
+
if (requestImageBytes$2(block) === void 0) return block;
|
|
13257
13257
|
remaining.count -= 1;
|
|
13258
13258
|
replaced = true;
|
|
13259
13259
|
return {
|
|
@@ -20612,19 +20612,135 @@ function collectImageRefs$2(content, refs) {
|
|
|
20612
20612
|
function base64Length$2(bytes) {
|
|
20613
20613
|
return Math.ceil(bytes / 3) * 4;
|
|
20614
20614
|
}
|
|
20615
|
-
|
|
20615
|
+
/**
|
|
20616
|
+
* Base64 payload one image block contributes to the wire, or undefined when it
|
|
20617
|
+
* contributes none.
|
|
20618
|
+
*
|
|
20619
|
+
* This is the length of what is SENT, which is not the length of what is
|
|
20620
|
+
* STORED. Kimi's own client downsamples and re-encodes an oversized image before
|
|
20621
|
+
* delivery "to avoid the supplier erroring on an oversized image", and this route
|
|
20622
|
+
* does the same through `requestImageTarget`: a 5 MB screenshot reaches the
|
|
20623
|
+
* wire as a ~256 KiB request version. Measuring `attachment.bytes` therefore
|
|
20624
|
+
* over-counts every image that was scaled, and an image that fits comfortably
|
|
20625
|
+
* after scaling was reported as several megabytes over budget and dropped.
|
|
20626
|
+
*
|
|
20627
|
+
* With `images` supplied the measurement is exact. Without it the stored size is
|
|
20628
|
+
* the only estimate available, so it stays the fallback and every call site that
|
|
20629
|
+
* has no resolved map behaves exactly as before.
|
|
20630
|
+
*/
|
|
20631
|
+
function requestImagePayloadLength(block, images) {
|
|
20632
|
+
let data = asString$11(block.data) || asString$11(block.base64);
|
|
20633
|
+
const source = isRecord$19(block.source) ? block.source : void 0;
|
|
20634
|
+
if (!data && source) data = asString$11(source.data) || asString$11(source.base64);
|
|
20635
|
+
if (data?.startsWith("data:")) {
|
|
20636
|
+
const matched = data.match(/^data:([^;,]+);base64,(.*)$/s);
|
|
20637
|
+
if (matched) data = matched[2] ?? "";
|
|
20638
|
+
}
|
|
20639
|
+
if (data) return data.length;
|
|
20616
20640
|
const attachment = attachmentOf$3(block);
|
|
20617
|
-
if (attachment) return
|
|
20618
|
-
|
|
20619
|
-
|
|
20641
|
+
if (!attachment) return void 0;
|
|
20642
|
+
if (images === void 0) return base64Length$2(attachment.bytes);
|
|
20643
|
+
const resolved = images.get(attachment.attachmentId);
|
|
20644
|
+
return resolved?.kind === "inline" ? resolved.data.length : void 0;
|
|
20620
20645
|
}
|
|
20621
|
-
|
|
20646
|
+
/**
|
|
20647
|
+
* Collect every image occurrence in model request order, recursing into tool
|
|
20648
|
+
* results the way `collectImageRefs` does.
|
|
20649
|
+
*
|
|
20650
|
+
* RECURSION IS NOT OPTIONAL. A `read_image` result or a screenshot inside a tool
|
|
20651
|
+
* result carries its pixels to the wire — `toolResultBlocks` sends them — so an
|
|
20652
|
+
* earlier version that only looked at top-level blocks under-counted exactly the
|
|
20653
|
+
* images a tool-using session produces most of. The budget has to describe the
|
|
20654
|
+
* body that is actually built.
|
|
20655
|
+
*/
|
|
20656
|
+
function collectRequestImagePayloads(content, images, lengths) {
|
|
20622
20657
|
if (!Array.isArray(content)) return;
|
|
20623
20658
|
for (const block of content) {
|
|
20624
|
-
if (!isRecord$19(block)
|
|
20625
|
-
|
|
20626
|
-
|
|
20659
|
+
if (!isRecord$19(block)) continue;
|
|
20660
|
+
if (block.type === "image") {
|
|
20661
|
+
const bytes = requestImagePayloadLength(block, images);
|
|
20662
|
+
if (bytes !== void 0) lengths.push(bytes);
|
|
20663
|
+
continue;
|
|
20664
|
+
}
|
|
20665
|
+
if (block.type === "tool-result") collectRequestImagePayloads(block.content, images, lengths);
|
|
20666
|
+
}
|
|
20667
|
+
}
|
|
20668
|
+
/**
|
|
20669
|
+
* Wire-level base64 payload of each image occurrence one request carries, in the
|
|
20670
|
+
* order the request sends them, so index N is the Nth oldest image.
|
|
20671
|
+
*/
|
|
20672
|
+
function requestImagePayloadLengths(options, images) {
|
|
20673
|
+
const lengths = [];
|
|
20674
|
+
for (const message of options.messages) collectRequestImagePayloads(message.content, images, lengths);
|
|
20675
|
+
return lengths;
|
|
20676
|
+
}
|
|
20677
|
+
/** How many of the oldest occurrences must go to bring the total under `maxBytes`. */
|
|
20678
|
+
function imagesToOffloadCount(lengths, maxBytes) {
|
|
20679
|
+
const excess = lengths.reduce((sum, bytes) => sum + bytes, 0) - maxBytes;
|
|
20680
|
+
if (excess <= 0) return 0;
|
|
20681
|
+
let freed = 0;
|
|
20682
|
+
let omitted = 0;
|
|
20683
|
+
for (const bytes of lengths) {
|
|
20684
|
+
if (freed >= excess) break;
|
|
20685
|
+
freed += bytes;
|
|
20686
|
+
omitted += 1;
|
|
20627
20687
|
}
|
|
20688
|
+
return omitted;
|
|
20689
|
+
}
|
|
20690
|
+
/**
|
|
20691
|
+
* Replace the first `count` image occurrences with a visible placeholder,
|
|
20692
|
+
* recursing into tool results. Durable history is untouched; only the request
|
|
20693
|
+
* about to be sent changes.
|
|
20694
|
+
*/
|
|
20695
|
+
function replaceOldestRequestImages(options, count) {
|
|
20696
|
+
if (count <= 0) return options;
|
|
20697
|
+
const remaining = { count };
|
|
20698
|
+
const replaceIn = (content) => {
|
|
20699
|
+
if (!Array.isArray(content) || remaining.count === 0) return {
|
|
20700
|
+
content,
|
|
20701
|
+
replaced: false
|
|
20702
|
+
};
|
|
20703
|
+
let replaced = false;
|
|
20704
|
+
return {
|
|
20705
|
+
content: content.map((block) => {
|
|
20706
|
+
if (remaining.count === 0 || !isRecord$19(block)) return block;
|
|
20707
|
+
if (block.type === "image") {
|
|
20708
|
+
if (requestImagePayloadLength(block) === void 0) return block;
|
|
20709
|
+
remaining.count -= 1;
|
|
20710
|
+
replaced = true;
|
|
20711
|
+
return {
|
|
20712
|
+
type: "text",
|
|
20713
|
+
text: OMITTED_IMAGE_TEXT$2
|
|
20714
|
+
};
|
|
20715
|
+
}
|
|
20716
|
+
if (block.type === "tool-result" && Array.isArray(block.content)) {
|
|
20717
|
+
const inner = replaceIn(block.content);
|
|
20718
|
+
if (!inner.replaced) return block;
|
|
20719
|
+
replaced = true;
|
|
20720
|
+
return {
|
|
20721
|
+
...block,
|
|
20722
|
+
content: inner.content
|
|
20723
|
+
};
|
|
20724
|
+
}
|
|
20725
|
+
return block;
|
|
20726
|
+
}),
|
|
20727
|
+
replaced
|
|
20728
|
+
};
|
|
20729
|
+
};
|
|
20730
|
+
let changed = false;
|
|
20731
|
+
const messages = options.messages.map((message) => {
|
|
20732
|
+
const result = replaceIn(message.content);
|
|
20733
|
+
if (!result.replaced) return message;
|
|
20734
|
+
changed = true;
|
|
20735
|
+
return {
|
|
20736
|
+
...message,
|
|
20737
|
+
content: result.content
|
|
20738
|
+
};
|
|
20739
|
+
});
|
|
20740
|
+
return changed ? {
|
|
20741
|
+
...options,
|
|
20742
|
+
messages
|
|
20743
|
+
} : options;
|
|
20628
20744
|
}
|
|
20629
20745
|
/**
|
|
20630
20746
|
* Longest edge any image of this request may keep.
|
|
@@ -20684,41 +20800,22 @@ function requestImageTarget(ref, edge = REQUEST_IMAGE_MAX_EDGE) {
|
|
|
20684
20800
|
*
|
|
20685
20801
|
* Durable history is untouched; only the request about to be sent changes.
|
|
20686
20802
|
*/
|
|
20687
|
-
function offloadOldestRequestImages$2(options, maxBytes = MAX_REQUEST_IMAGE_BYTES$2) {
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20702
|
-
let replaced = false;
|
|
20703
|
-
const content = message.content.map((block) => {
|
|
20704
|
-
if (remaining.count === 0 || !isRecord$19(block) || block.type !== "image") return block;
|
|
20705
|
-
if (requestImageBytes$2(block) === void 0) return block;
|
|
20706
|
-
remaining.count -= 1;
|
|
20707
|
-
replaced = true;
|
|
20708
|
-
return {
|
|
20709
|
-
type: "text",
|
|
20710
|
-
text: OMITTED_IMAGE_TEXT$2
|
|
20711
|
-
};
|
|
20712
|
-
});
|
|
20713
|
-
return replaced ? {
|
|
20714
|
-
...message,
|
|
20715
|
-
content
|
|
20716
|
-
} : message;
|
|
20803
|
+
function offloadOldestRequestImages$2(options, maxBytes = MAX_REQUEST_IMAGE_BYTES$2, images) {
|
|
20804
|
+
return replaceOldestRequestImages(options, imagesToOffloadCount(requestImagePayloadLengths(options, images), maxBytes));
|
|
20805
|
+
}
|
|
20806
|
+
/**
|
|
20807
|
+
* Whether a request still carries at least one image the mapper can send.
|
|
20808
|
+
*
|
|
20809
|
+
* A request whose images have all been replaced by placeholders can no longer
|
|
20810
|
+
* shrink, which is what separates "drop more images" from "this body is too
|
|
20811
|
+
* large for a reason no image budget can fix".
|
|
20812
|
+
*/
|
|
20813
|
+
function requestHasSendableImage(options) {
|
|
20814
|
+
return options.messages.some((message) => {
|
|
20815
|
+
const content = message.content;
|
|
20816
|
+
if (!Array.isArray(content)) return false;
|
|
20817
|
+
return content.some((block) => isRecord$19(block) && block.type === "image");
|
|
20717
20818
|
});
|
|
20718
|
-
return {
|
|
20719
|
-
...options,
|
|
20720
|
-
messages
|
|
20721
|
-
};
|
|
20722
20819
|
}
|
|
20723
20820
|
/**
|
|
20724
20821
|
* Read every durable `{ type: 'image', attachment }` block one request carries.
|
|
@@ -21917,7 +22014,48 @@ function assertRequestBodyFits$1(body, carriesVideo = false) {
|
|
|
21917
22014
|
const bytes = Buffer.byteLength(serialized, "utf8");
|
|
21918
22015
|
const limit = carriesVideo ? MAX_VIDEO_MESSAGE_BODY_BYTES : MAX_MESSAGE_BODY_BYTES;
|
|
21919
22016
|
if (bytes <= limit) return serialized;
|
|
21920
|
-
throw new LlmError$1(
|
|
22017
|
+
throw new LlmError$1(oversizedBodyMessage(bytes, limit, body), "PROVIDER_ERROR");
|
|
22018
|
+
}
|
|
22019
|
+
function walkJson(value, visit) {
|
|
22020
|
+
if (Array.isArray(value)) {
|
|
22021
|
+
for (const item of value) walkJson(item, visit);
|
|
22022
|
+
return;
|
|
22023
|
+
}
|
|
22024
|
+
if (!isRecord$17(value)) return;
|
|
22025
|
+
visit(value);
|
|
22026
|
+
for (const nested of Object.values(value)) walkJson(nested, visit);
|
|
22027
|
+
}
|
|
22028
|
+
/**
|
|
22029
|
+
* Measure one already-serialized body by composition.
|
|
22030
|
+
*
|
|
22031
|
+
* Image payload is found structurally (a base64 `data:` URL or an Anthropic
|
|
22032
|
+
* base64 source) rather than by searching for a marker substring, so a user
|
|
22033
|
+
* message that happens to contain that text cannot inflate the image share.
|
|
22034
|
+
*/
|
|
22035
|
+
function requestBodyBreakdown(body, carriesVideo = false) {
|
|
22036
|
+
const serialized = JSON.stringify(body);
|
|
22037
|
+
const totalBytes = Buffer.byteLength(serialized, "utf8");
|
|
22038
|
+
let imageBytes = 0;
|
|
22039
|
+
walkJson(body, (node) => {
|
|
22040
|
+
const url = isRecord$17(node.image_url) ? asString$9(node.image_url.url) : void 0;
|
|
22041
|
+
if (url?.startsWith("data:")) {
|
|
22042
|
+
imageBytes += Buffer.byteLength(url, "utf8");
|
|
22043
|
+
return;
|
|
22044
|
+
}
|
|
22045
|
+
const source = isRecord$17(node.source) ? node.source : void 0;
|
|
22046
|
+
if (source && asString$9(source.data) !== void 0 && asString$9(source.media_type) !== void 0) imageBytes += Buffer.byteLength(asString$9(source.data) ?? "", "utf8");
|
|
22047
|
+
});
|
|
22048
|
+
const toolSchemaBytes = Buffer.byteLength(JSON.stringify(body.tools ?? []), "utf8");
|
|
22049
|
+
return {
|
|
22050
|
+
totalBytes,
|
|
22051
|
+
imageBytes,
|
|
22052
|
+
toolSchemaBytes,
|
|
22053
|
+
otherBytes: Math.max(0, totalBytes - imageBytes - toolSchemaBytes)
|
|
22054
|
+
};
|
|
22055
|
+
}
|
|
22056
|
+
function oversizedBodyMessage(bytes, limit, body) {
|
|
22057
|
+
const parts = requestBodyBreakdown(body);
|
|
22058
|
+
return `Kimi Code rejected the request before sending: the serialized body is ${bytes} bytes, above the ${limit}-byte limit this route enforces. Composition: ${`images ${parts.imageBytes} bytes, tool schemas ${parts.toolSchemaBytes} bytes, conversation text and system prompt ${parts.otherBytes} bytes`}. ${parts.imageBytes >= parts.otherBytes ? "Older images are omitted first; drop or re-attach fewer images, or start a new session." : "The conversation text and tool schemas dominate, so no image budget can fix this: compact the conversation or start a new session."}`;
|
|
21921
22059
|
}
|
|
21922
22060
|
function createStreamState$3(wire, sessionId) {
|
|
21923
22061
|
return {
|
|
@@ -22509,6 +22647,34 @@ function assertStreamComplete$3(state) {
|
|
|
22509
22647
|
//#endregion
|
|
22510
22648
|
//#region src/host/kimi-code/adapter.ts
|
|
22511
22649
|
/**
|
|
22650
|
+
* Rebuild attempts allowed while shrinking a request into its body ceiling.
|
|
22651
|
+
*
|
|
22652
|
+
* Each attempt drops at least one image, so the loop is bounded by the number of
|
|
22653
|
+
* images the request carries; this cap only exists so a future change that fails
|
|
22654
|
+
* to make progress fails fast instead of spinning.
|
|
22655
|
+
*/
|
|
22656
|
+
const MAX_BODY_FIT_ATTEMPTS = 64;
|
|
22657
|
+
/**
|
|
22658
|
+
* Drop the fewest oldest images that free at least `excessBytes`.
|
|
22659
|
+
*
|
|
22660
|
+
* `current` is the options the over-large body was built from, and `resolved`
|
|
22661
|
+
* supplies the post-scaling payload length of each occurrence, so the arithmetic
|
|
22662
|
+
* is made of the bytes the wire actually carries rather than of stored sizes.
|
|
22663
|
+
*/
|
|
22664
|
+
function dropOldestImagesUntilFits(current, resolved, excessBytes, baseline) {
|
|
22665
|
+
const lengths = requestImagePayloadLengths(baseline, resolved);
|
|
22666
|
+
const alreadyDropped = countOmitted(current, baseline);
|
|
22667
|
+
const additional = imagesToOffloadCount(lengths.slice(alreadyDropped), excessBytes);
|
|
22668
|
+
if (additional === 0) return current;
|
|
22669
|
+
return replaceOldestRequestImages(current, additional);
|
|
22670
|
+
}
|
|
22671
|
+
/** How many image occurrences `current` has already had replaced, versus `baseline`. */
|
|
22672
|
+
function countOmitted(current, baseline) {
|
|
22673
|
+
const before = requestImagePayloadLengths(baseline).length;
|
|
22674
|
+
const after = requestImagePayloadLengths(current).length;
|
|
22675
|
+
return Math.max(0, before - after);
|
|
22676
|
+
}
|
|
22677
|
+
/**
|
|
22512
22678
|
* Transient-failure retry policy for the `kimi-code` route.
|
|
22513
22679
|
*
|
|
22514
22680
|
* Kimi Code fronts the model providers, so a call can fail with a 502/503/504
|
|
@@ -22846,8 +23012,10 @@ var KimiCodeAdapter = class extends LlmAdapter {
|
|
|
22846
23012
|
const catalog = await this.catalog().catch(() => []);
|
|
22847
23013
|
const wire = wireForCatalogEntry(options.model, catalog);
|
|
22848
23014
|
const entry = catalog.find((model) => model.id === options.model);
|
|
22849
|
-
const
|
|
22850
|
-
const
|
|
23015
|
+
const normalized = normalizeGenerateOptions(options);
|
|
23016
|
+
const images = await resolveRequestImages$2(normalized, this.options.attachments, signal);
|
|
23017
|
+
const requestOptions = offloadOldestRequestVideos(offloadOldestRequestImages$2(normalized, MAX_REQUEST_IMAGE_BYTES$2, images), MAX_REQUEST_VIDEO_BYTES$1);
|
|
23018
|
+
const videos = await resolveRequestVideos(requestOptions, this.options.videos, signal);
|
|
22851
23019
|
const settings = await this.settings();
|
|
22852
23020
|
const media = {
|
|
22853
23021
|
videos,
|
|
@@ -22859,10 +23027,25 @@ var KimiCodeAdapter = class extends LlmAdapter {
|
|
|
22859
23027
|
const requestedMax = options.maxTokens ?? maxOutputTokensFor$3(options.model, contextWindow);
|
|
22860
23028
|
const inputCap = maxInputTokensForEntry(options.model, catalog);
|
|
22861
23029
|
const promptLimit = inputCap === void 0 ? contextWindow : Math.min(contextWindow, inputCap);
|
|
22862
|
-
const
|
|
23030
|
+
const boundedOptions = {
|
|
22863
23031
|
...requestOptions,
|
|
22864
23032
|
maxTokens: clampOutputToContext$1(requestedMax, promptLimit, estimatedInputTokens(requestOptions))
|
|
22865
|
-
}
|
|
23033
|
+
};
|
|
23034
|
+
const carriesVideo = requestHasVideo(requestOptions);
|
|
23035
|
+
const bodyLimit = carriesVideo ? MAX_VIDEO_MESSAGE_BODY_BYTES : MAX_MESSAGE_BODY_BYTES;
|
|
23036
|
+
let buildOptions = boundedOptions;
|
|
23037
|
+
let body = "";
|
|
23038
|
+
for (let attempt = 0;; attempt++) {
|
|
23039
|
+
const built = buildRequest(buildOptions, wire, images, void 0, media);
|
|
23040
|
+
body = JSON.stringify(built);
|
|
23041
|
+
const bytes = Buffer.byteLength(body, "utf8");
|
|
23042
|
+
if (bytes <= bodyLimit) break;
|
|
23043
|
+
if (attempt > MAX_BODY_FIT_ATTEMPTS || !requestHasSendableImage(buildOptions)) {
|
|
23044
|
+
assertRequestBodyFits$1(built, carriesVideo);
|
|
23045
|
+
throw new Error("unreachable: assertRequestBodyFits returns or throws");
|
|
23046
|
+
}
|
|
23047
|
+
buildOptions = dropOldestImagesUntilFits(buildOptions, images, bytes - bodyLimit, requestOptions);
|
|
23048
|
+
}
|
|
22866
23049
|
const pool = this.accountPool;
|
|
22867
23050
|
const tried = /* @__PURE__ */ new Set();
|
|
22868
23051
|
let servedByAccountId;
|
|
@@ -64,6 +64,19 @@ export declare const MAX_REQUEST_VIDEO_BYTES: number;
|
|
|
64
64
|
/** Media types both upstream wires accept as inline base64. */
|
|
65
65
|
export declare const SUPPORTED_IMAGE_MEDIA_TYPES: Set<string>;
|
|
66
66
|
export declare function attachmentLabel(block: Record<string, unknown>): string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Wire-level base64 payload of each image occurrence one request carries, in the
|
|
69
|
+
* order the request sends them, so index N is the Nth oldest image.
|
|
70
|
+
*/
|
|
71
|
+
export declare function requestImagePayloadLengths(options: GenerateOptions, images?: ResolvedRequestImages): number[];
|
|
72
|
+
/** How many of the oldest occurrences must go to bring the total under `maxBytes`. */
|
|
73
|
+
export declare function imagesToOffloadCount(lengths: readonly number[], maxBytes: number): number;
|
|
74
|
+
/**
|
|
75
|
+
* Replace the first `count` image occurrences with a visible placeholder,
|
|
76
|
+
* recursing into tool results. Durable history is untouched; only the request
|
|
77
|
+
* about to be sent changes.
|
|
78
|
+
*/
|
|
79
|
+
export declare function replaceOldestRequestImages(options: GenerateOptions, count: number): GenerateOptions;
|
|
67
80
|
/**
|
|
68
81
|
* Longest edge any image of this request may keep.
|
|
69
82
|
*
|
|
@@ -101,7 +114,15 @@ export declare function requestImageTarget(ref: ImageAttachmentRef, edge?: numbe
|
|
|
101
114
|
*
|
|
102
115
|
* Durable history is untouched; only the request about to be sent changes.
|
|
103
116
|
*/
|
|
104
|
-
export declare function offloadOldestRequestImages(options: GenerateOptions, maxBytes?: number): GenerateOptions;
|
|
117
|
+
export declare function offloadOldestRequestImages(options: GenerateOptions, maxBytes?: number, images?: ResolvedRequestImages): GenerateOptions;
|
|
118
|
+
/**
|
|
119
|
+
* Whether a request still carries at least one image the mapper can send.
|
|
120
|
+
*
|
|
121
|
+
* A request whose images have all been replaced by placeholders can no longer
|
|
122
|
+
* shrink, which is what separates "drop more images" from "this body is too
|
|
123
|
+
* large for a reason no image budget can fix".
|
|
124
|
+
*/
|
|
125
|
+
export declare function requestHasSendableImage(options: GenerateOptions): boolean;
|
|
105
126
|
/**
|
|
106
127
|
* Read every durable `{ type: 'image', attachment }` block one request carries.
|
|
107
128
|
* An unreadable image resolves to `unavailable` rather than disappearing, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-images.d.ts","sourceRoot":"","sources":["../../../../src/host/common/request-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,kB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A4B;gBAGrC,KAAK,sBAA4B,EACjC,aAAa,yBAA+B,EAC5C,WAAW,CAAC,EAAE,uBAAuB,YAAA,EACrC,OAAO,GAAE,sBAA2B,EACrD,WAAW,CAAC,EAAE,mBAAmB;IAMnC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAI/C,mBAAmB,IAAI,mBAAmB;IAI1C,mBAAmB,IAAI,SAAS;IAIhC,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;YACW,OAAO;IA0BrB,OAAO,CAAC,gBAAgB;IAUlB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAmB/D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkCpG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO/F,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC;YAgBpD,aAAa;IAgS5B;;;;;;;;;;;;;;;OAeG;YACW,mBAAmB;IAqDjC;;;;;;;;OAQG;YACW,mBAAmB;CASlC;AAQD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -264,6 +264,28 @@ export declare function buildRequest(options: GenerateOptions, wire: KimiCodeWir
|
|
|
264
264
|
* serialize a body of up to tens of megabytes a second time.
|
|
265
265
|
*/
|
|
266
266
|
export declare function assertRequestBodyFits(body: Record<string, unknown>, carriesVideo?: boolean): string;
|
|
267
|
+
/**
|
|
268
|
+
* How a request body splits into the parts that share the ceiling.
|
|
269
|
+
*
|
|
270
|
+
* The 2 MB limit covers images, conversation text, tool schemas and the system
|
|
271
|
+
* prompt together, but only the first is compressible by dropping something. A
|
|
272
|
+
* message that names which part dominates is the difference between a user who
|
|
273
|
+
* compacts the conversation and a user who deletes images and fails again.
|
|
274
|
+
*/
|
|
275
|
+
export interface RequestBodyBreakdown {
|
|
276
|
+
readonly totalBytes: number;
|
|
277
|
+
readonly imageBytes: number;
|
|
278
|
+
readonly toolSchemaBytes: number;
|
|
279
|
+
readonly otherBytes: number;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Measure one already-serialized body by composition.
|
|
283
|
+
*
|
|
284
|
+
* Image payload is found structurally (a base64 `data:` URL or an Anthropic
|
|
285
|
+
* base64 source) rather than by searching for a marker substring, so a user
|
|
286
|
+
* message that happens to contain that text cannot inflate the image share.
|
|
287
|
+
*/
|
|
288
|
+
export declare function requestBodyBreakdown(body: Record<string, unknown>, carriesVideo?: boolean): RequestBodyBreakdown;
|
|
267
289
|
/** One tool call accumulating across `chat/completions` deltas. */
|
|
268
290
|
interface PendingToolCall {
|
|
269
291
|
blockIndex: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/host/kimi-code/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAKhC,OAAO,EAAE,uBAAuB,EAAmB,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,CAAA;AACxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EAItB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,qBAAqB,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AAM,GAAG,IAAI,CAWzG;AAWD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAmBlD;AASD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAUxD;AAmBD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAWzF;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAIrE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eddyskywalker/dsh-chatgpt-subscription",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "eddyskywalker",
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
"scripts": {
|
|
127
127
|
"build": "tsc -b && tsdown",
|
|
128
128
|
"prepack": "npm run build",
|
|
129
|
+
"release": "node .dsh/skills/release-plugin/scripts/release.mjs",
|
|
129
130
|
"test": "vitest run",
|
|
130
131
|
"typecheck": "tsc -b --pretty false && tsc -p test/tsconfig.json --pretty false"
|
|
131
132
|
},
|