fix(heartbeat): scope exec wake dispatch to session key (#32724)

Merged via squash.

Prepared head SHA: 563fee0e65
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
Altay
2026-03-03 14:47:40 +03:00
committed by GitHub
parent 1ded5cc9a9
commit 627813aba4
8 changed files with 180 additions and 7 deletions

View File

@@ -30,6 +30,13 @@ function normalizeToken(value: string | undefined | null): string {
return (value ?? "").trim().toLowerCase();
}
export function scopedHeartbeatWakeOptions<T extends object>(
sessionKey: string,
wakeOptions: T,
): T | (T & { sessionKey: string }) {
return parseAgentSessionKey(sessionKey) ? { ...wakeOptions, sessionKey } : wakeOptions;
}
export function normalizeMainKey(value: string | undefined | null): string {
const trimmed = (value ?? "").trim();
return trimmed ? trimmed.toLowerCase() : DEFAULT_MAIN_KEY;