mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:34:33 +00:00
fix(discord): preserve channel session keys via channel_id fallbacks (#17622)
* fix(discord): preserve channel session keys via channel_id fallbacks * docs(changelog): add discord session continuity note * Tests: cover discord channel_id fallback --------- Co-authored-by: Shadow <hi@shadowing.dev>
This commit is contained in:
@@ -141,6 +141,17 @@ describe("resolveAgentRoute", () => {
|
||||
expect(route.matchedBy).toBe("binding.peer");
|
||||
});
|
||||
|
||||
test("coerces numeric peer ids to stable session keys", () => {
|
||||
const cfg: OpenClawConfig = {};
|
||||
const route = resolveAgentRoute({
|
||||
cfg,
|
||||
channel: "discord",
|
||||
accountId: "default",
|
||||
peer: { kind: "channel", id: 1468834856187203680n as unknown as string },
|
||||
});
|
||||
expect(route.sessionKey).toBe("agent:main:discord:channel:1468834856187203680");
|
||||
});
|
||||
|
||||
test("guild binding wins over account binding when peer not bound", () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
bindings: [
|
||||
|
||||
Reference in New Issue
Block a user