@ynhcj/xiaoyi-channel 0.0.207-next → 0.0.208-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/index.js CHANGED
@@ -235,23 +235,26 @@ function registerFullHooks(api) {
235
235
  // picked up by the global hook runner.
236
236
  touchHookMarker("register_hook");
237
237
  api.on("before_prompt_build", async (event, ctx) => {
238
- touchHookMarker(`hook_fired_sessionId=${ctx.sessionId || "undefined"}`);
238
+ touchHookMarker(`hook_fired_sessionKey=${ctx.sessionKey || "undefined"}`);
239
239
  // Run skill-retriever first
240
240
  const baseResult = await baseBeforePromptBuildHandler(event, ctx);
241
- // Check for pending steer messages queued by bot.ts
242
- const sessionId = ctx.sessionId;
243
- if (!sessionId)
241
+ // Check for pending steer messages queued by bot.ts.
242
+ // Use ctx.sessionKey (NOT ctx.sessionId) because sessionId is
243
+ // OpenClaw's internal random UUID, while sessionKey contains the
244
+ // A2A conversationId and matches route.sessionKey from bot.ts.
245
+ const sessionKey = ctx.sessionKey;
246
+ if (!sessionKey)
244
247
  return baseResult;
245
248
  const queue = getSteerQueue();
246
- const pending = queue.get(sessionId);
249
+ const pending = queue.get(sessionKey);
247
250
  if (!pending || pending.length === 0)
248
251
  return baseResult;
249
252
  // Drain pending steer messages
250
- queue.delete(sessionId);
253
+ queue.delete(sessionKey);
251
254
  const steerText = pending.splice(0).join("\n\n");
252
255
  const steerAppend = `\n用户追加诉求:${steerText}`;
253
- logger.log(`[STEER-HOOK] Injecting steer: sessionId=${sessionId} textLen=${steerText.length}`);
254
- touchHookMarker(`steer_injected_sessionId=${sessionId}_len=${steerText.length}`);
256
+ logger.log(`[STEER-HOOK] Injecting steer: sessionKey=${sessionKey} textLen=${steerText.length}`);
257
+ touchHookMarker(`steer_injected_sessionKey=${sessionKey}_len=${steerText.length}`);
255
258
  // Merge steer appendContext with skill-retriever's result
256
259
  const merged = { ...(baseResult ?? {}) };
257
260
  if (merged.appendContext) {
package/dist/src/bot.js CHANGED
@@ -357,12 +357,11 @@ export async function handleXYMessage(params) {
357
357
  // the model on the next turn without blocking.
358
358
  if (isUpdate) {
359
359
  const steerQueue = getSteerQueue();
360
- // Use parsed.sessionId (A2A session UUID) as the queue key instead of
361
- // route.sessionKey. The agent_turn_prepare hook looks up by ctx.sessionId
362
- // which is the same A2A session UUID stored in the OpenClaw session entry.
363
- // Using sessionId avoids format mismatches between the channel's route-based
364
- // sessionKey and the agent runner's sessionKey.
365
- const queueKey = parsed.sessionId;
360
+ // Use route.sessionKey as the queue key. The hook looks up by
361
+ // ctx.sessionKey which is the same value (agent:main:direct:<peerId>).
362
+ // Do NOT use parsed.sessionId because ctx.sessionId in the hook
363
+ // context is OpenClaw's internal random UUID, not the A2A sessionId.
364
+ const queueKey = route.sessionKey;
366
365
  const pending = steerQueue.get(queueKey) ?? [];
367
366
  pending.push(textForAgent);
368
367
  steerQueue.set(queueKey, pending);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.207-next",
3
+ "version": "0.0.208-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",