tinyhumansai/openhuman · error · Error

Not running in Tauri

Error message

Not running in Tauri

What it means

openhumanGetConfig() forwards the core RPC configGet (CORE_RPC_METHODS.configGet) and returns the full ConfigSnapshot, including load metadata (loadedAt, loadingDuration, sources, errors). The isTauri() guard throws when the frontend runs outside the Tauri shell — the snapshot lives in the embedded Rust core, reachable only through the relay_http_rpc IPC bridge.

Source

Thrown at app/src/utils/tauriCommands/config.ts:214

  tools: {
    raw: string;
    totalTools: number;
    activeSkills: number;
    skillsPreview: string[];
    loadedAt: number;
  };
  metadata: {
    loadedAt: number;
    loadingDuration: number;
    hasFallbacks: boolean;
    sources: { soul: string; tools: string };
    errors: string[];
  };
}

export async function openhumanGetConfig(): Promise<CommandResponse<ConfigSnapshot>> {
  if (!isTauri()) {
    throw new Error('Not running in Tauri');
  }
  return await callCoreRpc<CommandResponse<ConfigSnapshot>>({ method: CORE_RPC_METHODS.configGet });
}

/**
 * Safe client-facing config slice. Never contains the raw api_key — only
 * `api_key_set` indicates whether a custom backend key is stored. See
 * `config.get_client_config` in `src/openhuman/config/schemas.rs`.
 */
export interface ClientConfig {
  /** OpenHuman product backend URL (auth/billing/voice). */
  api_url: string | null;
  /**
   * Custom OpenAI-compatible LLM endpoint. Legacy field, retained for
   * back-compat — the new AI settings panel reads/writes
   * `cloud_providers` + `*_provider` fields instead.
   */
  inference_url: string | null;

View on GitHub (pinned to a221052e0d)

Solutions

  1. Run the app under the full Tauri host (`pnpm dev:app` or the packaged build).
  2. Mock '@/utils/tauriCommands/config' in tests for screens that read the config snapshot.
  3. Skip the fetch when isTauri() is false and render a desktop-only placeholder.
  4. Prefer openhumanGetClientConfig() (the safe slice) for UI display; reserve the full snapshot for desktop diagnostics.

Example fix

// before
const { data: config } = await openhumanGetConfig();
// after
import { isTauri } from '@/utils/tauriCommands/common';
if (!isTauri()) throw new Error('Config snapshot is desktop-only.');
const { data: config } = await openhumanGetConfig();
Defensive patterns

Strategy: validation

Validate before calling

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

if (!isTauri()) {
  // full config snapshot is desktop-only — render a placeholder
}

Try / catch

try {
  const { data: config } = await openhumanGetConfig();
} catch (err) {
  if (err instanceof Error && err.message === 'Not running in Tauri') {
    setConfigUnavailable(true);
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Calling openhumanGetConfig() from a diagnostics or settings screen while the UI runs under `pnpm dev` in a plain browser, or from a Vitest spec importing the real wrapper.

Common situations: Opening the config/diagnostics screen during browser-based styling; a snapshot render test without mocked IPC; running the frontend bundle in a non-Tauri harness.

Related errors


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