fluxy-bot 0.5.22 → 0.5.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.5.22",
3
+ "version": "0.5.23",
4
4
  "description": "Self-hosted, self-evolving AI agent with its own dashboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -715,18 +715,27 @@ export async function startSupervisor() {
715
715
  }
716
716
  }
717
717
 
718
- // Poll until the full chain is actually working (avoid 502s)
719
- // Cache-busting query param prevents browsers/CDN from serving stale 502s
718
+ // Poll until the full relay→tunnel→server chain is actually working.
719
+ // A 502/503 means the relay can't reach the tunnel yet; anything else
720
+ // (200, 401, 403, etc.) means the chain is live.
720
721
  const probeUrl = config.relay?.url || tunnelUrl;
721
722
  let ready = false;
722
- for (let i = 0; i < 20; i++) {
723
+ log.info(`Readiness probe: polling ${probeUrl}`);
724
+ for (let i = 0; i < 30; i++) {
723
725
  try {
724
726
  const res = await fetch(probeUrl + `/api/health?_cb=${Date.now()}`, {
725
727
  signal: AbortSignal.timeout(3000),
726
- headers: { 'Cache-Control': 'no-cache' },
728
+ headers: { 'Cache-Control': 'no-cache, no-store' },
727
729
  });
728
- if (res.ok) { ready = true; break; }
729
- } catch {}
730
+ log.info(`Readiness probe #${i + 1}: ${res.status}`);
731
+ // Any non-502/503 means the relay is reaching the tunnel
732
+ if (res.status !== 502 && res.status !== 503) {
733
+ ready = true;
734
+ break;
735
+ }
736
+ } catch (err) {
737
+ log.info(`Readiness probe #${i + 1}: ${err instanceof Error ? err.message : 'error'}`);
738
+ }
730
739
  await new Promise(r => setTimeout(r, 1000));
731
740
  }
732
741
  if (!ready) {