tinyhumansai/openhuman · error · Error

RPC ${method} error

Error message

RPC ${method} error

What it means

This is the JSON-RPC application error path in harness-cache-audit.mjs: HTTP 200, body parsed, but the body carries an `error` object, and the script throws a bare `RPC <method> error` without the server's message (unlike goals-live.mjs, which includes body.error.message). The methods invoked are core.ping and openhuman.agent_chat, so the underlying fault is whatever the core's chat pipeline reported — unknown method on an old binary, invalid params, missing agent, or provider/config errors.

Source

Thrown at scripts/debug/harness-cache-audit.mjs:233

    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}`);
  }
  if (!res.ok) {
    throw new Error(`RPC ${method} HTTP ${res.status}`);
  }
  if (body.error) {
    throw new Error(`RPC ${method} error`);
  }
  return body.result;
}

async function walkJsonl(dir) {
  const out = [];
  async function walk(current) {
    let entries;
    try {
      entries = await readdir(current, { withFileTypes: true });
    } catch {
      return;
    }
    await Promise.all(
      entries.map(async (entry) => {
        const full = path.join(current, entry.name);
        if (entry.isDirectory()) return walk(full);
        if (entry.isFile() && entry.name.endsWith(".jsonl")) out.push(full);

View on GitHub (pinned to a221052e0d)

Solutions

  1. Get the real message — reproduce the same call with curl and read body.error.message, since the script swallows it: `curl -s <url> -X POST -H 'authorization: Bearer <tok>' -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"openhuman.agent_chat","params":{...}}'`
  2. Rebuild/spawn fresh: `cargo build --bin openhuman-core` or rerun with --spawn-core
  3. Drop --model or set it to a model the core routes
  4. Check GET /schema on the live core for the agent_chat surface and expected params
  5. Inspect core logs (the script's --verbose only streams spawned-core output; for an external core tail its log file)

Example fix

# before
node scripts/debug/harness-cache-audit.mjs --model nonexistent-model
# Error: RPC openhuman.agent_chat error

# after — first surface the real server message, then fix accordingly
curl -s http://127.0.0.1:7788/rpc -X POST -H "authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"openhuman.agent_chat","params":{"prompt":"hi"}}'
node scripts/debug/harness-cache-audit.mjs --model gpt-4.1-mini
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the live surface before the run: old/slim cores lack agent_chat
const schema = await (await fetch(coreUrl.replace("/rpc", "/schema"), {
  headers: { authorization: `Bearer ${token}` },
})).json();
const names = JSON.stringify(schema);
if (!names.includes("agent_chat")) {
  console.error("openhuman.agent_chat not present on this core — rebuild or target a current core");
  process.exit(2);
}

Type guard

const isJsonRpcError = (body) => !!body && typeof body === "object" && body.error != null;

Try / catch

try {
  result = await rpc(coreUrl, token, method, params);
} catch (err) {
  if (new RegExp(`RPC ${method} error$`).test(err.message)) {
    // this script drops body.error.message — re-derive it for diagnosis
    const probe = await fetch(coreUrl, { method: "POST", headers: { "content-type": "application/json", authorization: `Bearer ${token}` }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }) });
    const detailed = await probe.json().catch(() => null);
    throw new Error(`${method} failed: ${detailed?.error?.message || "no detail available"}`);
  }
  throw err;
}

Prevention

When it happens

Trigger: `unknown method` against a core binary older than the agent_chat RPC surface; agent_chat rejecting a model_override (--model naming a model the core cannot route); the audit agent/thread referenced by thread_id not existing in that workspace; inference provider unconfigured so the turn fails server-side; feature-gated/slim core builds missing the agent domain.

Common situations: Stale ./target/debug/openhuman-core from an old checkout; running against a remote core of a different version; isolated temp workspace without the custom audit agent definitions; provider keys expired.

Related errors


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