INNER CODE UNIT · TypeScript

ensureGatewayRouting

headroomlabs-ai/headroom · plugins/openclaw/src/plugin/index.ts:109

  const ensureGatewayRouting = async () => {
    if (gatewayProviderIds.length === 0) {
      return;
    }
    const activeProxyUrl = engine.getProxyUrl() ?? (await getConfiguredRoutingProxyUrl());
    if (!activeProxyUrl) {
      logger.debug?.("[headroom] Deferring upstream gateway routing until proxy is available");
      return;
    }
    await applyGatewayRouting(activeProxyUrl);
  };

  engine.onProxyReady(async (activeProxyUrl) => {
    await applyGatewayRouting(activeProxyUrl);
  });

  // Register as context engine
  api.registerContextEngine("headroom", () => engine);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…