@ynhcj/xiaoyi-channel 0.0.129-next → 0.0.130-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.
@@ -29,27 +29,6 @@ function createSessionQueue() {
29
29
  return next;
30
30
  };
31
31
  }
32
- /**
33
- * Per-session serial queue for steer messages only.
34
- * Steer messages must run concurrently with the main query (which may block for
35
- * minutes inside the Pi agent loop), but must be serialized among themselves to
36
- * prevent concurrent dispatchReplyFromConfig calls that can drop mid-stream
37
- * steer messages under race conditions.
38
- */
39
- function createSteerQueue() {
40
- const queues = new Map();
41
- return (sessionId, task) => {
42
- const prev = queues.get(sessionId) ?? Promise.resolve();
43
- const next = prev.then(task, task);
44
- queues.set(sessionId, next);
45
- void next.finally(() => {
46
- if (queues.get(sessionId) === next) {
47
- queues.delete(sessionId);
48
- }
49
- });
50
- return next;
51
- };
52
- }
53
32
  /**
54
33
  * Monitor XY channel WebSocket connections.
55
34
  * Keeps the connection alive until abortSignal is triggered.
@@ -86,9 +65,6 @@ export async function monitorXYProvider(opts = {}) {
86
65
  const activeMessages = new Set();
87
66
  // Create session queue for ordered message processing
88
67
  const enqueue = createSessionQueue();
89
- // Steer-only serial queue: keeps steer messages concurrent with the main
90
- // query but serialized among themselves to avoid race conditions.
91
- const enqueueSteer = createSteerQueue();
92
68
  // Global gate that serializes dispatch initialization across sessions.
93
69
  // When a new session starts dispatching, it acquires this gate and holds it
94
70
  // until agent setup (agentTools + wrapStreamFn) is complete, then releases it.
@@ -142,12 +118,11 @@ export async function monitorXYProvider(opts = {}) {
142
118
  const steerMode = cfg.messages?.queue?.mode === "steer";
143
119
  const hasActiveRun = hasActiveTask(parsed.sessionId);
144
120
  if (steerMode && hasActiveRun) {
145
- // Steer模式且有活跃任务:通过 steer 专用队列串行执行,与主消息并发但
146
- // 避免多个 steer 同时进入 dispatchReplyFromConfig 导致中间消息丢失
147
- logger.log(`[MONITOR-HANDLER] 🔄 STEER MODE: Enqueuing steer for messageKey=${messageKey}`);
121
+ // Steer模式且有活跃任务:不入队列,直接并发执行
122
+ logger.log(`[MONITOR-HANDLER] 🔄 STEER MODE: Executing concurrently for messageKey=${messageKey}`);
148
123
  logger.log(`[MONITOR-HANDLER] - sessionId: ${parsed.sessionId}`);
149
- void enqueueSteer(parsed.sessionId, task).catch((err) => {
150
- logger.error(`XY gateway: steer queue processing failed for ${messageKey}: ${String(err)}`);
124
+ void task().catch((err) => {
125
+ logger.error(`XY gateway: concurrent steer task failed for ${messageKey}: ${String(err)}`);
151
126
  activeMessages.delete(messageKey);
152
127
  });
153
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.129-next",
3
+ "version": "0.0.130-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",