@deepseek-ai/dsh-llm-retry 0.1.5-rc.2 → 0.1.6-alpha.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/README.i18n.yaml +1 -1
- package/README.zh.md +7 -7
- package/lib/types/invariant.js +3 -0
- package/package.json +23 -23
package/README.i18n.yaml
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/llm/llm-retry/README.md
|
|
5
5
|
README.md: ca8018e1fbfcda7b091c30370a195bfe40c5f1b2
|
|
6
|
-
README.zh.md:
|
|
6
|
+
README.zh.md: ec3ee877ef5ddbee29bc6df6c395ed96d1c2f8da
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "面向用户与维护者的重试执行器说明:在持久 agent
|
|
2
|
+
description: "面向用户与维护者的重试执行器说明:在持久 agent(智能体)步骤边界上配置按提供方路由的模型请求恢复。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ kind: "package-reference"
|
|
|
29
29
|
|
|
30
30
|
### 何时选择
|
|
31
31
|
|
|
32
|
-
当组合运行 agent loop
|
|
32
|
+
当组合运行 agent loop(智能体循环)并需要持久请求恢复时选择它。本插件是无配置的函数插件;`dsh-llm-deepseek` 与 `dsh-llm-pi-ai` 等提供方适配器拥有各自路由的 `retryPolicy`,多提供方适配器把它放进每个 provider profile。当调用不经 agent loop、直接走 `ctx.llm.stream()` 时跳过它:这些消费方仍是单次尝试,因为原始流无法持久地区分已发出的分片。
|
|
33
33
|
|
|
34
34
|
### 最小配置
|
|
35
35
|
|
|
@@ -51,7 +51,7 @@ kind: "package-reference"
|
|
|
51
51
|
|
|
52
52
|
### 你可以观察到什么
|
|
53
53
|
|
|
54
|
-
每次计划的重试在等待前就是持久的:插件会先追加携带重试 id
|
|
54
|
+
每次计划的重试在等待前就是持久的:插件会先追加携带重试 id、提供方、模式、策略键、失败与计划延迟的非表层 `llm/retry` 事件,然后在重试开始前立即追加 `llm/retry-started` 事件。提供方给出且符合策略边界的有效 `Retry-After` 会替换本地退避。等待完成后,loop 会在同一个打开的轮次内重跑失败步骤,仍基于同一份持久历史,因此重试请求与原始请求一样可以从会话日志重建。取消或插件释放会中止进行中的退避、等待活跃的委派恢复结算,并使释放前捕获的回调只能以失败结束。
|
|
55
55
|
|
|
56
56
|
### 失败与恢复
|
|
57
57
|
|
|
@@ -69,7 +69,7 @@ kind: "package-reference"
|
|
|
69
69
|
|
|
70
70
|
### 设计理念
|
|
71
71
|
|
|
72
|
-
执行器建立在一条规定之上:**先持久、后等待,打开步骤边界。** 任何定时器启动之前,重试就已通过会话日志计划,因此崩溃或取消永远不会留下不可见的待处理重试。恢复运行在 agent loop 的 `agent/request-error` waterfall
|
|
72
|
+
执行器建立在一条规定之上:**先持久、后等待,打开步骤边界。** 任何定时器启动之前,重试就已通过会话日志计划,因此崩溃或取消永远不会留下不可见的待处理重试。恢复运行在 agent loop 的 `agent/request-error` waterfall(瀑布式事件),即打开步骤扩展点上,而不是包装 `ctx.llm.stream()`——原始流无法持久地区分已发出的分片,而 loop 可以在同一个打开的轮次内重跑失败步骤。
|
|
73
73
|
|
|
74
74
|
### 源码地图
|
|
75
75
|
|
|
@@ -101,7 +101,7 @@ kind: "package-reference"
|
|
|
101
101
|
- [llm-deepseek 适配器](../llm-deepseek/README.zh.md)——带路由级 `retryPolicy` 的提供方适配器。
|
|
102
102
|
- [llm-pi-ai 适配器](../llm-pi-ai/README.zh.md)——带逐 profile `retryPolicy` 的多提供方适配器。
|
|
103
103
|
- [LLM 流终止失败](../../../.agents/notes/implemented/architecture/2026-07-29-terminal-llm-stream-failures.zh.md)——失败如何以终止分片到达服务边界。
|
|
104
|
-
- [LLM 流式子系统](../../../docs/subsystems/llm-streaming.zh.md)——`StreamChunk`
|
|
104
|
+
- [LLM 流式子系统](../../../docs/subsystems/llm-streaming.zh.md)——`StreamChunk` 协议与适配器约定(adapter contract)。
|
|
105
105
|
|
|
106
106
|
-----
|
|
107
107
|
|
|
@@ -112,7 +112,7 @@ kind: "package-reference"
|
|
|
112
112
|
|
|
113
113
|
#### 模型看到什么
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
重试事件、延迟、提供方错误或失败的部分输出都不会对模型可见。除非下游恢复策略刻意改变该表层,重试步骤会从持久表层历史中重建相同的显式提供方/模型请求;失败分片绝不进入派生消息。
|
|
116
116
|
|
|
117
117
|
#### Token 影响
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ kind: "package-reference"
|
|
|
120
120
|
|
|
121
121
|
#### KV Cache 影响
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
重建的请求保留此前前缀,有资格按该提供方规则复用提供方缓存。非表层重试事件不改变缓存标识。
|
|
124
124
|
|
|
125
125
|
## 已知限制与延期工作
|
|
126
126
|
|
package/lib/types/invariant.js
CHANGED
|
@@ -121,6 +121,7 @@ function validateStarted(history, event, fail) {
|
|
|
121
121
|
}
|
|
122
122
|
/** Validate every retry record already present in one loaded session. */
|
|
123
123
|
function validateSession(session, fail) {
|
|
124
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
124
125
|
const events = session.snapshotEvents();
|
|
125
126
|
for (const [index, event] of events.entries()) {
|
|
126
127
|
if (event.type === 'llm/retry')
|
|
@@ -138,8 +139,10 @@ const install = Object.assign((ctx, fail) => {
|
|
|
138
139
|
if (eventName !== 'session/event')
|
|
139
140
|
return;
|
|
140
141
|
const [session, event] = args;
|
|
142
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
141
143
|
if (event.type === 'llm/retry')
|
|
142
144
|
validateRetry(session.snapshotEvents(), event, fail);
|
|
145
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
143
146
|
else if (event.type === 'llm/retry-started')
|
|
144
147
|
validateStarted(session.snapshotEvents(), event, fail);
|
|
145
148
|
}, { global: true });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-llm-retry",
|
|
3
3
|
"description": "Provider-routed LLM request retry policy for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -36,36 +36,36 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.1.5-rc.2",
|
|
44
|
-
"@deepseek-ai/dsh-timeout": "^0.1.5-rc.2",
|
|
39
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-timeout": "^0.1.6-alpha.2",
|
|
45
43
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
44
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"zod": "^4.4.3",
|
|
50
50
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
53
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
54
54
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
55
55
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
56
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
57
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.
|
|
58
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-llm-
|
|
62
|
-
"@deepseek-ai/dsh-llm-
|
|
63
|
-
"@deepseek-ai/dsh-session
|
|
64
|
-
"@deepseek-ai/dsh-session-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/
|
|
69
|
-
"@deepseek-ai/
|
|
56
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-llm-mock-server": "^0.1.6-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-llm-deepseek": "^0.1.6-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-timeout": "^0.1.6-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
|
|
69
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
70
70
|
}
|
|
71
71
|
}
|