dsh-llm-fallbacks 0.3.3 → 0.3.4
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 +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/client/index.js +39 -11
- package/dist/index.js +32 -4
- package/dist/time-slots.d.ts +3 -3
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
9
|
-

|
|
10
10
|
[](https://dshfind.com/zh/plugins/omdsh-dev/dsh-llm-fallbacks?ref=badge)
|
|
11
11
|
|
|
12
12
|
Automatic provider/model fallback chains for dsh (DeepSeek Harness): when an agent's LLM requests keep failing — retries exhausted, auth errors, quota exceeded, rate limiting (429) — the plugin switches provider/model along the fallback chain for the current role, and the current step/turn continues on the target model: tasks are not interrupted by model problems.
|
|
@@ -23,7 +23,7 @@ Four frozen UTC+8 presets (windows are code constants; preset rows lock `tz` to
|
|
|
23
23
|
|
|
24
24
|
| Preset | Window |
|
|
25
25
|
|---|---|
|
|
26
|
-
| `liang-peak` | 09:00–12:00 and 14:00–18:00
|
|
26
|
+
| `liang-peak` | Monday–Friday 09:00–12:00 and 14:00–18:00 |
|
|
27
27
|
| `liang-valley` | every other UTC+8 time (complement of Liang Peak) |
|
|
28
28
|
| `glm-peak` | Monday–Friday 14:00–18:00 |
|
|
29
29
|
| `glm-valley` | every other time (complement of GLM Peak) |
|
|
@@ -81,7 +81,7 @@ fallbacks:
|
|
|
81
81
|
- deepseek-official/deepseek-v4-flash # last resort (Flash or Pro)
|
|
82
82
|
timeSlots: # optional: rotate the effective root chain by wall-clock windows
|
|
83
83
|
- kind: preset # frozen UTC+8 window; only the chain is editable
|
|
84
|
-
preset: liang-peak # 09:00–12:00 and 14:00–18:00
|
|
84
|
+
preset: liang-peak # Monday–Friday 09:00–12:00 and 14:00–18:00
|
|
85
85
|
chain:
|
|
86
86
|
- anthropic/claude-3-5-sonnet
|
|
87
87
|
- kind: custom # custom window (may wrap midnight)
|
|
@@ -167,7 +167,7 @@ Notes:
|
|
|
167
167
|
Time slots are introduced in the [featured overview](#time-slots) above; this section is the reference. Time-slot rows rotate the **effective root chain** by wall-clock windows — useful for peak/valley pricing without confusing wall-clock rotation with failure fallback. The copy split is strict: slot rotation logs and UI say **time-slot switch**; the failure walk keeps **fallback switch**; the conversation notice Model downgraded stays on the failure path only.
|
|
168
168
|
|
|
169
169
|
- **Match order**: at every root request, the first extra row whose window contains the current moment (in `fallbacks.tz`, default `Asia/Shanghai` / UTC+8) wins — that row's chain **replaces** the all-day chain. No row matches → the all-day `rootChain` is used. The all-day row is always last and **required**: its last entry must be exactly one official V4 model (Flash XOR Pro; leading Default fallback chain entries are walked first).
|
|
170
|
-
- **Presets** (frozen, not user-editable): `liang-peak` = 09:00–12:00 **and** 14:00–18:00
|
|
170
|
+
- **Presets** (frozen, not user-editable): `liang-peak` = Monday–Friday 09:00–12:00 **and** 14:00–18:00; `liang-valley` = every other UTC+8 time; `glm-peak` = Monday–Friday 14:00–18:00; `glm-valley` = every other time. One preset id = one row; the card picker never offers a duplicate.
|
|
171
171
|
- **Custom rows**: `start` / `end` (`HH:mm`, may wrap midnight) + optional `days` (0=Sunday…6=Saturday; omitted/empty = every day) + models.
|
|
172
172
|
- **Next-request apply**: a slot boundary crossing never preempts an in-flight step — the new row takes effect on the next root request. Rotation is mount-only: info log + card/`/fallbacks` status line, no durable switch event.
|
|
173
173
|
- **Settings card**: the Main agent section groups Time slots (extra rows — add preset / add custom / remove / reorder by buttons or **drag**; preset rows show a read-only window summary and edit models only; custom rows carry an editable name; the **timezone picker** lives here and **locks to Asia/Shanghai while any preset row exists**, since preset windows are frozen UTC+8 constants), Default fallback chain (walked first when no slot matches) and Default model (the official V4 Flash | Pro last-resort fallback). Rows are collapsible to name + first model. There is no `timeSlots.enabled` master switch (adding a row is the opt-in) and no `rootMode` control.
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
9
|
-

|
|
10
10
|
[](https://dshfind.com/zh/plugins/omdsh-dev/dsh-llm-fallbacks?ref=badge)
|
|
11
11
|
|
|
12
12
|
dsh(DeepSeek Harness)的自动模型降级插件:当 root agent 或 subagent 的模型请求持续失败(重试耗尽、权限、配额超限、限流 429)时,按角色/模型 fallback 链自动切换 provider/model,当前 step/turn 在目标模型上继续完成——任务不因模型问题中断。
|
|
@@ -23,7 +23,7 @@ dsh(DeepSeek Harness)的自动模型降级插件:当 root agent 或 subage
|
|
|
23
23
|
|
|
24
24
|
| 预设 | 窗口 |
|
|
25
25
|
|---|---|
|
|
26
|
-
| `liang-peak` |
|
|
26
|
+
| `liang-peak` | 周一至周五 09:00–12:00 与 14:00–18:00 |
|
|
27
27
|
| `liang-valley` | 其它所有 UTC+8 时间(Liang Peak 的补集) |
|
|
28
28
|
| `glm-peak` | 周一至周五 14:00–18:00 |
|
|
29
29
|
| `glm-valley` | 其余时间(GLM Peak 的补集) |
|
|
@@ -81,7 +81,7 @@ fallbacks:
|
|
|
81
81
|
- deepseek-official/deepseek-v4-flash # 最后一档(Flash 或 Pro)
|
|
82
82
|
timeSlots: # 可选:按墙钟窗口轮换生效 root 链
|
|
83
83
|
- kind: preset # 冻结的 UTC+8 窗口;仅链可编辑
|
|
84
|
-
preset: liang-peak #
|
|
84
|
+
preset: liang-peak # 周一至周五 09:00–12:00 与 14:00–18:00
|
|
85
85
|
chain:
|
|
86
86
|
- anthropic/claude-3-5-sonnet
|
|
87
87
|
- kind: custom # 自定义窗口(可跨午夜)
|
|
@@ -167,7 +167,7 @@ fallbacks:
|
|
|
167
167
|
峰谷无忧在[首页专题](#峰谷无忧)中介绍,本节是完整参考。分时槽行按墙钟窗口轮换**生效 root 链**——适合按峰谷切换模型,且不会把墙钟轮换误认为故障降级。文案严格区分:时段轮换的日志与 UI 用**分时切换**;失败降级保持**降级切换**;会话内「模型已降级」提示只出现在失败路径。
|
|
168
168
|
|
|
169
169
|
- **匹配顺序**:每个 root 请求时刻,第一条窗口包含当前时刻(按 `fallbacks.tz`,默认 `Asia/Shanghai` / UTC+8)的额外行生效——该行的模型链**取代**全时段链;无行命中则用全时段 `rootChain`。全时段行固定最后且**必选**:最后一项必须是恰好一个官方 V4 模型(Flash 或 Pro;前面的降级条目先走)。
|
|
170
|
-
- **预设**(冻结,不可编辑窗口):`liang-peak` =
|
|
170
|
+
- **预设**(冻结,不可编辑窗口):`liang-peak` = 周一至周五 09:00–12:00 **与** 14:00–18:00;`liang-valley` = 其它所有 UTC+8 时间;`glm-peak` = 周一至周五 14:00–18:00;`glm-valley` = 其余时间。一个预设 id 对应一行;设置卡的选择器不会重复提供已添加的预设。
|
|
171
171
|
- **自定义行**:`start` / `end`(`HH:mm`,可跨午夜)+ 可选 `days`(0=周日…6=周六;缺省/空 = 每天)+ 模型。
|
|
172
172
|
- **下一请求生效**:时段边界跨越绝不打断进行中的 step——新行在下一个 root 请求生效。轮换仅挂载生效:info 日志 + 设置卡/`/fallbacks` 状态行,无 durable 切换事件。
|
|
173
173
|
- **设置卡**:主代理区块下分三块——**分时槽设置**(额外行:添加预设 / 添加自定义 / 删除 / 按钮或**拖拽**排序;预设行只读展示窗口摘要、仅可编辑模型链;自定义行带可编辑名称;**时区选择器**在此区块内,只要存在预设行就**锁定 Asia/Shanghai**——预设窗口是冻结的 UTC+8 常量)、**默认降级链**(all-day 链,可配置的 provider/model 选择器列表)与**默认模型**(官方 V4 Flash | Pro 二选一链头)。行可折叠为「名称 + 首个模型」。没有 `timeSlots.enabled` 总开关(添加行即开启),也没有 `rootMode` 控件。
|
package/dist/client/index.js
CHANGED
|
@@ -199,18 +199,32 @@ window.__ModuleLoader__.load({
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
|
-
* Frozen preset windows (UTC+8). `liang
|
|
203
|
-
*
|
|
204
|
-
*
|
|
202
|
+
* Frozen preset windows (UTC+8). `liang-peak` and `glm-peak` are
|
|
203
|
+
* Monday–Friday only (day mask `[1, 2, 3, 4, 5]`); their valleys are the
|
|
204
|
+
* `complement: true` of the corresponding peak (weekends included).
|
|
205
205
|
*/
|
|
206
206
|
const PRESETS = {
|
|
207
207
|
"liang-peak": {
|
|
208
208
|
windows: [{
|
|
209
209
|
start: "09:00",
|
|
210
|
-
end: "12:00"
|
|
210
|
+
end: "12:00",
|
|
211
|
+
days: [
|
|
212
|
+
1,
|
|
213
|
+
2,
|
|
214
|
+
3,
|
|
215
|
+
4,
|
|
216
|
+
5
|
|
217
|
+
]
|
|
211
218
|
}, {
|
|
212
219
|
start: "14:00",
|
|
213
|
-
end: "18:00"
|
|
220
|
+
end: "18:00",
|
|
221
|
+
days: [
|
|
222
|
+
1,
|
|
223
|
+
2,
|
|
224
|
+
3,
|
|
225
|
+
4,
|
|
226
|
+
5
|
|
227
|
+
]
|
|
214
228
|
}],
|
|
215
229
|
complement: false,
|
|
216
230
|
label: "Liang Peak"
|
|
@@ -218,10 +232,24 @@ window.__ModuleLoader__.load({
|
|
|
218
232
|
"liang-valley": {
|
|
219
233
|
windows: [{
|
|
220
234
|
start: "09:00",
|
|
221
|
-
end: "12:00"
|
|
235
|
+
end: "12:00",
|
|
236
|
+
days: [
|
|
237
|
+
1,
|
|
238
|
+
2,
|
|
239
|
+
3,
|
|
240
|
+
4,
|
|
241
|
+
5
|
|
242
|
+
]
|
|
222
243
|
}, {
|
|
223
244
|
start: "14:00",
|
|
224
|
-
end: "18:00"
|
|
245
|
+
end: "18:00",
|
|
246
|
+
days: [
|
|
247
|
+
1,
|
|
248
|
+
2,
|
|
249
|
+
3,
|
|
250
|
+
4,
|
|
251
|
+
5
|
|
252
|
+
]
|
|
225
253
|
}],
|
|
226
254
|
complement: true,
|
|
227
255
|
label: "Liang Valley"
|
|
@@ -1317,9 +1345,9 @@ window.__ModuleLoader__.load({
|
|
|
1317
1345
|
"timeSlots.preset.windowLabel": "时段(只读)",
|
|
1318
1346
|
"timeSlots.preset.chainsOnly": "预设窗口已锁定:仅可编辑模型链",
|
|
1319
1347
|
"timeSlots.preset.liang-peak.label": "梁文峰",
|
|
1320
|
-
"timeSlots.preset.liang-peak.window": "09:00–12:00 与 14:00–18:00
|
|
1348
|
+
"timeSlots.preset.liang-peak.window": "09:00–12:00 与 14:00–18:00(周一至周五,UTC+8)",
|
|
1321
1349
|
"timeSlots.preset.liang-valley.label": "梁文谷",
|
|
1322
|
-
"timeSlots.preset.liang-valley.window": "Liang Peak
|
|
1350
|
+
"timeSlots.preset.liang-valley.window": "Liang Peak 之外的所有时间(UTC+8)",
|
|
1323
1351
|
"timeSlots.preset.glm-peak.label": "GLM峰",
|
|
1324
1352
|
"timeSlots.preset.glm-peak.window": "周一至周五 14:00–18:00(UTC+8)",
|
|
1325
1353
|
"timeSlots.preset.glm-valley.label": "GLM谷",
|
|
@@ -1502,9 +1530,9 @@ window.__ModuleLoader__.load({
|
|
|
1502
1530
|
"timeSlots.preset.windowLabel": "Window (read-only)",
|
|
1503
1531
|
"timeSlots.preset.chainsOnly": "Preset windows are frozen: only the model chain is editable",
|
|
1504
1532
|
"timeSlots.preset.liang-peak.label": "Liang Peak",
|
|
1505
|
-
"timeSlots.preset.liang-peak.window": "09:00–12:00 & 14:00–18:00 (
|
|
1533
|
+
"timeSlots.preset.liang-peak.window": "09:00–12:00 & 14:00–18:00 (Monday–Friday, UTC+8)",
|
|
1506
1534
|
"timeSlots.preset.liang-valley.label": "Liang Valley",
|
|
1507
|
-
"timeSlots.preset.liang-valley.window": "All times outside Liang Peak (
|
|
1535
|
+
"timeSlots.preset.liang-valley.window": "All times outside Liang Peak (UTC+8)",
|
|
1508
1536
|
"timeSlots.preset.glm-peak.label": "GLM Peak",
|
|
1509
1537
|
"timeSlots.preset.glm-peak.window": "Monday–Friday 14:00–18:00 (UTC+8)",
|
|
1510
1538
|
"timeSlots.preset.glm-valley.label": "GLM Valley",
|
package/dist/index.js
CHANGED
|
@@ -39,10 +39,24 @@ const PRESETS = {
|
|
|
39
39
|
"liang-peak": {
|
|
40
40
|
windows: [{
|
|
41
41
|
start: "09:00",
|
|
42
|
-
end: "12:00"
|
|
42
|
+
end: "12:00",
|
|
43
|
+
days: [
|
|
44
|
+
1,
|
|
45
|
+
2,
|
|
46
|
+
3,
|
|
47
|
+
4,
|
|
48
|
+
5
|
|
49
|
+
]
|
|
43
50
|
}, {
|
|
44
51
|
start: "14:00",
|
|
45
|
-
end: "18:00"
|
|
52
|
+
end: "18:00",
|
|
53
|
+
days: [
|
|
54
|
+
1,
|
|
55
|
+
2,
|
|
56
|
+
3,
|
|
57
|
+
4,
|
|
58
|
+
5
|
|
59
|
+
]
|
|
46
60
|
}],
|
|
47
61
|
complement: false,
|
|
48
62
|
label: "Liang Peak"
|
|
@@ -50,10 +64,24 @@ const PRESETS = {
|
|
|
50
64
|
"liang-valley": {
|
|
51
65
|
windows: [{
|
|
52
66
|
start: "09:00",
|
|
53
|
-
end: "12:00"
|
|
67
|
+
end: "12:00",
|
|
68
|
+
days: [
|
|
69
|
+
1,
|
|
70
|
+
2,
|
|
71
|
+
3,
|
|
72
|
+
4,
|
|
73
|
+
5
|
|
74
|
+
]
|
|
54
75
|
}, {
|
|
55
76
|
start: "14:00",
|
|
56
|
-
end: "18:00"
|
|
77
|
+
end: "18:00",
|
|
78
|
+
days: [
|
|
79
|
+
1,
|
|
80
|
+
2,
|
|
81
|
+
3,
|
|
82
|
+
4,
|
|
83
|
+
5
|
|
84
|
+
]
|
|
57
85
|
}],
|
|
58
86
|
complement: true,
|
|
59
87
|
label: "Liang Valley"
|
package/dist/time-slots.d.ts
CHANGED
|
@@ -58,9 +58,9 @@ export interface PresetDefinition {
|
|
|
58
58
|
label: string;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Frozen preset windows (UTC+8). `liang
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* Frozen preset windows (UTC+8). `liang-peak` and `glm-peak` are
|
|
62
|
+
* Monday–Friday only (day mask `[1, 2, 3, 4, 5]`); their valleys are the
|
|
63
|
+
* `complement: true` of the corresponding peak (weekends included).
|
|
64
64
|
*/
|
|
65
65
|
export declare const PRESETS: Record<PresetId, PresetDefinition>;
|
|
66
66
|
/**
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dsh",
|
|
6
6
|
"dsh-plugin"
|
|
7
7
|
],
|
|
8
|
-
"version": "0.3.
|
|
8
|
+
"version": "0.3.4",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
@@ -61,23 +61,23 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
64
|
-
"@deepseek-ai/dsh-agent": "^0.1.1-rc.
|
|
65
|
-
"@deepseek-ai/dsh-api-gateway": "^0.1.1-rc.
|
|
66
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.1-rc.
|
|
67
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.
|
|
68
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.
|
|
69
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.
|
|
71
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.1-rc.
|
|
72
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.1-rc.
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.
|
|
75
|
-
"@deepseek-ai/dsh-commands": "^0.1.1-rc.
|
|
76
|
-
"@deepseek-ai/dsh-llm": "^0.1.1-rc.
|
|
77
|
-
"@deepseek-ai/dsh-session": "^0.1.1-rc.
|
|
78
|
-
"@deepseek-ai/dsh-settings": "^0.1.1-rc.
|
|
79
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.
|
|
80
|
-
"@deepseek-ai/dsh-typert-registry": "^0.1.1-rc.
|
|
64
|
+
"@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
|
|
65
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.1-rc.2",
|
|
66
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.1-rc.2",
|
|
67
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.1-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.1-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-commands": "^0.1.1-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.1-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-typert-registry": "^0.1.1-rc.2",
|
|
81
81
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
82
82
|
"react": "^18.2.0"
|
|
83
83
|
},
|