@ynhcj/xiaoyi-channel 0.0.216-next → 0.0.217-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.
Files changed (2) hide show
  1. package/dist/src/bot.js +10 -2
  2. package/package.json +1 -1
package/dist/src/bot.js CHANGED
@@ -378,13 +378,21 @@ export async function handleXYMessage(params) {
378
378
  // 🔑 创建dispatcher
379
379
  log.log(`[BOT-DISPATCHER] Creating reply dispatcher, isSteer=${isUpdate}, sessionKey=${route.sessionKey}`);
380
380
  // Cleanup: 必须在 onIdle 内部执行(参见 reply-dispatcher.ts 中 onIdleComplete 的注释)
381
+ // Steer dispatches must NOT decrement refCount because the steer injection
382
+ // uses skipRegistration (no increment). Only the original message's
383
+ // dispatcher owns the refCount lifecycle.
381
384
  let cleaned = false;
382
385
  const cleanup = () => {
383
386
  if (cleaned)
384
387
  return;
385
388
  cleaned = true;
386
- log.log(`[BOT] Cleanup started`);
387
- decrementTaskIdRef(parsed.sessionId);
389
+ log.log(`[BOT] Cleanup started, steered=${steerState.steered}`);
390
+ if (!steerState.steered) {
391
+ decrementTaskIdRef(parsed.sessionId);
392
+ }
393
+ else {
394
+ log.log(`[BOT] Steered cleanup, skipping decrementTaskIdRef`);
395
+ }
388
396
  log.log(`[BOT] Cleanup completed`);
389
397
  };
390
398
  const { dispatcher, replyOptions, markDispatchIdle, startStatusInterval, updateFallbackTaskId } = createXYReplyDispatcher({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.216-next",
3
+ "version": "0.0.217-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",