tinyhumansai/openhuman · error · Error

Not running in Tauri

Error message

Not running in Tauri

What it means

Guard thrown by `subconsciousStatus` before it sends `openhuman.subconscious_status`, which returns the SubconsciousStatus block (triggers_enabled, mode, max_promotions_per_hour, orchestrator_running, queue_depth, orchestrator/user thread ids). The file's own comment (subconscious.ts, right below `subconsciousTrigger`) documents that sibling trigger-pipeline functions intentionally do NOT gate on `isTauri()` because `callCoreRpc` resolves any core transport — so this particular gate is stricter than the transport requires; it throws only because the local relay bridge (`window.__TAURI_INTERNALS__.invoke`) is unavailable in this context.

Source

Thrown at app/src/utils/tauriCommands/subconscious.ts:66

  duration_ms: number;
  response_chars?: number;
}

/** Status of the event-driven subconscious trigger pipeline. */
export interface SubconsciousTriggersStatus {
  triggers_enabled: boolean;
  mode: string;
  max_promotions_per_hour: number;
  orchestrator_running: boolean;
  queue_depth: number | null;
  orchestrator_thread_id: string;
  user_thread_id: string;
}

// ── Status & Trigger ─────────────────────────────────────────────────────────

export async function subconsciousStatus(): Promise<CommandResponse<SubconsciousStatus>> {
  if (!isTauri()) throw new Error('Not running in Tauri');
  return await callCoreRpc<CommandResponse<SubconsciousStatus>>({
    method: 'openhuman.subconscious_status',
  });
}

/**
 * Manually trigger a subconscious tick. `kind` selects the world: 'memory'
 * (default) or 'all'. A no-arg call keeps the legacy memory-only behavior.
 */
export async function subconsciousTrigger(
  kind?: SubconsciousKind | 'all'
): Promise<CommandResponse<TickResult>> {
  if (!isTauri()) throw new Error('Not running in Tauri');
  return await callCoreRpc<CommandResponse<TickResult>>({
    method: 'openhuman.subconscious_trigger',
    ...(kind ? { params: { kind } } : {}),
  });
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Run the UI in the desktop shell (`pnpm dev:app`) for local-core verification.
  2. Skip the status fetch or render placeholders when `!isTauri()` and no remote transport is active.
  3. For parity with the file's transport-aware functions, drop the `isTauri()` gate and let `callCoreRpc` resolve the transport (it already dispatches via `setActiveCoreTransport` profiles).
  4. Mock `isTauri` and `callCoreRpc` in unit tests.
  5. Catch per poll and treat as 'status unavailable' instead of an unhandled rejection.

Example fix

// before (wrapper)
export async function subconsciousStatus(): Promise<CommandResponse<SubconsciousStatus>> {
  if (!isTauri()) throw new Error('Not running in Tauri');
  return await callCoreRpc<CommandResponse<SubconsciousStatus>>({
    method: 'openhuman.subconscious_status',
  });
}

// after — transport-aware, matching subconsciousTriggersStatus in the same file
export async function subconsciousStatus(): Promise<CommandResponse<SubconsciousStatus>> {
  return await callCoreRpc<CommandResponse<SubconsciousStatus>>({
    method: 'openhuman.subconscious_status',
  });
}
Defensive patterns

Strategy: validation

Validate before calling

import { isTauri } from '../utils/tauriCommands/common';

if (!isTauri()) {
  setStatusPlaceholder(); // or check for an active remote transport before giving up
  return;
}
const st = await subconsciousStatus();

Type guard

function isNotInTauriError(e: unknown): e is Error {
  return e instanceof Error && e.message === 'Not running in Tauri';
}

Try / catch

try {
  const st = await subconsciousStatus();
} catch (e) {
  if (e instanceof Error && e.message === 'Not running in Tauri') {
  setSubconsciousUnavailable(true);
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Opening the subconscious settings/diagnostics panel while the UI runs in the Vite browser preview; calling `subconsciousStatus()` in tests with default non-Tauri mocks; querying during the CEF bootstrap gap; calling it from a webview with an active tunnel/cloud transport where the gate still fires despite `callCoreRpc` being able to dispatch.

Common situations: Browser-first development of the subconscious screen; jsdom tests; iOS/remote profiles that talk to a core over LAN/tunnel HTTP and hit the gate even though the underlying RPC would work; polls of orchestrator_running/queue_depth in web mode.

Related errors


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