tinyhumansai/openhuman · warning · Error

Model testing is only available in the desktop app.

Error message

Model testing is only available in the desktop app.

What it means

Thrown by testProviderModel() when isTauri() is false, i.e. the code is not running inside the Tauri desktop shell. The 'openhuman.inference_test_provider_model' RPC is relayed through the Tauri IPC command relay_http_rpc, which only exists when the webview is hosted by app/src-tauri. In a plain browser (Vite dev server, web preview) or the Vitest harness there is no IPC bridge, so the call is refused up front rather than failing obscurely later.

Solutions

  1. Run the full desktop shell for model testing: `pnpm dev:app` (Tauri dev) instead of `pnpm dev`.
  2. In tests, mock the tauri guard: vi.mock('../utils/tauriCommands/common', () => ({ isTauri: () => true, ... })) before asserting RPC behavior.
  3. In UI code, disable/hide the Test button when !isTauri() so users never reach the throw.

Example fix

// before
{isOpen && <button onClick={() => testProviderModel(workload, provider)}>Test</button>}

// after
{isOpen && (
  <button disabled={!isTauri()} title={isTauri() ? undefined : 'Desktop app only'}
          onClick={() => testProviderModel(workload, provider)}>Test</button>
)}
Defensive patterns

Strategy: type-guard

Validate before calling

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

const canTestModels = isTauri();
if (!canTestModels) {
  // hide/disable the Test button; do not call testProviderModel
}

Try / catch

try {
  const result = await testProviderModel(workload, provider);
} catch (e) {
  if (e instanceof Error && e.message.includes('only available in the desktop app')) {
    setNotice('Model testing requires the desktop app.');
  } else throw e;
}

Prevention

When it happens

Trigger: Running `pnpm dev` (Vite-only) and clicking Test model in the AI settings panel; opening the built UI in a normal browser; unit tests that invoke testProviderModel without mocking isTauri.

Common situations: Developers doing fast frontend iteration with the browser dev server forget that model testing shells out through Tauri; CI/storybook-style web previews that render the settings screen; a test harness that stubs callCoreRpc but not isTauri.

Related errors


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

Appendix: source

Thrown at app/src/services/api/aiSettingsApi.ts:810

/** Fetch BYO provider auth failures recorded this process, keyed by slug. */
export async function loadProviderAuthErrors(): Promise<ProviderAuthError[]> {
  if (!isTauri()) {
    return [];
  }
  const res = await callCoreRpc<{ result: { errors: ProviderAuthError[] } }>({
    method: 'openhuman.inference_provider_auth_errors',
    params: {},
  });
  return res?.result?.errors ?? [];
}

export async function testProviderModel(
  workload: WorkloadId,
  provider: string,
  prompt = 'Hello world'
): Promise<ProviderModelTestResult> {
  if (!isTauri()) {
    throw new Error('Model testing is only available in the desktop app.');
  }
  const res = await callCoreRpc<{ result: ProviderModelTestResult }>({
    method: 'openhuman.inference_test_provider_model',
    params: { workload, provider, prompt },
    timeoutMs: PROVIDER_MODEL_TEST_TIMEOUT_MS,
  });
  if (!res?.result) {
    throw new Error(
      `Model test RPC returned no result for ${workload} via ${provider} (openhuman.inference_test_provider_model).`
    );
  }
  return res.result;
}

// ─── Local provider façade (Ollama install / detect / model manage) ───────

/** Snapshot of the Ollama daemon + installed-model state for the AI panel. */
export interface LocalProviderSnapshot {

View on GitHub (pinned to 7491200858)