fix: gate ssh pool readiness on provider status

This commit is contained in:
Codex
2026-07-04 20:50:19 +00:00
parent ff40e1fdea
commit c9fbf48990
+12 -4
View File
@@ -238,6 +238,7 @@ export async function debugSshPool(_config: UniDeskConfig, providerId: string):
};
}
const labels = recordValue(node.labels);
const nodeStatus = stringValue(node.status);
const pool = {
transport: stringValue(labels.providerGatewaySshDataTransport),
host: stringValue(labels.providerGatewaySshDataHost),
@@ -252,20 +253,27 @@ export async function debugSshPool(_config: UniDeskConfig, providerId: string):
const ready = Number(pool.ready ?? 0);
const claimed = Number(pool.claimed ?? 0);
const desired = Number(pool.desired ?? 0);
const ok = pool.transport === "tcp-pool" && Number.isFinite(ready) && ready > 0;
const providerOnline = nodeStatus === "online";
const poolLabelReady = pool.transport === "tcp-pool" && Number.isFinite(ready) && ready > 0;
const executionPathReady = providerOnline && poolLabelReady;
return {
ok,
ok: executionPathReady,
providerId,
providerOnline,
poolLabelReady,
executionPathReady,
node: {
providerId: node.providerId,
name: node.name,
status: node.status,
status: nodeStatus,
lastHeartbeat: node.lastHeartbeat ?? null,
updatedAt: node.updatedAt ?? null,
},
pool,
hostPressure: providerHostPressureSummary(providerId),
classification: ok
classification: !providerOnline
? (nodeStatus === "offline" ? "provider-offline" : "provider-not-online")
: poolLabelReady
? "ssh-tcp-pool-ready"
: pool.transport !== "tcp-pool"
? "provider-gateway-upgrade-required"