openclaw-app 1.1.0 → 1.1.2
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 +7 -9
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -913,18 +913,16 @@ async function handleInbound(ctx: any, accountId: string, msg: any) {
|
|
|
913
913
|
peer: { kind: "direct", id: senderId },
|
|
914
914
|
});
|
|
915
915
|
|
|
916
|
-
//
|
|
917
|
-
//
|
|
918
|
-
//
|
|
919
|
-
//
|
|
916
|
+
// Derive an isolated Gateway session for each mobile conversation.
|
|
917
|
+
// If the app provides an agentId, route to that agent's session:
|
|
918
|
+
// agent:<agentId>:mobile-<appSessionKey>
|
|
919
|
+
// Otherwise fall back to the default main agent route.
|
|
920
920
|
let sessionKey: string;
|
|
921
921
|
const appSessionKey = msg.sessionKey ? String(msg.sessionKey) : null;
|
|
922
|
+
const msgAgentId = msg.agentId ? String(msg.agentId) : null;
|
|
922
923
|
if (appSessionKey) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
const colonIdx = mainKey.lastIndexOf(':');
|
|
926
|
-
const agentPrefix = colonIdx > 0 ? mainKey.substring(0, colonIdx + 1) : '';
|
|
927
|
-
sessionKey = `${agentPrefix}mobile-${appSessionKey}`;
|
|
924
|
+
const agentId = msgAgentId || 'main';
|
|
925
|
+
sessionKey = `agent:${agentId}:mobile-${appSessionKey}`;
|
|
928
926
|
} else {
|
|
929
927
|
sessionKey = route.mainSessionKey;
|
|
930
928
|
}
|
package/openclaw.plugin.json
CHANGED