The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(api): handle missing aiSettingsApi gracefully
Steven Enamakel6fc869f8b313
diff --git a/app/src/features/conversations/hooks/useBackgroundActivity.ts b/app/src/features/conversations/hooks/useBackgroundActivity.tsindex e8767f2745..05699f0717 100644--- a/app/src/features/conversations/hooks/useBackgroundActivity.ts+++ b/app/src/features/conversations/hooks/useBackgroundActivity.ts@@ -1,7 +1,6 @@import { useCallback, useEffect, useRef, useState } from 'react';import { callCoreRpc } from '../../../services/coreRpcClient';-import { isTauri } from '../../../utils/tauriCommands/common';import { type CoreCronJob, openhumanCronList } from '../../../utils/tauriCommands/cron';import {memorySyncStatusList,@@ -68,12 +67,6 @@ export function useBackgroundActivity(open: boolean): BackgroundActivity {const busyRef = useRef(false);const fetchOnce = useCallback(async () => {- if (!isTauri()) {- // Non-Tauri / dev preview: nothing to surface, just stop the spinner.- setLoading(false);- return;- }-const [cronRes, ingestRes, providerRes] = await Promise.allSettled([openhumanCronList(),callCoreRpc<IngestionStatusEnvelope>({ method: 'openhuman.memory_ingestion_status' }),diff --git a/app/src/features/voice/useVoiceSkillStatus.ts b/app/src/features/voice/useVoiceSkillStatus.tsindex 882485b42f..85ba196c2f 100644--- a/app/src/features/voice/useVoiceSkillStatus.ts+++ b/app/src/features/voice/useVoiceSkillStatus.ts@@ -7,7 +7,6 @@*/import { useCallback, useEffect, useMemo, useState } from 'react';-import { isTauri } from '../../utils/tauriCommands/common';import {openhumanVoiceServerStatus,openhumanVoiceStatus,@@ -38,7 +37,6 @@ export function useVoiceSkillStatus(): VoiceSkillStatus {const [serverStatus, setServerStatus] = useState<VoiceServerStatus | null>(null);const fetchStatuses = useCallback(async () => {- if (!isTauri()) return;try {const [vs, ss] = await Promise.all([openhumanVoiceStatus(), openhumanVoiceServerStatus()]);setVoiceStatus(vs);diff --git a/app/src/hooks/useConsciousItems.ts b/app/src/hooks/useConsciousItems.tsindex a4435fb83a..33aae86454 100644--- a/app/src/hooks/useConsciousItems.ts+++ b/app/src/hooks/useConsciousItems.ts@@ -156,7 +156,7 @@ export function useConsciousItems(): UseConsciousItemsResult {const runningRef = useRef(false);const refresh = useCallback(async () => {- if (!isTauri() || fetchingRef.current) return;+ if (fetchingRef.current) return;fetchingRef.current = true;setLoading(true);setError(null);diff --git a/app/src/pages/onboarding/steps/ApiKeysStep.tsx b/app/src/pages/onboarding/steps/ApiKeysStep.tsxindex 7d80dac48f..fc012eb378 100644--- a/app/src/pages/onboarding/steps/ApiKeysStep.tsx+++ b/app/src/pages/onboarding/steps/ApiKeysStep.tsx@@ -6,7 +6,6 @@ import { useT } from '../../../lib/i18n/I18nContext';import { setCloudProviderKey } from '../../../services/api/aiSettingsApi';import { callCoreRpc } from '../../../services/coreRpcClient';import { openUrl } from '../../../utils/openUrl';-import { isTauri } from '../../../utils/tauriCommands/common';import OnboardingNextButton from '../components/OnboardingNextButton';interface ApiKeysStepProps {@@ -37,9 +36,6 @@ const ApiKeysStep = ({ onNext, onSkip }: ApiKeysStepProps) => {const [oauthCallbackUrl, setOauthCallbackUrl] = useState('');const refreshOAuthStatus = useCallback(async () => {- if (!isTauri()) {- return;- }try {const res = await callCoreRpc<{ result: OpenAiOAuthStatus }>({method: 'openhuman.inference_openai_oauth_status',@@ -56,10 +52,6 @@ const ApiKeysStep = ({ onNext, onSkip }: ApiKeysStepProps) => {}, [refreshOAuthStatus]);const handleOpenAiOAuthStart = async () => {- if (!isTauri()) {- setError(t('onboarding.apiKeys.oauthDesktopOnly'));- return;- }setOauthBusy(true);setError(null);try {diff --git a/app/src/services/api/aiSettingsApi.ts b/app/src/services/api/aiSettingsApi.tsindex 13500744fd..b0cad2d499 100644--- a/app/src/services/api/aiSettingsApi.ts+++ b/app/src/services/api/aiSettingsApi.ts@@ -22,7 +22,6 @@ import {authRemoveProviderCredentials,authStoreProviderCredentials,} from '../../utils/tauriCommands/auth';-import { isTauri } from '../../utils/tauriCommands/common';import {type ClientConfig,type CloudProviderCreds,@@ -775,7 +774,6 @@ export async function importOpenAiCodexCliAuth(): Promise<void> {* (they're written via `setCloudProviderKey` on their own path).*/export async function flushCloudProviders(providers: CloudProviderCreds[]): Promise<void> {- if (!isTauri()) return;await openhumanUpdateModelSettings({ cloud_providers: providers });}@@ -784,13 +782,9 @@ export async function flushCloudProviders(providers: CloudProviderCreds[]): Prom* `providerId` may be either the provider's opaque id or its slug — Rust* accepts both. Prefer passing the slug so lookup works before the provider* config has been persisted to disk (i.e. before the user clicks Save).- * Throws on error so callers can surface retry UI. Returns [] when not- * running in Tauri (browser dev mode has no RPC bridge).+ * Throws on error so callers can surface retry UI.*/export async function listProviderModels(providerId: string): Promise<ModelInfo[]> {- if (!isTauri()) {- return [];- }const res = await callCoreRpc<{ result: { models: ModelInfo[] } }>({method: 'openhuman.inference_list_models',params: { provider_id: providerId },@@ -814,9 +808,6 @@ export interface ProviderAuthError {/** 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: {},@@ -829,9 +820,6 @@ export async function testProviderModel(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 },