fix: stabilize health probe and gateway handshake

This commit is contained in:
Peter Steinberger
2025-12-10 00:52:43 +00:00
parent f1fd25e95e
commit cf8b00890f
3 changed files with 28 additions and 12 deletions

View File

@@ -76,7 +76,7 @@ async function probeWebConnect(timeoutMs: number): Promise<HealthConnect> {
const status = getStatusCode(err);
// Conflict/duplicate sessions are expected when the primary gateway session
// is already connected. Treat these as healthy so health checks dont flap.
if (status === 409 || status === 440 || status === 515) {
if (status === 409 || status === 515) {
return {
ok: true,
status,
@@ -239,8 +239,9 @@ export async function healthCommand(
opts: { json?: boolean; timeoutMs?: number; probe?: boolean },
runtime: RuntimeEnv,
) {
const probe = opts.probe ?? true;
const summary = await getHealthSnapshot(opts.timeoutMs, {
probe: opts.probe,
probe,
});
const fatal =
!summary.web.linked ||