dsh-connect-madao 0.8.3 → 0.9.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/FAQ.md +17 -1
- package/cordis.patch.yml +12 -12
- package/lib/index.js +6 -4
- package/package.json +1 -1
package/FAQ.md
CHANGED
|
@@ -296,7 +296,22 @@ DSH 会自动回到原来的模型(DeepSeek 官方)。插件不改动任何
|
|
|
296
296
|
|
|
297
297
|
**为什么换小窗口模型有用**:DSH 的压缩策略按 `contextWindow - maxTokens - headroom` 计算,窗口小就更早触发压缩,历史不会无限累积到 350 条。
|
|
298
298
|
|
|
299
|
-
**体积都花在哪**:主要是图片的 base64(一张 2 MB 图 ≈ 2.7 MB 请求体)。会话里攒十来张就接近 10 MB 了。
|
|
299
|
+
**体积都花在哪**:主要是图片的 base64(一张 2 MB 图 ≈ 2.7 MB 请求体)。会话里攒十来张就接近 10 MB 了。
|
|
300
|
+
|
|
301
|
+
### 为什么 DSH 不自动压缩
|
|
302
|
+
|
|
303
|
+
因为**两个限制的计量单位不同**:
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
DSH 看 tokens → 1M 窗口的模型,压缩阈值 838K
|
|
307
|
+
网关看 字节 → 10 MB 就拒绝
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
实测这类会话的 **47.7 字节/token**(正常纯文本是 3–4)。图片的 base64 让字节增长比 token 快十几倍,DSH 按 token 算永远觉得"还早",直到请求被拒。
|
|
311
|
+
|
|
312
|
+
**这不是插件能修的** —— 压缩逻辑在 DSH 内部。插件的守卫只能在 9.5 MB 时提前拦住并说明原因。
|
|
313
|
+
|
|
314
|
+
**实用建议**:长篇会话里别反复贴大图。图片用完就开新会话,把结论用文字带过去。
|
|
300
315
|
|
|
301
316
|
---
|
|
302
317
|
|
|
@@ -309,3 +324,4 @@ DSH 会自动回到原来的模型(DeepSeek 官方)。插件不改动任何
|
|
|
309
324
|
3. DSH 版本 + 插件版本
|
|
310
325
|
|
|
311
326
|
有这三样基本能定位。光说"不工作了"没法查。
|
|
327
|
+
|
package/cordis.patch.yml
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
models:
|
|
17
17
|
- id: 'GLM-5.2'
|
|
18
18
|
name: 'GLM-5.2 · 0.7x'
|
|
19
|
-
contextWindow:
|
|
19
|
+
contextWindow: 202752
|
|
20
20
|
maxTokens: 32768
|
|
21
21
|
input: [ text ]
|
|
22
22
|
reasoningEfforts:
|
|
@@ -26,25 +26,25 @@
|
|
|
26
26
|
max: 'max'
|
|
27
27
|
- id: 'openpangu-2.0-flash'
|
|
28
28
|
name: 'OpenPangu-2.0-Flash · 0.32x'
|
|
29
|
-
contextWindow:
|
|
29
|
+
contextWindow: 524288
|
|
30
30
|
maxTokens: 32768
|
|
31
31
|
input: [ text ]
|
|
32
32
|
reasoningEfforts: false
|
|
33
33
|
- id: 'openpangu-2.0-pro'
|
|
34
34
|
name: 'OpenPangu-2.0-Pro · 0.7x'
|
|
35
|
-
contextWindow:
|
|
35
|
+
contextWindow: 524288
|
|
36
36
|
maxTokens: 32768
|
|
37
37
|
input: [ text ]
|
|
38
38
|
reasoningEfforts: false
|
|
39
39
|
- id: 'openpangu-2.1-pro'
|
|
40
40
|
name: 'OpenPangu-2.1-Pro · 0.07x'
|
|
41
|
-
contextWindow:
|
|
41
|
+
contextWindow: 524288
|
|
42
42
|
maxTokens: 32768
|
|
43
43
|
input: [ text ]
|
|
44
44
|
reasoningEfforts: false
|
|
45
45
|
- id: 'glm-5.3'
|
|
46
46
|
name: 'GLM-5.3 · 0.79x'
|
|
47
|
-
contextWindow:
|
|
47
|
+
contextWindow: 1048576
|
|
48
48
|
maxTokens: 32768
|
|
49
49
|
input: [ text ]
|
|
50
50
|
reasoningEfforts:
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
max: 'max'
|
|
55
55
|
- id: 'glm-5.3-flash'
|
|
56
56
|
name: 'GLM-5.3-Flash · 0.08x'
|
|
57
|
-
contextWindow:
|
|
57
|
+
contextWindow: 1048576
|
|
58
58
|
maxTokens: 32768
|
|
59
59
|
input: [ text, image ]
|
|
60
60
|
reasoningEfforts:
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
max: 'max'
|
|
65
65
|
- id: 'glm-5.2-sft-harmony'
|
|
66
66
|
name: 'GLM-5.2-ArkTS-SPARK · 0.7x'
|
|
67
|
-
contextWindow:
|
|
67
|
+
contextWindow: 202752
|
|
68
68
|
maxTokens: 32768
|
|
69
69
|
input: [ text ]
|
|
70
70
|
reasoningEfforts:
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
max: 'max'
|
|
75
75
|
- id: 'deepseek-v4.1-flash'
|
|
76
76
|
name: 'DeepSeek-V4.1-Flash · 0.18x'
|
|
77
|
-
contextWindow:
|
|
77
|
+
contextWindow: 1048576
|
|
78
78
|
maxTokens: 32768
|
|
79
79
|
input: [ text, image ]
|
|
80
80
|
reasoningEfforts:
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
max: 'max'
|
|
85
85
|
- id: 'deepseek-v4.1-flash-1017'
|
|
86
86
|
name: 'DeepSeek-V4.1-Flash-1017 · 0.18x'
|
|
87
|
-
contextWindow:
|
|
87
|
+
contextWindow: 1048576
|
|
88
88
|
maxTokens: 32768
|
|
89
89
|
input: [ text, image ]
|
|
90
90
|
reasoningEfforts:
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
max: 'max'
|
|
95
95
|
- id: 'kimi-k3'
|
|
96
96
|
name: 'Kimi-K3 · 2.38x'
|
|
97
|
-
contextWindow:
|
|
97
|
+
contextWindow: 1048576
|
|
98
98
|
maxTokens: 32768
|
|
99
99
|
input: [ text, image ]
|
|
100
100
|
reasoningEfforts:
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
max: 'max'
|
|
105
105
|
- id: 'kimi-k3.1-pro'
|
|
106
106
|
name: 'Kimi-K3.1-Pro · 1.63x'
|
|
107
|
-
contextWindow:
|
|
107
|
+
contextWindow: 1048576
|
|
108
108
|
maxTokens: 32768
|
|
109
109
|
input: [ text, image ]
|
|
110
110
|
reasoningEfforts:
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
max: 'max'
|
|
115
115
|
- id: 'speed'
|
|
116
116
|
name: '智速模式 · 0.18x'
|
|
117
|
-
contextWindow:
|
|
117
|
+
contextWindow: 1048576
|
|
118
118
|
maxTokens: 32768
|
|
119
119
|
input: [ text ]
|
|
120
120
|
reasoningEfforts: false
|
package/lib/index.js
CHANGED
|
@@ -2015,9 +2015,11 @@ async function chatCompletion(res, client, rawBody, ctxModels) {
|
|
|
2015
2015
|
});
|
|
2016
2016
|
}
|
|
2017
2017
|
if (info && info.context > 0) {
|
|
2018
|
-
const
|
|
2018
|
+
const RESERVED_FOR_OUTPUT = 4096;
|
|
2019
|
+
const realInputLimit = Math.max(1, info.context - RESERVED_FOR_OUTPUT);
|
|
2020
|
+
const limit = Math.floor(realInputLimit * 1.2);
|
|
2019
2021
|
if (estTokens > limit) {
|
|
2020
|
-
const bigger = ctxModels.filter((m) => m.context
|
|
2022
|
+
const bigger = ctxModels.filter((m) => m.context - RESERVED_FOR_OUTPUT > estTokens).sort((a, b) => a.context - b.context).slice(0, 4).map((m) => `${m.name}\uFF08${m.context - RESERVED_FOR_OUTPUT}\uFF09`);
|
|
2021
2023
|
chatLog(
|
|
2022
2024
|
`chat REJECT context ${estTokens} (msgs ${estMessages} + tools ${estTools}/${toolCount}) > ${limit} for ${model}`
|
|
2023
2025
|
);
|
|
@@ -2378,10 +2380,10 @@ function q(s) {
|
|
|
2378
2380
|
function displayName(m) {
|
|
2379
2381
|
return m.ratio ? `${m.name} \xB7 ${m.ratio}` : m.name;
|
|
2380
2382
|
}
|
|
2381
|
-
var CONTEXT_DISPLAY_FACTOR =
|
|
2383
|
+
var CONTEXT_DISPLAY_FACTOR = 1;
|
|
2382
2384
|
function displayContextWindow(real) {
|
|
2383
2385
|
if (!Number.isFinite(real) || real <= 0) return real;
|
|
2384
|
-
return Math.round(real * CONTEXT_DISPLAY_FACTOR);
|
|
2386
|
+
return Math.max(real, Math.round(real * CONTEXT_DISPLAY_FACTOR));
|
|
2385
2387
|
}
|
|
2386
2388
|
function renderModel(m) {
|
|
2387
2389
|
const lines = [];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-madao",
|
|
3
3
|
"displayName": "DSH Connect 码道",
|
|
4
4
|
"description": "把华为云码道(CodeArts Agent)的模型接入 DeepSeek Harness:自签 SDK-HMAC-SHA256、P-256 密钥协商与 SM4-GCM 载荷加密,对外提供 OpenAI 兼容接口,并带设置面板与状态胶囊。",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.9.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|