diegosouzapw/OmniRoute · error · Error

loopback not ready within

Error message

loopback not ready within ${maxWaitMs}ms: ${lastErr instanceof Error ? lastErr.message : String(lastErr)}

What it means

Timeout error from the codex catalog revalidation readiness loop: the local loopback endpoint did not respond with any HTTP status within maxWaitMs despite repeated polling at pollMs intervals. lastErr holds the final fetch failure (connection refused, timeout, etc). It means model-sync cannot proceed because the internal server is not up.

Solutions

  1. Ensure the OmniRoute server is running and reachable at the resolved loopback baseUrl before revalidation
  2. Increase maxWaitMs or pollMs for slow startups
  3. Inspect lastErr for the root cause (ECONNREFUSED vs timeout)
  4. Verify port/hostname used by resolveModelSyncInternalBaseUrl is correct
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/shared/services/codexCatalogRevalidation.ts:193 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/ec950ddfcd91d6a5. Report an issue: GitHub.

Appendix: source

Thrown at src/shared/services/codexCatalogRevalidation.ts:193

  let lastErr: unknown;

  while (Date.now() < deadline) {
    try {
      const res = await fetchModelSyncInternal(
        `${baseUrl}/api/providers/__readiness_probe__/models`,
        {
          redirect: "error",
          signal: AbortSignal.timeout(1_500),
        }
      );
      if (res.status >= 200 && res.status < 600) return;
    } catch (err) {
      lastErr = err;
    }
    await new Promise((r) => setTimeout(r, pollMs));
  }

  throw new Error(
    `loopback not ready within ${maxWaitMs}ms: ${
      lastErr instanceof Error ? lastErr.message : String(lastErr)
    }`
  );
}

export async function liveResyncCodexConnections(
  apiBaseUrl?: string
): Promise<{ attempted: number; succeeded: number }> {
  const connections = await listActiveCodexConnectionIds();
  if (connections.length === 0) {
    return { attempted: 0, succeeded: 0 };
  }

  const { buildModelSyncInternalHeaders, fetchModelSyncInternal, resolveModelSyncInternalBaseUrl } =
    await import("./modelSyncScheduler");
  const base = resolveModelSyncInternalBaseUrl(apiBaseUrl);
  const results = await Promise.allSettled(

View on GitHub (pinned to a179ffed5b)