tinyhumansai/openhuman · error · Error

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

Error message

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

What it means

The HTTP layer was fine (2xx) but the JSON-RPC envelope contains an `error` object — the core executed the dispatch and returned a JSON-RPC failure; the script surfaces body.error.message (or the stringified error). This is the core's own domain error, not a transport problem.

Source

Thrown at scripts/test-memory-email-ingest.mjs:56

const RPC_URL = process.env.RPC_URL || "http://127.0.0.1:7810/rpc";
const OWNER = process.env.OWNER || "stevent95@gmail.com";
const PROVIDER = process.env.PROVIDER || "gmail";
const FIXTURE =
  process.argv[2] ||
  resolve("tests/fixtures/memory/composio_gmail_inbox.json");

let rpcId = 0;
async function rpc(method, params) {
  rpcId += 1;
  const res = await fetch(RPC_URL, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ jsonrpc: "2.0", id: rpcId, method, params }),
  });
  if (!res.ok) throw new Error(`${method}: HTTP ${res.status} ${await res.text()}`);
  const body = await res.json();
  if (body.error) {
    throw new Error(`${method}: ${body.error.message || JSON.stringify(body.error)}`);
  }
  return body.result;
}

function parseEmailDate(raw) {
  if (!raw) return Date.now();
  if (typeof raw === "number") return raw < 1e12 ? raw * 1000 : raw;
  const ms = Date.parse(raw);
  return Number.isFinite(ms) ? ms : Date.now();
}

function splitAddresses(value) {
  if (!value) return [];
  if (Array.isArray(value)) return value.filter(Boolean);
  return String(value)
    .split(/[;,]/)
    .map((s) => s.trim())
    .filter(Boolean);

View on GitHub (pinned to a221052e0d)

Solutions

  1. Read the embedded message — it is the core's authoritative error text for the failing call
  2. List what the core actually serves: GET /schema on the same base URL and diff the namespace/method
  3. Validate the fixture (argv[2], default tests/fixtures/memory/composio_gmail_inbox.json) parses and has messages[] with id/threadId/markdown
  4. If the method is feature-gated, start the core with the required features and retry

Example fix

# before — edited script uses a method the core does not serve
await rpc('openhuman.memory_ingest_email', payload)   // -32601 unknown method

# after — check /schema, then use the real method
 curl -s 'http://127.0.0.1:7810/schema' | jq -r '.[] | .namespace'   # confirm 'memory_tree' exists
await rpc('openhuman.memory_tree_ingest', payload)
Defensive patterns

Strategy: try-catch

Validate before calling

const res = await fetch(RPC_URL, { method: 'POST', headers, body: JSON.stringify(req) });
const body = await res.json();
if (body.error) { /* surface body.error.message — core-level failure, not transport */ }

Type guard

const isJsonRpcError = (b) => !!b && typeof b === 'object' && 'error' in b && !!b.error;

Try / catch

try { await rpc(method, params); }
catch (err) {
  if (err.message.startsWith(`${method}: `)) { console.error('core error:', err.message); process.exitCode = 1; }
  else throw err;
}

Prevention

When it happens

Trigger: Calling an unregistered method (typo, renamed namespace, or a feature-gated domain compiled out so its controllers answer unknown-method); params that fail validation (e.g. a fixture whose shape does not match what memory_tree_ingest expects); a genuine failure inside the memory canonicalizer for one thread.

Common situations: Running the script against a core built with different features (gated controllers are unknown-method per the repo's DomainSet/feature model); core and script versions drifted after a pull; malformed or truncated fixture JSON at argv[2].

Related errors


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