openclaw-app 1.1.5 → 1.1.6
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/index.ts +13 -8
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -563,8 +563,9 @@ function cleanupRelay(state: RelayState) {
|
|
|
563
563
|
state.ws = null;
|
|
564
564
|
}
|
|
565
565
|
state.e2eSessions.clear();
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
// prevE2eSessions is intentionally kept across reconnects so that
|
|
567
|
+
// offline-buffered messages can still be re-encrypted after a plugin
|
|
568
|
+
// reconnect. pendingFlushQueue is also kept for the same reason.
|
|
568
569
|
}
|
|
569
570
|
|
|
570
571
|
function connectRelay(ctx: any, account: ResolvedAccount) {
|
|
@@ -1025,13 +1026,17 @@ async function handleInbound(ctx: any, accountId: string, msg: any) {
|
|
|
1025
1026
|
});
|
|
1026
1027
|
|
|
1027
1028
|
// Derive an isolated Gateway session for each mobile conversation.
|
|
1028
|
-
//
|
|
1029
|
-
//
|
|
1030
|
-
//
|
|
1031
|
-
|
|
1029
|
+
//
|
|
1030
|
+
// chatSessionKey format from app: "agent:<agentId>:<uuid1>-<uuid2>"
|
|
1031
|
+
// We use this as the stable per-conversation identity on the Gateway side.
|
|
1032
|
+
// appSessionKey is the wire-level connection ID — used for E2E reply routing.
|
|
1032
1033
|
const appSessionKey = msg.sessionKey ? String(msg.sessionKey) : null;
|
|
1033
1034
|
const msgAgentId = msg.agentId ? String(msg.agentId) : null;
|
|
1034
|
-
|
|
1035
|
+
let sessionKey: string;
|
|
1036
|
+
if (chatSessionKey) {
|
|
1037
|
+
// chatSessionKey from app: "agent:<agentId>:<uuid>" — use as-is for Gateway routing
|
|
1038
|
+
sessionKey = chatSessionKey;
|
|
1039
|
+
} else if (appSessionKey) {
|
|
1035
1040
|
const agentId = msgAgentId || 'main';
|
|
1036
1041
|
sessionKey = `agent:${agentId}:mobile-${appSessionKey}`;
|
|
1037
1042
|
} else {
|
|
@@ -1203,4 +1208,4 @@ export default function register(api: any) {
|
|
|
1203
1208
|
});
|
|
1204
1209
|
|
|
1205
1210
|
api.logger?.info?.("[openclaw-app] Plugin registered");
|
|
1206
|
-
}
|
|
1211
|
+
}
|
package/openclaw.plugin.json
CHANGED