@ynhcj/xiaoyi-channel 0.0.210-next → 0.0.211-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/bot.js CHANGED
@@ -318,13 +318,19 @@ export async function handleXYMessage(params) {
318
318
  // fast path in get-reply, which calls handleSteerCommand → queueEmbedded-
319
319
  // AgentMessageWithOutcomeAsync without going through admitReplyTurn or
320
320
  // the isStreaming guard in runReplyAgent.
321
+ // CommandSource "native" is required so isNativeCommandTurn returns true
322
+ // and the fast path activates (otherwise it falls through to blocking admit).
321
323
  const steerCommandBody = isUpdate ? `/steer ${textForAgent}` : textForAgent;
324
+ if (isUpdate) {
325
+ log.log(`[BOT-STEER] Dispatching via /steer command, sessionKey=${route.sessionKey}, cmdLen=${steerCommandBody.length}, CommandSource=native`);
326
+ }
322
327
  // ✅ Finalize inbound context (following feishu pattern)
323
328
  // Use route.accountId and route.sessionKey instead of parsed fields
324
329
  const ctxPayload = core.channel.reply.finalizeInboundContext({
325
330
  Body: body,
326
331
  RawBody: steerCommandBody,
327
332
  CommandBody: steerCommandBody,
333
+ ...(isUpdate ? { CommandSource: "native" } : {}),
328
334
  From: parsed.sessionId,
329
335
  To: parsed.sessionId, // ✅ Simplified: use sessionId as target (context is managed by SessionKey)
330
336
  SessionKey: route.sessionKey, // ✅ Use route.sessionKey
@@ -348,7 +354,7 @@ export async function handleXYMessage(params) {
348
354
  // response and cleanup — the first message's dispatcher handles those.
349
355
  const steerState = { steered: isUpdate };
350
356
  // 🔑 创建dispatcher
351
- log.log(`[BOT-DISPATCHER] Creating reply dispatcher`);
357
+ log.log(`[BOT-DISPATCHER] Creating reply dispatcher, isSteer=${isUpdate}, sessionKey=${route.sessionKey}`);
352
358
  // Cleanup: 必须在 onIdle 内部执行(参见 reply-dispatcher.ts 中 onIdleComplete 的注释)
353
359
  let cleaned = false;
354
360
  const cleanup = () => {
@@ -423,7 +429,7 @@ export async function handleXYMessage(params) {
423
429
  });
424
430
  // 区分 steer 成功(undefined)和 steer 失败/正常 run(有结果)
425
431
  if (result === undefined) {
426
- log.log(`[BOT-DISPATCH] dispatchReplyFromConfig returned undefined — steer injected successfully`);
432
+ log.log(`[BOT-STEER] dispatchReplyFromConfig returned undefined — steer injected via fast path OK, sessionKey=${route.sessionKey}`);
427
433
  }
428
434
  else {
429
435
  log.log(`[BOT-DISPATCH] dispatchReplyFromConfig returned, resultType=${typeof result}, isSteer=${isSteerDispatch}, steered=${steerState.steered}`);
@@ -138,7 +138,7 @@ export async function monitorXYProvider(opts = {}) {
138
138
  const steerMode = cfg.messages?.queue?.mode === "steer";
139
139
  const hasActiveRun = hasActiveTask(parsed.sessionId);
140
140
  if (steerMode && hasActiveRun) {
141
- logger.log(`[MONITOR-HANDLER] STEER MODE: Concurrent execution for ${messageKey}`);
141
+ logger.log(`[MONITOR] STEER MODE: executing concurrently, sessionId=${parsed.sessionId}, messageKey=${messageKey}`);
142
142
  void task().catch((err) => {
143
143
  logger.error(`XY gateway: concurrent steer task failed for ${messageKey}: ${String(err)}`);
144
144
  activeMessages.delete(messageKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.210-next",
3
+ "version": "0.0.211-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",