fix(gateway): pass sessionKey to heartbeat in hooks handlers

Addresses code review feedback by ensuring the sessionKey is consistently propagated to requestHeartbeatNow in both the success and error paths.
This commit is contained in:
eviaaaaa 2026-02-20 15:29:28 +08:00 committed by Kaspre
parent d57cbc5244
commit fc6fde280f

View File

@ -94,7 +94,7 @@ export function createGatewayHooksRequestHandler(params: {
sessionKey: mainSessionKey,
});
if (value.wakeMode === "now") {
requestHeartbeatNow({ reason: `hook:${jobId}` });
requestHeartbeatNow({ reason: `hook:${jobId}`, sessionKey: mainSessionKey });
}
}
} catch (err) {
@ -103,7 +103,7 @@ export function createGatewayHooksRequestHandler(params: {
sessionKey: mainSessionKey,
});
if (value.wakeMode === "now") {
requestHeartbeatNow({ reason: `hook:${jobId}:error` });
requestHeartbeatNow({ reason: `hook:${jobId}:error`, sessionKey: mainSessionKey });
}
}
})();