diegosouzapw/OmniRoute · error · ClaudeAuthFileError
path_unavailable
path_unavailable
Error message
Claude auth path could not be resolved
What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/oauth/utils/claudeAuthFile.ts:275 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/e93624385976aef5.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/oauth/utils/claudeAuthFile.ts:275
connectionId,
connectionLabel,
email,
fileName,
payload,
content,
};
}
export async function writeClaudeAuthFileToLocalCli(connectionId: string) {
const built = await buildClaudeAuthFile(connectionId);
const paths = getCliConfigPaths("claude");
// authPath is sourced exclusively from the static CLI_TOOLS table in
// src/shared/services/cliRuntime.ts (joined against os.homedir() inside
// that helper). No external/user input ever reaches the path APIs below.
const authPath = paths?.auth;
if (!authPath) {
throw new ClaudeAuthFileError(
"Claude auth path could not be resolved",
500,
"path_unavailable"
);
}
const authDir = path.dirname(authPath);
await fs.mkdir(authDir, { recursive: true });
// Side-by-side .bak inside the .claude directory for one-click manual
// rollback. Both halves are server-controlled (authDir from the static
// CLI_TOOLS table; basename from a server-generated ISO timestamp), so
// string concatenation here is safe — and avoids the false-positive
// taint on path.join when Semgrep cannot follow the trust chain.
let savedBakPath: string | null = null;
try {
await fs.access(authPath);
const ts = new Date().toISOString().replace(/[:.]/g, "-");View on GitHub (pinned to a179ffed5b)