agentgui 1.0.787 → 1.0.788
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/lib/ws-optimizer.js +3 -2
- package/lib/ws-protocol.js +2 -1
- package/package.json +1 -1
package/lib/ws-optimizer.js
CHANGED
|
@@ -77,9 +77,10 @@ class ClientQueue {
|
|
|
77
77
|
}
|
|
78
78
|
const allowedCount = 100 - this.messageCount;
|
|
79
79
|
if (allowedCount <= 0) {
|
|
80
|
-
// Put everything back and
|
|
80
|
+
// Put everything back and wait for next 1-second window
|
|
81
81
|
this.normalPriority.unshift(...batch);
|
|
82
|
-
this.
|
|
82
|
+
const msUntilReset = Math.max(50, 1000 - (now - this.windowStart));
|
|
83
|
+
this.timer = setTimeout(() => { this.timer = null; this.flush(); }, msUntilReset);
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
85
86
|
// Return overflow to front of queue for next flush cycle
|
package/lib/ws-protocol.js
CHANGED
|
@@ -43,7 +43,8 @@ class WsRouter {
|
|
|
43
43
|
let parsed;
|
|
44
44
|
try {
|
|
45
45
|
parsed = decode(rawData);
|
|
46
|
-
} catch {
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.warn(`[ws-protocol] Decode failed for client ${ws.clientId}:`, err.message);
|
|
47
48
|
sendBinary(ws, { r: null, e: { c: 400, m: 'Invalid message' } });
|
|
48
49
|
return;
|
|
49
50
|
}
|