openclaw-channel-dmwork 0.2.20 → 0.2.22
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/inbound.ts +7 -0
package/package.json
CHANGED
package/src/inbound.ts
CHANGED
|
@@ -102,6 +102,7 @@ export async function handleInboundMessage(params: {
|
|
|
102
102
|
const mentionAll: boolean = message.payload?.mention?.all === true;
|
|
103
103
|
const isMentioned = mentionAll || mentionUids.includes(botUid);
|
|
104
104
|
|
|
105
|
+
|
|
105
106
|
if (!isMentioned) {
|
|
106
107
|
// Record as pending history context (manual — avoids SDK format incompatibility)
|
|
107
108
|
if (!groupHistories.has(sessionId)) {
|
|
@@ -167,12 +168,18 @@ export async function handleInboundMessage(params: {
|
|
|
167
168
|
id: sessionId,
|
|
168
169
|
},
|
|
169
170
|
});
|
|
171
|
+
// Ensure each account gets its own session key to avoid session lock conflicts
|
|
172
|
+
// when multiple bots are in the same group
|
|
173
|
+
if (route.sessionKey && account.accountId !== "default") {
|
|
174
|
+
route = { ...route, sessionKey: route.sessionKey.replace(":dmwork:", `:dmwork:${account.accountId}:`) };
|
|
175
|
+
}
|
|
170
176
|
|
|
171
177
|
} catch (routeErr) {
|
|
172
178
|
log?.error?.(`dmwork: resolveAgentRoute failed: ${String(routeErr)}`);
|
|
173
179
|
return;
|
|
174
180
|
}
|
|
175
181
|
|
|
182
|
+
|
|
176
183
|
const fromLabel = isGroup
|
|
177
184
|
? `group:${message.channel_id}`
|
|
178
185
|
: `user:${message.from_uid}`;
|