fix(gateway): narrow legacy route inheritance for custom session keys (openclaw#33932) thanks @Takhoffman

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Tak Hoffman
2026-03-03 22:45:46 -06:00
committed by GitHub
parent 4bc466422f
commit b4e4e25e74
3 changed files with 7 additions and 2 deletions

View File

@@ -876,7 +876,9 @@ export const chatHandlers: GatewayRequestHandlers = {
CHANNEL_SCOPED_SESSION_SHAPES.has(part),
);
const hasLegacyChannelPeerShape =
!isChannelScopedSession && typeof sessionScopeParts[1] === "string";
!isChannelScopedSession &&
typeof sessionScopeParts[1] === "string" &&
sessionChannelHint === routeChannelCandidate;
// Only inherit prior external route metadata for channel-scoped sessions.
// Channel-agnostic sessions (main, direct:<peer>, etc.) can otherwise
// leak stale routes across surfaces.