{"record":{"id":"e795fef02cac234a","repo":"tinyhumansai/openhuman","slug":"not-running-in-tauri-e795fe","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/composio.ts","lineNumber":23,"sourceCode":"  received_at_ms: number;\n  toolkit: string;\n  trigger: string;\n  metadata_id: string;\n  metadata_uuid: string;\n  payload: unknown;\n}\n\nexport interface ComposioTriggerHistoryResult {\n  archive_dir: string;\n  current_day_file: string;\n  entries: ComposioTriggerHistoryEntry[];\n}\n\nexport async function openhumanComposioListTriggerHistory(\n  limit = 100\n): Promise<CommandResponse<{ result: ComposioTriggerHistoryResult }>> {\n  if (!isTauri()) {\n    throw new Error('Not running in Tauri');\n  }\n\n  return await callCoreRpc<CommandResponse<{ result: ComposioTriggerHistoryResult }>>({\n    method: 'openhuman.composio_list_trigger_history',\n    params: { limit },\n  });\n}\n\n// ── Direct mode (BYO API key) ───────────────────────────────────────\n//\n// [composio-direct] These three RPCs back the Settings > Composio panel\n// added in PR3 of #1710. The API key itself is *never* read back over\n// RPC — only a boolean flag (`api_key_set`) so the UI can show a\n// \"Key stored ✓\" / \"No key set\" status without exposing the secret.\n\nexport interface ComposioModeStatus {\n  mode: 'backend' | 'direct' | string;\n  api_key_set: boolean;","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/utils/tauriCommands/composio.ts#L5-L41","documentation":"openhumanComposioListTriggerHistory() forwards `openhuman.composio_list_trigger_history`, which reads the Composio trigger archive (archive_dir, current_day_file, entries) from the core. The isTauri() guard throws when the frontend runs outside the Tauri shell, because the archive is read core-side and surfaced only through desktop IPC.","triggerScenarios":"Calling openhumanComposioListTriggerHistory(limit) from the integrations/settings UI under `pnpm dev` (browser-only), or from a Vitest spec importing the real wrapper.","commonSituations":"Browsing trigger history while the UI runs in a plain browser; a diagnostics-panel test without mocked IPC; a preview deployment without the desktop host.","solutions":["Run the app inside the Tauri desktop shell (`pnpm dev:app` or the packaged build).","Mock '@/utils/tauriCommands/composio' in tests for screens that show trigger history.","Skip the history fetch when isTauri() is false and render an empty state.","Keep the history panel behind the same desktop-only gate as the rest of the Composio surface."],"exampleFix":"// before\nconst { data } = await openhumanComposioListTriggerHistory(50);\n// after\nimport { isTauri } from '@/utils/tauriCommands/common';\nif (!isTauri()) throw new Error('Trigger history is desktop-only.');\nconst { data } = await openhumanComposioListTriggerHistory(50);","handlingStrategy":"validation","validationCode":"import { isTauri } from '@/utils/tauriCommands/common';\n\nif (!isTauri()) {\n  // trigger history lives core-side — skip the fetch here\n}","typeGuard":null,"tryCatchPattern":"try {\n  const { data } = await openhumanComposioListTriggerHistory(100);\n} catch (err) {\n  if (err instanceof Error && err.message === 'Not running in Tauri') {\n    setHistory(null); // desktop-only diagnostics\n  } else {\n    throw err;\n  }\n}","preventionTips":["Gate the history panel on isTauri() along with the rest of the Composio surface.","Mock '@/utils/tauriCommands/composio' in panel tests.","Treat history as optional diagnostics data with an empty state."],"tags":["tauri","ipc","composio","environment"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}