tinyhumansai/openhuman · error
[transport:local] HTTP ${response.status}: ${text || respons
Error message
[transport:local] HTTP ${response.status}: ${text || response.statusText} What it means
Thrown by LocalTransport.request when the embedded core's HTTP RPC endpoint answers with a non-2xx status. The message embeds the HTTP status plus the response body (or statusText when the body is empty), so the real cause is whatever the core's /rpc endpoint reported. Most often it is 401 from a stale per-launch bearer token or 5xx from a core-side handler failure.
Source
Thrown at app/src/services/transport/LocalTransport.ts:77
try {
response = await fetch(rpcUrl, {
method: 'POST',
headers,
body: JSON.stringify(payload),
signal: controller.signal,
});
} catch (err) {
if (controller.signal.aborted) {
throw new Error(`[transport:local] ${method} timed out after ${this.timeoutMs}ms`);
}
throw err;
} finally {
clearTimeout(timeoutId);
}
if (!response.ok) {
const text = await response.text();
throw new Error(`[transport:local] HTTP ${response.status}: ${text || response.statusText}`);
}
const json = (await response.json()) as JsonRpcResponse<T>;
if (json.error) {
logErr('[transport:local] ← %s error: %s', method, json.error.message);
throw new Error(json.error.message ?? 'Core RPC returned an error');
}
if (!Object.prototype.hasOwnProperty.call(json, 'result')) {
throw new Error('[transport:local] response missing result');
}
log('[transport:local] ← %s id=%d ok', method, id);
return json.result as T;
}
async *stream<T>(
method: string,View on GitHub (pinned to a221052e0d)
Solutions
- Parse the embedded status: 401 means stale token/URL — re-fetch via the Tauri commands core_rpc_url and core_rpc_token, rebuild the transport, retry once
- Verify the core process is alive (restart_core_process / daemonHealthService) and retry after it reports healthy
- For external-core debugging, confirm OPENHUMAN_CORE_TOKEN matches the token written to {workspace}/core.token
- For 5xx, read the core file log for the handler panic and fix the domain-side error
Example fix
// before
const result = await transport.call('openhuman.ping', {});
// after
try {
const result = await transport.call('openhuman.ping', {});
} catch (err) {
const m = /\[transport:local\] HTTP (\d+): (.*)/.exec(String(err.message));
if (m && m[1] === '401') {
await rebuildTransportFromShell(); // re-fetch URL + bearer, retry once
} else {
throw err;
}
} Defensive patterns
Strategy: try-catch
Validate before calling
async function coreRpcReady(rpcUrl: string, token: string): Promise<boolean> {
try {
const res = await fetch(rpcUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'openhuman.ping', params: {} }),
});
return res.ok;
} catch {
return false;
}
} Try / catch
Catch, then parse the `HTTP <status>` prefix from err.message: on 401 rebuild the transport from freshly fetched core_rpc_url/core_rpc_token and retry once; on 5xx surface the embedded body text as the core error; otherwise rethrow.
Prevention
- Always obtain URL and bearer through the core_rpc_url / core_rpc_token Tauri commands instead of caching them across core restarts
- Treat a 401 as 'transport stale' — rebuild, never blindly retry the same transport
- Wait on daemonHealthService readiness before the first RPC after boot
When it happens
Trigger: Any transport.call() (i.e. every coreRpcClient request via relay_http_rpc) when fetch resolves with response.ok === false: POST to http://127.0.0.1:<port>/rpc returning 401 (stale hex bearer / mismatched OPENHUMAN_CORE_TOKEN), 404 (port from a previous core launch), 400 (malformed JSON-RPC body), or 500 (core handler error).
Common situations: Core restarted and got a new ephemeral port+token while the renderer cached the old pair; OPENHUMAN_CORE_REUSE_EXISTING=1 pointing at an external core whose token differs from {workspace}/core.token; core process crashed mid-request; a loopback-intercepting proxy or antivirus rewriting the response.
Related errors
- Core RPC HTTP ${response.status}: ${text || response.statusT
- [transport:cloud] HTTP ${response.status}: ${text || respons
- Cloud RPC returned an error
- [transport:cloud] response missing result
- [transport:lan] HTTP ${response.status}: ${text || response.
AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16).
Data as JSON: /api/errors/267368510e7a34c0.
Report an issue: GitHub.