{"record":{"id":"cdf65ef66ad9df5d","repo":"NousResearch/hermes-agent","slug":"hermes-gateway-unavailable","errorCode":null,"errorMessage":"Hermes gateway unavailable","messagePattern":"Hermes gateway unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/desktop/src/app/gateway/hooks/use-gateway-request.ts","lineNumber":111,"sourceCode":"\n        connectionRef.current = null\n        setConnection(null)\n\n        return null\n      } finally {\n        reconnectingRef.current = null\n      }\n    })()\n\n    return reconnectingRef.current\n  }, [])\n\n  const requestGateway = useCallback(\n    async <T>(method: string, params: Record<string, unknown> = {}, timeoutMs?: number, signal?: AbortSignal) => {\n      const gateway = gatewayRef.current\n\n      if (!gateway) {\n        throw new Error('Hermes gateway unavailable')\n      }\n\n      try {\n        return await gateway.request<T>(method, params, timeoutMs, signal)\n      } catch (error) {\n        const message = error instanceof Error ? error.message : String(error)\n\n        if (!/not connected|connection closed/i.test(message)) {\n          throw error\n        }\n\n        // Primary keeps the OAuth-aware reconnect (remote gateways re-mint a\n        // single-use ticket); background profiles are always local pool\n        // backends, so the registry handles their reconnect with no reauth.\n        const recovered = isActivePrimary() ? await ensureGatewayOpen() : await ensureActiveGatewayOpen()\n\n        if (!recovered) {\n          // Prefer the reauth error from the failed reconnect (OAuth session","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/app/gateway/hooks/use-gateway-request.ts#L93-L129","documentation":"Error \"Hermes gateway unavailable\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at apps/desktop/src/app/gateway/hooks/use-gateway-request.ts:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the Hermes backend is running and reachable (Settings → Gateway).","Reconnect or restart the backend, then retry the request.","Check network/proxy/firewall between the desktop app and the gateway."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}