adp-openclaw 0.0.18 → 0.0.20
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/package.json +1 -1
- package/src/monitor.ts +14 -23
package/package.json
CHANGED
package/src/monitor.ts
CHANGED
|
@@ -239,7 +239,15 @@ async function connectAndHandle(params: ConnectParams): Promise<void> {
|
|
|
239
239
|
// This ensures session history is correctly associated
|
|
240
240
|
const peerId = inMsg.conversationId;
|
|
241
241
|
const route = runtime.channel.routing.resolveAgentRoute({
|
|
242
|
-
cfg:
|
|
242
|
+
cfg: {
|
|
243
|
+
...(cfg ?? {}),
|
|
244
|
+
session: {
|
|
245
|
+
...(cfg?.session ?? {}),
|
|
246
|
+
// Override dmScope to "per-peer" so each user gets their own session
|
|
247
|
+
// This prevents all DM users from sharing the same "main" session
|
|
248
|
+
dmScope: "per-peer",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
243
251
|
channel: "adp-openclaw",
|
|
244
252
|
accountId: "default",
|
|
245
253
|
peer: {
|
|
@@ -379,28 +387,11 @@ async function connectAndHandle(params: ConnectParams): Promise<void> {
|
|
|
379
387
|
// Debug log for all deliver calls - log the actual info object
|
|
380
388
|
log?.info(`[adp-openclaw] deliver called: kind=${kind}, text.length=${text.length}, info=${JSON.stringify(info)}`);
|
|
381
389
|
|
|
382
|
-
// Handle streaming block -
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
type: MsgType.OutboundChunk,
|
|
388
|
-
requestId: generateRequestId(),
|
|
389
|
-
payload: {
|
|
390
|
-
to: inMsg.from,
|
|
391
|
-
chunk: text,
|
|
392
|
-
conversationId: inMsg.conversationId,
|
|
393
|
-
recordId: inMsg.recordId, // Pass recordId back to server
|
|
394
|
-
streamId: streamId,
|
|
395
|
-
index: chunkIndex,
|
|
396
|
-
isPartial: true, // Mark as partial chunk, final data will be in outbound_end
|
|
397
|
-
user: inMsg.user,
|
|
398
|
-
},
|
|
399
|
-
timestamp: Date.now(),
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
ws.send(JSON.stringify(chunkMsg));
|
|
403
|
-
chunkIndex++;
|
|
390
|
+
// Handle streaming block - IGNORE because handlePartial already sent deltas
|
|
391
|
+
// The "block" callback contains cumulative text (same as final), not incremental delta
|
|
392
|
+
// Sending it would cause duplicate data on the server side
|
|
393
|
+
if (kind === "block") {
|
|
394
|
+
log?.debug?.(`[adp-openclaw] Ignoring block callback (handlePartial already sent deltas), text.length=${text.length}`);
|
|
404
395
|
return;
|
|
405
396
|
}
|
|
406
397
|
|