{"record":{"id":"a63e15358d51cc11","repo":"tinyhumansai/openhuman","slug":"failed-to-fetch-repositories","errorCode":null,"errorMessage":"Failed to fetch repositories","messagePattern":"Failed to fetch repositories","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/components/skills/SmartIssuePicker.tsx","lineNumber":93,"sourceCode":"  // each onRepoSelect captures its own id and bails out of any state\n  // update once a newer selection has superseded it.\n  const selectionSeqRef = useRef(0);\n\n  // ── Load repos via Composio ─────────────────────────────────────────\n  const loadRepos = useCallback(async () => {\n    setReposLoading(true);\n    setReposError(null);\n    try {\n      const connections = await listConnections();\n      const ghConn = connections.connections?.find(\n        c =>\n          c.toolkit.toLowerCase().includes('github') &&\n          (c.status === 'ACTIVE' || c.status === 'CONNECTED')\n      );\n      if (!ghConn) throw new Error('NOT_CONNECTED');\n\n      const res = await composioExecute('GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER', {});\n      if (!res.successful) throw new Error(res.error ?? 'Failed to fetch repositories');\n\n      const raw = res.data;\n      let repoList: ComposioGhRepo[] = [];\n      const items = Array.isArray(raw)\n        ? raw\n        : ((raw as Record<string, unknown>)?.repositories ?? []);\n      if (Array.isArray(items)) {\n        repoList = (items as Record<string, unknown>[]).map(r => ({\n          owner: String((r.owner as Record<string, unknown>)?.login ?? r.owner ?? ''),\n          repo: String(r.name ?? ''),\n          fullName: String(\n            r.full_name ?? `${(r.owner as Record<string, unknown>)?.login ?? r.owner}/${r.name}`\n          ),\n          private: r.private as boolean | undefined,\n          defaultBranch: r.default_branch as string | undefined,\n        }));\n      }\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/components/skills/SmartIssuePicker.tsx#L75-L111","documentation":"SmartIssuePicker resolves the GitHub connection via listConnections() (throwing 'NOT_CONNECTED' when none is ACTIVE/CONNECTED), then runs the Composio action GITHUB_LIST_REPOSITORIES_FOR_THE_AUTHENTICATED_USER; when the action returns successful=false with an empty error string, this fallback message is thrown.","triggerScenarios":"Composio executes the action but reports failure with res.error empty: rate limit, expired Composio connection token, or a GitHub API error swallowed upstream.","commonSituations":"Composio GitHub connection went stale and needs re-auth; Composio outage or throttling; OAuth grant revoked on the GitHub side.","solutions":["Open Connections and verify the GitHub (Composio) connection is ACTIVE; reconnect if stale","Retry after a short wait — rate limits are transient","Run the same action from the Composio dashboard to see the underlying error and check Composio service status"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check connection freshness before loading the picker:\nconst conns = await listConnections();\nconst gh = conns.connections?.find(c =>\n  c.toolkit.toLowerCase().includes('github') &&\n  (c.status === 'ACTIVE' || c.status === 'CONNECTED')\n);\nif (!gh) { /* show connect-GitHub prompt instead of fetching */ }","typeGuard":"const isActiveGithub = (c: { toolkit: string; status: string }): boolean =>\n  c.toolkit.toLowerCase().includes('github') &&\n  (c.status === 'ACTIVE' || c.status === 'CONNECTED');","tryCatchPattern":"try {\n  await loadRepos();\n} catch (e) {\n  const msg = e instanceof Error ? e.message : String(e);\n  if (msg === 'NOT_CONNECTED') { promptConnectGithub(); return; }\n  if (msg === 'Failed to fetch repositories') { showRetryWithComposioHint(); return; }\n  throw e;\n}","preventionTips":["Keep the Composio GitHub connection ACTIVE; re-auth when tokens expire","Handle 'NOT_CONNECTED' separately from the generic fetch failure","Retry once after a minute before assuming breakage — rate limits resolve quickly"],"tags":["composio","github","integration","repositories"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}