tinyhumansai/openhuman · error · Error

RPC ${method} timed out after ${timeoutMs}ms

Error message

RPC ${method} timed out after ${timeoutMs}ms

What it means

The rpc() helper in scripts/debug/agent-prepare-context-audit.mjs wraps fetch with an AbortController set to the per-call timeout (default 600000 ms, overridable via --rpc-timeout-ms). When the abort fires, the fetch rejects with AbortError and is rethrown as 'RPC <method> timed out after <N>ms'. The audit drives real orchestrator/inference turns, which are the slow calls that typically hit this.

Source

Thrown at scripts/debug/agent-prepare-context-audit.mjs:267

  let res;
  try {
    res = await fetch(coreUrl, {
      method: "POST",
      signal: controller.signal,
      headers: {
        "content-type": "application/json",
        authorization: `Bearer ${token}`,
      },
      body: JSON.stringify({
        jsonrpc: "2.0",
        id: `apc-${Date.now()}-${Math.random().toString(16).slice(2)}`,
        method,
        params,
      }),
    });
  } catch (err) {
    if (err?.name === "AbortError")
      throw new Error(`RPC ${method} timed out after ${timeoutMs}ms`);
    throw err;
  } finally {
    clearTimeout(timeout);
  }
  const bodyText = await res.text();
  let body;
  try {
    body = JSON.parse(bodyText);
  } catch {
    throw new Error(
      `RPC ${method} returned non-JSON HTTP ${res.status}: ${bodyText.slice(0, 200)}`,
    );
  }
  if (!res.ok) throw new Error(`RPC ${method} HTTP ${res.status}`);
  if (body.error)
    throw new Error(
      `RPC ${method} error: ${JSON.stringify(body.error).slice(0, 300)}`,
    );

View on GitHub (pinned to a221052e0d)

Solutions

  1. Raise the budget: --rpc-timeout-ms 1200000 (20 min) or higher for slow models
  2. Narrow the audit to one case (--query "...") to confirm it's volume, not a hang
  3. Check the core is actually progressing (its logs/workspace) rather than deadlocked — a hang will time out at any budget
  4. Use --model to pick a faster model if the turn itself is the slow part

Example fix

# before
$ node scripts/debug/agent-prepare-context-audit.mjs
Error: RPC openhuman.inference_agent_chat timed out after 600000ms

# after
$ node scripts/debug/agent-prepare-context-audit.mjs --rpc-timeout-ms 1800000 --query "what are my goals?"
Defensive patterns

Strategy: retry

Validate before calling

// Before a long audit, probe the slow path cheaply
const start = Date.now();
await rpc(coreUrl, token, "core.ping", {}, 10_000);
if (Date.now() - start > 5_000) console.error("core is slow to answer — consider --rpc-timeout-ms 1800000");

Try / catch

for (let attempt = 1; attempt <= 2; attempt++) {
  try {
    return await rpc(coreUrl, token, method, params, opts.rpcTimeoutMs);
  } catch (e) {
    if (/timed out after/.test(e.message) && attempt === 1) {
      opts.rpcTimeoutMs *= 2; // one retry with a doubled budget
      continue;
    }
    throw e;
  }
}

Prevention

When it happens

Trigger: Any single JSON-RPC call exceeding the timeout: a long openhuman.inference_agent_chat turn on a slow model, a first-turn with a cold memory index, a transcript_search over a huge workspace, or a core that is overloaded/paused. The default 10-minute budget is exceeded by heavy multi-case runs with big contexts.

Common situations: Running the full 5 default cases plus seeded transcript against a busy or resource-constrained core; slow provider endpoints during the LLM portion; debugging on a laptop where the core competes with a cargo build for CPU; timeout lowered too aggressively via --rpc-timeout-ms.

Understand the failure class

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/dc7c27041d7acbd6. Report an issue: GitHub.