@ynhcj/xiaoyi-channel 0.0.212-next → 0.0.213-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 +10 -13
- package/package.json +1 -1
package/dist/src/bot.js
CHANGED
|
@@ -312,6 +312,14 @@ export async function handleXYMessage(params) {
|
|
|
312
312
|
pending.push(textForAgent);
|
|
313
313
|
steerQueue.set(queueKey, pending);
|
|
314
314
|
log.log(`[BOT-STEER] Queued for provider injection, sessionId=${queueKey}, queueDepth=${pending.length}`);
|
|
315
|
+
// Bypass dispatchReplyFromConfig entirely — steer injection is handled
|
|
316
|
+
// at the provider level (provider.ts drains the queue on every model call).
|
|
317
|
+
// No need for /steer command dispatch or dispatcher creation.
|
|
318
|
+
if (!skipReg) {
|
|
319
|
+
decrementTaskIdRef(parsed.sessionId);
|
|
320
|
+
}
|
|
321
|
+
params.onInitComplete?.();
|
|
322
|
+
return;
|
|
315
323
|
}
|
|
316
324
|
// Resolve envelope format options (following feishu pattern)
|
|
317
325
|
const envelopeOptions = core.channel.reply.resolveEnvelopeFormatOptions(cfg);
|
|
@@ -328,23 +336,12 @@ export async function handleXYMessage(params) {
|
|
|
328
336
|
envelope: envelopeOptions,
|
|
329
337
|
body: messageBody,
|
|
330
338
|
});
|
|
331
|
-
// 🔑 Steer messages use /steer prefix to trigger the native slash command
|
|
332
|
-
// fast path in get-reply, which calls handleSteerCommand → queueEmbedded-
|
|
333
|
-
// AgentMessageWithOutcomeAsync without going through admitReplyTurn or
|
|
334
|
-
// the isStreaming guard in runReplyAgent.
|
|
335
|
-
// CommandSource "native" is required so isNativeCommandTurn returns true
|
|
336
|
-
// and the fast path activates (otherwise it falls through to blocking admit).
|
|
337
|
-
const steerCommandBody = isUpdate ? `/steer ${textForAgent}` : textForAgent;
|
|
338
|
-
if (isUpdate) {
|
|
339
|
-
log.log(`[BOT-STEER] Dispatching via /steer command, sessionKey=${route.sessionKey}, cmdLen=${steerCommandBody.length}, CommandSource=native`);
|
|
340
|
-
}
|
|
341
339
|
// ✅ Finalize inbound context (following feishu pattern)
|
|
342
340
|
// Use route.accountId and route.sessionKey instead of parsed fields
|
|
343
341
|
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
344
342
|
Body: body,
|
|
345
|
-
RawBody:
|
|
346
|
-
CommandBody:
|
|
347
|
-
...(isUpdate ? { CommandSource: "native" } : {}),
|
|
343
|
+
RawBody: textForAgent,
|
|
344
|
+
CommandBody: textForAgent,
|
|
348
345
|
From: parsed.sessionId,
|
|
349
346
|
To: parsed.sessionId, // ✅ Simplified: use sessionId as target (context is managed by SessionKey)
|
|
350
347
|
SessionKey: route.sessionKey, // ✅ Use route.sessionKey
|