{"record":{"id":"e93624385976aef5","repo":"diegosouzapw/OmniRoute","slug":"path-unavailable","errorCode":"path_unavailable","errorMessage":"Claude auth path could not be resolved","messagePattern":"Claude auth path could not be resolved","errorType":"exception","errorClass":"ClaudeAuthFileError","httpStatus":500,"severity":"error","filePath":"src/lib/oauth/utils/claudeAuthFile.ts","lineNumber":275,"sourceCode":"    connectionId,\n    connectionLabel,\n    email,\n    fileName,\n    payload,\n    content,\n  };\n}\n\nexport async function writeClaudeAuthFileToLocalCli(connectionId: string) {\n  const built = await buildClaudeAuthFile(connectionId);\n  const paths = getCliConfigPaths(\"claude\");\n  // authPath is sourced exclusively from the static CLI_TOOLS table in\n  // src/shared/services/cliRuntime.ts (joined against os.homedir() inside\n  // that helper). No external/user input ever reaches the path APIs below.\n  const authPath = paths?.auth;\n\n  if (!authPath) {\n    throw new ClaudeAuthFileError(\n      \"Claude auth path could not be resolved\",\n      500,\n      \"path_unavailable\"\n    );\n  }\n\n  const authDir = path.dirname(authPath);\n  await fs.mkdir(authDir, { recursive: true });\n\n  // Side-by-side .bak inside the .claude directory for one-click manual\n  // rollback. Both halves are server-controlled (authDir from the static\n  // CLI_TOOLS table; basename from a server-generated ISO timestamp), so\n  // string concatenation here is safe — and avoids the false-positive\n  // taint on path.join when Semgrep cannot follow the trust chain.\n  let savedBakPath: string | null = null;\n  try {\n    await fs.access(authPath);\n    const ts = new Date().toISOString().replace(/[:.]/g, \"-\");","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/claudeAuthFile.ts#L257-L293","documentation":"writeClaudeAuthFileToLocalCli guard: getCliConfigPaths('claude') returned no auth path, so there is nowhere to write credentials.json. The authPath comes only from the static CLI_TOOLS table in src/shared/services/cliRuntime.ts joined with homedir — its absence means the Claude CLI tool definition lacks an authPath entry (config/table gap), not a user-input problem.","triggerScenarios":"Thrown at src/lib/oauth/utils/claudeAuthFile.ts:275 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add/fix the auth path entry for claude in the CLI_TOOLS table in src/shared/services/cliRuntime.ts","Verify getCliConfigPaths resolves the claude entry at runtime","Surface a clear configuration error — retrying will not help until the table is fixed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}