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:
@@ -570,7 +570,9 @@ describe("chat directive tag stripping for non-streaming final payloads", () =>
|
||||
context,
|
||||
respond,
|
||||
idempotencyKey: "idem-custom-no-cross-route",
|
||||
sessionKey: "agent:main:work",
|
||||
// Keep a second custom scope token so legacy-shape detection is exercised.
|
||||
// "agent:main:work" only yields one rest token and does not hit that path.
|
||||
sessionKey: "agent:main:work:ticket-123",
|
||||
expectBroadcast: false,
|
||||
});
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user