{"record":{"id":"a9ebb9487efc48e1","repo":"musistudio/claude-code-router","slug":"candidate-detail-local-agent-login-is-not-im","errorCode":null,"errorMessage":"${candidate.detail || \"Local agent login is not importable.\"}","messagePattern":"\\$\\{candidate\\.detail \\|\\| \"Local agent login is not importable\\.\"\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/agents/local-providers/service.ts","lineNumber":39,"sourceCode":"\nexport function getLocalAgentProviderCandidates(): LocalAgentProviderCandidate[] {\n  return [\n    codexCandidate(),\n    claudeCodeCandidate(),\n    grokCandidate(),\n    ...kimiCandidates(),\n    ...opencodeCandidates(),\n    zcodeCandidate()\n  ].filter((candidate) => candidate.status !== \"missing\");\n}\n\nexport async function importLocalAgentProvider(request: LocalAgentProviderImportRequest): Promise<LocalAgentProviderImportResult> {\n  const candidate = getLocalAgentProviderCandidates().find((item) => item.id === request.id);\n  if (!candidate) {\n    throw new Error(\"Local agent provider was not found.\");\n  }\n  if (!candidate.importable) {\n    throw new Error(candidate.detail || \"Local agent login is not importable.\");\n  }\n\n  if (candidate.kind === \"codex\") {\n    return importCodexProvider(candidate, request.providerNames ?? []);\n  }\n  if (candidate.kind === \"claude-code\") {\n    return importClaudeCodeProvider(candidate, request.providerNames ?? []);\n  }\n  if (candidate.kind === \"grok\") {\n    return importGrokProvider(candidate, request.providerNames ?? []);\n  }\n  if (candidate.kind === \"kimi\") {\n    return importKimiProvider(candidate, request.providerNames ?? []);\n  }\n  if (candidate.kind === \"opencode\") {\n    return importOpenCodeProvider(candidate, request.providerNames ?? []);\n  }\n  return importZcodeProvider(candidate, request.providerNames ?? []);","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/agents/local-providers/service.ts#L21-L57","documentation":"The candidate exists but has importable=false; the thrown message is the candidate's detail text, or the generic 'Local agent login is not importable.' when no detail is set.","triggerScenarios":"Importing a candidate whose detection marked it non-importable — e.g. CLI installed but not logged in, or login file unreadable.","commonSituations":"User installed the CLI but never authenticated; auth file corrupted or permissions changed.","solutions":["Follow candidate.detail (usually: run the CLI and log in, e.g. `claude login`, `codex login`).","Re-run candidate detection to refresh the detail message.","Fix permissions on the CLI's auth/config files."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!candidate.importable) showDetail(candidate.detail);","typeGuard":"function isImportable(c: LocalAgentProviderCandidate): boolean { return c.importable === true; }","tryCatchPattern":"catch (e) { if ((e as Error).message.includes('not importable')) surfaceLoginHint(candidate); }","preventionTips":["Check candidate.importable and detail before offering import.","Ensure CLI login state before import flows."],"tags":["local-provider","import","auth-required"],"backgroundTag":"authentication-required","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}