@runuai/host 0.9.73 → 0.9.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.ts +13 -3
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -252,6 +252,12 @@ const bridgeUrl =
|
|
|
252
252
|
let ws: WebSocket | null = null;
|
|
253
253
|
let stopping = false;
|
|
254
254
|
let fatal = false;
|
|
255
|
+
/** Auth-rejected (4001) retry cadence. A genuinely revoked credential costs
|
|
256
|
+
* one connection attempt per interval; a transient rejection (the bridge's
|
|
257
|
+
* own DB down during a cloud restart, an auth frame lost on a slow link)
|
|
258
|
+
* heals without an operator visit — the 2026-08-27 outage stranded every
|
|
259
|
+
* connected host overnight because 4001 was treated as terminal. */
|
|
260
|
+
const AUTH_REJECTED_RETRY_MS = 5 * 60_000;
|
|
255
261
|
let reconnectAttempt = 0;
|
|
256
262
|
let connectionRequestGeneration = 0;
|
|
257
263
|
let inFlight = 0;
|
|
@@ -1642,12 +1648,16 @@ async function connect(): Promise<void> {
|
|
|
1642
1648
|
return;
|
|
1643
1649
|
}
|
|
1644
1650
|
if (code === 4001) {
|
|
1645
|
-
fatal = true;
|
|
1646
1651
|
markDisconnected(text || "auth rejected by bridge");
|
|
1647
1652
|
console.error(
|
|
1648
|
-
`[host-agent] auth rejected by bridge${text ? `: ${text}` : ""}`,
|
|
1653
|
+
`[host-agent] auth rejected by bridge${text ? `: ${text}` : ""} — retrying in ${Math.round(AUTH_REJECTED_RETRY_MS / 60_000)} minutes`,
|
|
1649
1654
|
);
|
|
1650
|
-
|
|
1655
|
+
addHostBreadcrumb("bridge", "auth-rejected", {
|
|
1656
|
+
retryInMs: AUTH_REJECTED_RETRY_MS,
|
|
1657
|
+
});
|
|
1658
|
+
setTimeout(() => {
|
|
1659
|
+
void connect();
|
|
1660
|
+
}, AUTH_REJECTED_RETRY_MS);
|
|
1651
1661
|
return;
|
|
1652
1662
|
}
|
|
1653
1663
|
const delay = reconnectDelay();
|