From 56ca8f2eab52c52d2196e90eef1da9225c08a264 Mon Sep 17 00:00:00 2001 From: quotentiroler Date: Sun, 8 Feb 2026 10:44:18 -0800 Subject: [PATCH] fix: accept legacy 'dm' in session key parsing for backward compat getDmHistoryLimitFromSessionKey now accepts both :dm: and :direct: to ensure old session keys continue to work correctly. --- src/agents/pi-embedded-runner/history.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agents/pi-embedded-runner/history.ts b/src/agents/pi-embedded-runner/history.ts index b7a6943a3f..0340c315cc 100644 --- a/src/agents/pi-embedded-runner/history.ts +++ b/src/agents/pi-embedded-runner/history.ts @@ -58,7 +58,8 @@ export function getDmHistoryLimitFromSessionKey( const kind = providerParts[1]?.toLowerCase(); const userIdRaw = providerParts.slice(2).join(":"); const userId = stripThreadSuffix(userIdRaw); - if (kind !== "direct") { + // Accept both "direct" (new) and "dm" (legacy) for backward compat + if (kind !== "direct" && kind !== "dm") { return undefined; }