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 CHANGED
@@ -563,8 +563,9 @@ function cleanupRelay(state: RelayState) {
563
563
  state.ws = null;
564
564
  }
565
565
  state.e2eSessions.clear();
566
- state.prevE2eSessions.clear();
567
- state.pendingFlushQueue.clear();
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
- // If the app provides an agentId, route to that agent's session:
1029
- // agent:<agentId>:mobile-<appSessionKey>
1030
- // Otherwise fall back to the default main agent route.
1031
- let sessionKey: string;
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
- if (appSessionKey) {
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
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-app",
3
3
  "name": "OpenClaw App",
4
- "version": "1.1.5",
4
+ "version": "1.1.6",
5
5
  "description": "Mobile app channel for OpenClaw — chat via the OpenClaw App app through a Cloudflare Worker relay.",
6
6
  "channels": [
7
7
  "openclaw-app"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-app",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "OpenClaw App channel plugin — relay bridge for the OpenClaw App app",
5
5
  "main": "index.ts",
6
6
  "type": "module",