{"record":{"id":"25719e32a103afc6","repo":"tinyhumansai/openhuman","slug":"rpc-method-timed-out-after-timeoutms-ms-25719e","errorCode":null,"errorMessage":"RPC ${method} timed out after ${timeoutMs}ms","messagePattern":"RPC (.+?) timed out after (.+?)ms","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/debug/harness-cache-audit.mjs","lineNumber":216,"sourceCode":"  let res;\n  try {\n    res = await fetch(coreUrl, {\n      method: \"POST\",\n      signal: controller.signal,\n      headers: {\n        \"content-type\": \"application/json\",\n        authorization: `Bearer ${token}`,\n      },\n      body: JSON.stringify({\n        jsonrpc: \"2.0\",\n        id: `audit-${Date.now()}-${Math.random().toString(16).slice(2)}`,\n        method,\n        params,\n      }),\n    });\n  } catch (err) {\n    if (err?.name === \"AbortError\") {\n      throw new Error(`RPC ${method} timed out after ${timeoutMs}ms`);\n    }\n    throw err;\n  } finally {\n    clearTimeout(timeout);\n  }\n  const bodyText = await res.text();\n  let body;\n  try {\n    body = JSON.parse(bodyText);\n  } catch {\n    throw new Error(`RPC ${method} returned non-JSON HTTP ${res.status}`);\n  }\n  if (!res.ok) {\n    throw new Error(`RPC ${method} HTTP ${res.status}`);\n  }\n  if (body.error) {\n    throw new Error(`RPC ${method} error`);\n  }","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/scripts/debug/harness-cache-audit.mjs#L198-L234","documentation":"rpc() in harness-cache-audit.mjs aborts any JSON-RPC POST exceeding its per-call timeout (default 600000 ms, tunable via --rpc-timeout-ms; the internal core.ping probe uses 10 s) and translates the resulting AbortError into this message naming the method and limit. Each audit turn is a full openhuman.agent_chat delegation, so the timeout primarily bounds model inference plus tool execution time.","triggerScenarios":"An agent_chat turn with tool loops (file reads, skills, subagents) exceeding --rpc-timeout-ms; a wedged core; provider rate-limit backoff; lowering --rpc-timeout-ms for a smoke run and forgetting to restore it before a 3+ turn audit; system sleep suspending the process mid-request.","commonSituations":"Slow model or long cache-audit prompts pushing past 10 minutes; core also serving desktop traffic; laptop suspend during a run; CI network throttling to the inference provider.","solutions":["Raise the limit: `--rpc-timeout-ms 1200000`","Retry — transient provider stalls often clear","Reduce work: fewer `--turns`, cheaper `--model`, shorter `--prompt`","Check whether the core is alive/responsive (GET /health) to distinguish hung core from slow turn","Rerun with --verbose to see per-turn response characters and where it stalls"],"exampleFix":"# before\nnode scripts/debug/harness-cache-audit.mjs --turns 4 --rpc-timeout-ms 120000\n# Error: RPC openhuman.agent_chat timed out after 120000ms\n\n# after\nnode scripts/debug/harness-cache-audit.mjs --turns 4 --rpc-timeout-ms 900000","handlingStrategy":"retry","validationCode":"// pre-flight ping with a short budget to fail fast on connectivity problems\n// before burning a 10-minute per-turn timeout\ntry {\n  await rpc(coreUrl, token, \"core.ping\", {}, 5_000);\n} catch {\n  console.error(\"core not answering within 5s — resolve connectivity before the audit\");\n  process.exit(2);\n}","typeGuard":"const isRpcTimeout = (err) => /RPC .* timed out after \\d+ms/.test(err?.message || \"\");","tryCatchPattern":"let attempt = 0;\nwhile (true) {\n  try {\n    return await rpc(coreUrl, token, \"openhuman.agent_chat\", params, opts.rpcTimeoutMs);\n  } catch (err) {\n    attempt += 1;\n    if (isRpcTimeout(err) && attempt < 2) {\n      await new Promise((r) => setTimeout(r, 5_000)); // one retry: provider stalls are often transient\n      continue;\n    }\n    throw err;\n  }\n}","preventionTips":["Set --rpc-timeout-ms from the slowest expected turn, not the fastest","Keep audits off cores that simultaneously serve interactive desktop traffic","Disable system sleep for long audit runs — a suspended laptop surfaces as this exact timeout"],"tags":["rpc","timeout","network","llm-inference"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}