@jerryliang122/openclaw-qqbot 1.0.3 → 1.0.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/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
- package/src/dispatch/dispatch.ts +11 -2
- package/src/outbound/deliver-pipeline.ts +5 -0
package/package.json
CHANGED
package/src/dispatch/dispatch.ts
CHANGED
|
@@ -356,6 +356,10 @@ export async function dispatchToOpenClaw(
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
// ── 2. 流式路径:流式已启动且未降级 -> 跳过静态发送 ──
|
|
359
|
+
// 例外:isError payload(agent run 失败通知)必须落到默认路径发出。
|
|
360
|
+
// 失败文案从未进入流式通道(模型死在半路),「final 已由流式发过」的
|
|
361
|
+
// 去重假设不成立——早退 return 会把通知吞掉,用户只见首分片后静默
|
|
362
|
+
// (issue #8:静态流式首分片 1062 字符已发,模型超时后无任何提示)。
|
|
359
363
|
if (streamingController?.hasStarted && !streamingController?.shouldFallbackToStatic) {
|
|
360
364
|
if (streamingController.isStaticSendMode) {
|
|
361
365
|
// static 模式:flush 主路径由 onToolStart 驱动(工具开始前,绕开 SDK
|
|
@@ -370,8 +374,13 @@ export async function dispatchToOpenClaw(
|
|
|
370
374
|
// stream 模式:tool/final 时收尾当前打字机流(原行为)
|
|
371
375
|
await streamingController.finalize();
|
|
372
376
|
}
|
|
373
|
-
if (
|
|
374
|
-
|
|
377
|
+
if (payload.isError === true) {
|
|
378
|
+
dlog?.info(`run-failure notice bypasses streaming dedup (kind=${kind ?? 'none'} textLen=${text.length})`);
|
|
379
|
+
} else if (!streamingController.shouldFallbackToStatic) {
|
|
380
|
+
return;
|
|
381
|
+
} else {
|
|
382
|
+
dlog?.warn(`streaming fallback to static`);
|
|
383
|
+
}
|
|
375
384
|
}
|
|
376
385
|
|
|
377
386
|
// ── 3. 文本去重:同文本已发过 -> 跳过 ──
|
|
@@ -27,6 +27,11 @@ export interface DeliverPayload {
|
|
|
27
27
|
mediaUrl?: string;
|
|
28
28
|
mediaUrls?: string[];
|
|
29
29
|
audioAsVoice?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* agent run 失败通知 payload(框架 markAgentRunFailureReplyPayload 必置 true)。
|
|
32
|
+
* 这类文本从未进入流式通道(模型死在半路),流式去重早退对它不适用。
|
|
33
|
+
*/
|
|
34
|
+
isError?: boolean;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export interface DeliverInfo {
|