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; }