@ynhcj/xiaoyi-channel 0.0.180-next → 0.0.181-next
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/src/reply-dispatcher.js +5 -30
- package/package.json +1 -1
|
@@ -171,11 +171,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
171
171
|
scopedLog().log(`[REPLY-START] Reply started, taskId=${taskId}, steered=${steerState.steered}`);
|
|
172
172
|
},
|
|
173
173
|
deliver: async (payload, info) => {
|
|
174
|
-
// 🔑 steered dispatch不发送内容(让主dispatcher处理)
|
|
175
|
-
if (steerState.steered) {
|
|
176
|
-
scopedLog().log(`[DELIVER] Steered dispatch, skipping, kind=${info?.kind}`);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
174
|
const text = payload.text ?? "";
|
|
180
175
|
scopedLog().log(`[DELIVER] kind=${info?.kind}, text.length=${text.length}`);
|
|
181
176
|
try {
|
|
@@ -212,11 +207,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
212
207
|
onError: async (err, info) => {
|
|
213
208
|
runtime.error?.(`xy: ${info.kind} reply failed: ${String(err)}`);
|
|
214
209
|
stopStatusInterval();
|
|
215
|
-
// 🔑 steered dispatcher不发送错误状态(让主dispatcher处理)
|
|
216
|
-
if (steerState.steered) {
|
|
217
|
-
scopedLog().log(`[ON-ERROR] Steered dispatch, skipping error response`);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
210
|
if (!hasSentResponse) {
|
|
221
211
|
try {
|
|
222
212
|
await sendStatusUpdate({
|
|
@@ -235,11 +225,12 @@ export function createXYReplyDispatcher(params) {
|
|
|
235
225
|
},
|
|
236
226
|
onIdle: async () => {
|
|
237
227
|
scopedLog().log(`[ON-IDLE] Reply idle, steered=${steerState.steered}, hasSentResponse=${hasSentResponse}, finalSent=${finalSent}`);
|
|
238
|
-
// 🔑 steered dispatch
|
|
239
|
-
|
|
240
|
-
|
|
228
|
+
// 🔑 steered dispatch without response — steer was injected into active run,
|
|
229
|
+
// no reply generated. Skip final response without sending error.
|
|
230
|
+
if (steerState.steered && !hasSentResponse) {
|
|
231
|
+
scopedLog().log(`[ON-IDLE] Steered dispatch, no response generated, skipping`);
|
|
241
232
|
stopStatusInterval();
|
|
242
|
-
return;
|
|
233
|
+
return;
|
|
243
234
|
}
|
|
244
235
|
// 🔑 用 try/finally 确保 cleanup 在 onIdle 的 async 工作全部完成后才执行。
|
|
245
236
|
// openclaw 的 waitForIdle() 以 void options.onIdle?.() 调用 onIdle,
|
|
@@ -356,10 +347,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
356
347
|
suppressToolErrorWarnings: true,
|
|
357
348
|
onModelSelected: prefixContext.onModelSelected,
|
|
358
349
|
onToolStart: async ({ name, phase }) => {
|
|
359
|
-
// 🔑 steered dispatch不发送tool状态(让主dispatcher处理)
|
|
360
|
-
if (steerState.steered) {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
350
|
scopedLog().log(`[TOOL-START] Tool: ${name}, phase: ${phase}`);
|
|
364
351
|
if (phase === "start") {
|
|
365
352
|
const toolName = name || "unknown";
|
|
@@ -386,10 +373,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
386
373
|
}
|
|
387
374
|
},
|
|
388
375
|
onToolResult: async (payload) => {
|
|
389
|
-
// 🔑 steered dispatch不发送tool结果(让主dispatcher处理)
|
|
390
|
-
if (steerState.steered) {
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
376
|
const text = payload.text ?? "";
|
|
394
377
|
const hasMedia = Boolean(payload.mediaUrl || (payload.mediaUrls?.length ?? 0) > 0);
|
|
395
378
|
scopedLog().log(`[TOOL-RESULT] Tool result, text.length: ${text.length}`);
|
|
@@ -412,10 +395,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
412
395
|
}
|
|
413
396
|
},
|
|
414
397
|
onReasoningStream: async (payload) => {
|
|
415
|
-
// 🔑 steered dispatch不发送reasoning stream
|
|
416
|
-
if (steerState.steered) {
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
398
|
let text = payload.text ?? "";
|
|
420
399
|
// Strip "Reasoning:" prefix that some reasoning models add to their thinking output
|
|
421
400
|
const lines = text.split(/\r?\n/);
|
|
@@ -439,10 +418,6 @@ export function createXYReplyDispatcher(params) {
|
|
|
439
418
|
}
|
|
440
419
|
},
|
|
441
420
|
onPartialReply: async (payload) => {
|
|
442
|
-
// 🔑 steered dispatch不发送partial reply(让主dispatcher处理)
|
|
443
|
-
if (steerState.steered) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
421
|
const text = payload.text ?? "";
|
|
447
422
|
try {
|
|
448
423
|
if (text.length > 0) {
|