tinyhumansai/openhuman · error · Error

RPC ${method} error: ${body.error.message || JSON.stringify(

Error message

RPC ${method} error: ${body.error.message || JSON.stringify(body.error)}

What it means

This is the JSON-RPC application-level failure: HTTP was 200 and the body parsed, but it contains an `error` object, which rpc() re-throws with the server's message. In goals-live.mjs these calls are openhuman.memory_goals_list / _add / _edit / _delete / _reflect and core.ping, so the message text comes from the core's controller dispatch — unknown method, invalid params, missing agent definition, or an unconfigured inference provider.

Source

Thrown at scripts/debug/goals-live.mjs:210

      }),
    });
  } catch (err) {
    if (err?.name === "AbortError")
      throw new Error(`RPC ${method} timed out after ${timeoutMs}ms`);
    throw err;
  } finally {
    clearTimeout(timer);
  }
  const text = await res.text();
  let body;
  try {
    body = JSON.parse(text);
  } catch {
    throw new Error(`RPC ${method} returned non-JSON HTTP ${res.status}: ${text.slice(0, 200)}`);
  }
  if (!res.ok) throw new Error(`RPC ${method} HTTP ${res.status}`);
  if (body.error)
    throw new Error(`RPC ${method} error: ${body.error.message || JSON.stringify(body.error)}`);
  return body.result;
}

// RpcOutcome serializes either as the bare value (no logs) or { result, logs }.
function unwrap(result) {
  if (result && typeof result === "object" && "result" in result && "logs" in result) {
    return { value: result.result, logs: result.logs || [] };
  }
  return { value: result, logs: [] };
}

function renderGoals(doc) {
  const items = doc?.items || [];
  if (items.length === 0) return "    (no goals)";
  return items.map((g) => `    - [${g.id}] ${g.text}`).join("\n");
}

// ── transcript auditing ─────────────────────────────────────────────────────

View on GitHub (pinned to a221052e0d)

Solutions

  1. Read the server message in the error — it names the exact RPC fault (unknown method vs param vs provider)
  2. Rebuild and restart the core: `cargo build --manifest-path Cargo.toml --bin openhuman-core` then rerun, or use --spawn-core which cargo-runs the current source
  3. Verify the method exists on the live core: `curl -s <core>/schema | jq '.[] | select(.namespace=="memory_goals")'`
  4. For reflect failures, configure a default model/provider in the core config or pass --model
  5. For param errors, check the id/text values the script derives from the prior goals_list call

Example fix

# before: core binary predates the goals namespace
node scripts/debug/goals-live.mjs
# Error: RPC openhuman.memory_goals_list error: unknown method: openhuman.memory_goals_list

# after: spawn a core built from current source
node scripts/debug/goals-live.mjs --spawn-core
Defensive patterns

Strategy: try-catch

Validate before calling

// confirm the methods the run needs exist on the live core before starting
const schema = await (await fetch(coreUrl.replace("/rpc", "/schema"), {
  headers: { authorization: `Bearer ${token}` },
})).json();
const methods = new Set(collectMethodNames(schema)); // walk ControllerSchema entries
for (const m of ["openhuman.memory_goals_list", "openhuman.memory_goals_reflect"]) {
  if (!methods.has(m)) { console.error(`${m} missing on this core — rebuild/restart`); process.exit(2); }
}

Type guard

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

Try / catch

try {
  result = await rpc(coreUrl, token, method, params);
} catch (err) {
  if (/error: unknown method/.test(err.message)) {
    throw new Error(`${method} missing — the core binary is stale; rebuild with cargo build --bin openhuman-core`);
  }
  if (/provider|model/i.test(err.message)) {
    // enrich/reflect needs a configured provider — guide instead of failing opaque
    throw new Error(`${err.message} (configure a default model or pass --model)`);
  }
  throw err;
}

Prevention

When it happens

Trigger: `unknown method` when the running core binary predates the memory_goals RPC namespace (stale ./target/debug/openhuman-core); invalid params for memory_goals_edit (bad id); memory_goals_reflect failing because no provider/model is configured or the goals_agent builtin definition is missing in that workspace; persistence/store errors from a corrupted goals DB.

Common situations: Binary drift: core last built weeks ago, script expects current namespaces; running against a slim/feature-gated build where the goals domain is compiled out (unknown-method per the DomainSet/feature gates); isolated temp workspace lacking the goals_agent definition; provider credentials absent so enrichment cannot run.

Related errors


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