dsh-sub2api 0.13.0 → 0.13.1
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 +11 -0
- package/lib/adapter.js +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
- **Two more gateway failures now read as instructions.** Both were reproduced
|
|
6
|
+
against the live gateway before the wording was written.
|
|
7
|
+
- `GROUP_DELETED` — a key whose group was deleted still carries the group id,
|
|
8
|
+
so every call fails and nothing in the panel shows why. 27 such keys exist
|
|
9
|
+
on the gateway today. The message now says to rebuild the key.
|
|
10
|
+
- Context overflow — the gateway nests the real message inside a JSON string,
|
|
11
|
+
so users got an escaped blob ending in a trace id. It now says to start a new
|
|
12
|
+
conversation or pick a model with a bigger window.
|
|
13
|
+
|
|
3
14
|
## 0.13.0
|
|
4
15
|
|
|
5
16
|
- **Out of balance now says so, and where to fix it.** The gateway answers both
|
package/lib/adapter.js
CHANGED
|
@@ -354,6 +354,28 @@ export function describeStreamFailure(error, emitted, attempts) {
|
|
|
354
354
|
);
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
// A key whose group was deleted still carries the group id, so every call is
|
|
358
|
+
// rejected with GROUP_DELETED and the user has no way to act on it: nothing
|
|
359
|
+
// in the panel shows a broken group. The fix is to re-provision, which the
|
|
360
|
+
// plugin can do, but only if it says so plainly.
|
|
361
|
+
if (/GROUP_DELETED|分组已删除|group.*deleted/i.test(said)) {
|
|
362
|
+
return new Sub2ApiError(
|
|
363
|
+
"密钥所属的分组已被站点删除,这个密钥无法再调用模型。在 设置 → dsh-sub2api 里点「重建」换一个新密钥即可。",
|
|
364
|
+
{ code: "group_deleted", status, cause: error },
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// The gateway reports a context overflow as a nested JSON string inside the
|
|
369
|
+
// message, so what reaches the user is an escaped blob ending in a trace id.
|
|
370
|
+
// The host will have compacted already; when this still fires, the real
|
|
371
|
+
// advice is "start a new conversation or pick a model with a bigger window".
|
|
372
|
+
if (/longer than the model.s context length|context length|context window|prompt is too long|maximum context/i.test(said)) {
|
|
373
|
+
return new Sub2ApiError(
|
|
374
|
+
"这条会话已经超过模型能接受的上下文长度了。开一个新会话,或在模型选择器里换一个上下文更大的模型。",
|
|
375
|
+
{ code: "CONTEXT_WINDOW_EXCEEDED", status, cause: error },
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
357
379
|
if (status !== undefined && status >= 500) {
|
|
358
380
|
// sub2api answers this exact sentence for "my upstream failed", which in
|
|
359
381
|
// practice means the account pool has nothing usable for this model — a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-sub2api",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Sub2API provider for DeepSeek Harness (DSH): email sign-in, automatic API key and model provisioning, one panel for balance and recharge. Works with the hosted gateway or your own sub2api deployment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-only",
|