fix(telegram): namespace slash SessionKey by agent

Fixes openclaw/openclaw#38648
This commit is contained in:
john
2026-03-07 15:55:15 +08:00
committed by Ayaan Zaidi
parent 05c240fad6
commit e8f419c4e0
2 changed files with 2 additions and 2 deletions

View File

@@ -198,7 +198,7 @@ describe("registerTelegramNativeCommands — session metadata", () => {
)[0]?.[0]; )[0]?.[0];
expect(call?.ctx?.OriginatingChannel).toBe("telegram"); expect(call?.ctx?.OriginatingChannel).toBe("telegram");
expect(call?.ctx?.Provider).toBe("telegram"); expect(call?.ctx?.Provider).toBe("telegram");
expect(call?.sessionKey).toBeDefined(); expect(call?.sessionKey).toBe("agent:main:telegram:slash:200");
}); });
it("awaits session metadata persistence before dispatch", async () => { it("awaits session metadata persistence before dispatch", async () => {

View File

@@ -669,7 +669,7 @@ export const registerTelegramNativeCommands = ({
WasMentioned: true, WasMentioned: true,
CommandAuthorized: commandAuthorized, CommandAuthorized: commandAuthorized,
CommandSource: "native" as const, CommandSource: "native" as const,
SessionKey: `telegram:slash:${senderId || chatId}`, SessionKey: `agent:${route.agentId}:telegram:slash:${senderId || chatId}`,
AccountId: route.accountId, AccountId: route.accountId,
CommandTargetSessionKey: sessionKey, CommandTargetSessionKey: sessionKey,
MessageThreadId: threadSpec.id, MessageThreadId: threadSpec.id,