{"record":{"id":"949de14d37914a7d","repo":"tinyhumansai/openhuman","slug":"not-running-in-tauri-949de1","errorCode":null,"errorMessage":"Not running in Tauri","messagePattern":"Not running in Tauri","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/utils/tauriCommands/localAi.ts","lineNumber":230,"sourceCode":"    chat_eligibility?: ModelContextEligibility | null;\n    embedding_model: string;\n    embedding_found: boolean;\n    embedding_eligibility?: ModelContextEligibility | null;\n    vision_model: string;\n    vision_found: boolean;\n  };\n  issues: string[];\n  repair_actions: RepairAction[];\n  ok: boolean;\n}\n\nexport async function openhumanAgentChat(\n  message: string,\n  modelOverride?: string,\n  temperature?: number\n): Promise<CommandResponse<string>> {\n  if (!isTauri()) {\n    throw new Error('Not running in Tauri');\n  }\n  return await callCoreRpc<CommandResponse<string>>({\n    method: 'openhuman.agent_chat',\n    params: { message, model_override: modelOverride, temperature },\n  });\n}\n\nexport async function openhumanLocalAiStatus(): Promise<CommandResponse<LocalAiStatus>> {\n  try {\n    return await callCoreRpc<CommandResponse<LocalAiStatus>>({\n      method: 'openhuman.inference_status',\n    });\n  } catch (err) {\n    const message = tauriErrorMessage(err);\n    if (message.includes('unknown method: openhuman.inference_status')) {\n      throw new Error(\n        'Local model runtime is unavailable in this core build. Restart app after updating to the latest build.'\n      );","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/utils/tauriCommands/localAi.ts#L212-L248","documentation":"openhumanAgentChat sends a one-shot chat turn to the core via openhuman.agent_chat ({ message, model_override, temperature }) and is guarded by the shared isTauri() check that throws 'Not running in Tauri'. The chat path only exists through relay_http_rpc (a Tauri command invoked over IPC), so outside the desktop shell — or before window.__TAURI_INTERNALS__.invoke is injected at CEF startup (#1472) — the wrapper fails fast with this error instead of attempting invoke.","triggerScenarios":"Calling openhumanAgentChat('hello') from the Vite dev server in a normal browser; a chat unit test that doesn't mock the Tauri API; a debug console/panel issuing a test message during the startup bridge gap.","commonSituations":"Using pnpm dev instead of pnpm dev:app while iterating on chat; integration tests of chat plumbing missing '@tauri-apps/api/core' mocks; early-mount debug tools firing before IPC readiness.","solutions":["Run chats inside the Tauri host: pnpm dev:app.","Mock the Tauri core module (isTauri → true, invoke → canned CommandResponse<string>) in tests.","Route non-Tauri contexts through the regular web-chat service instead of this desktop-only wrapper.","Gate agent-chat debug actions on isTauri() and core readiness."],"exampleFix":"// before\nconst reply = (await openhumanAgentChat('ping')).result;\n\n// after\nif (!isTauri()) throw new Error('agent_chat requires the desktop runtime');\nconst reply = (await openhumanAgentChat('ping')).result;","handlingStrategy":"validation","validationCode":"if (!isTauri()) {\n  throw new Error('agent_chat requires the desktop runtime');\n}\nconst reply = (await openhumanAgentChat(message)).result;","typeGuard":"import { isTauri } from './common';\nconst agentChatAvailable = (): boolean => isTauri();","tryCatchPattern":"try { const reply = (await openhumanAgentChat(msg)).result; }\ncatch (e) {\n  if (e instanceof Error && e.message === 'Not running in Tauri') { useWebChatFallback(); return; }\n  throw e;\n}","preventionTips":["Route browser contexts through the web-chat service, not this desktop-only wrapper.","Mock the Tauri core module in chat tests.","Gate debug/diagnostic chat panels on isTauri().","Don't fire test messages before IPC readiness."],"tags":["tauri","ipc","environment-guard","chat","agent"],"backgroundTag":"tauri-runtime-not-detected","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}