{"record":{"id":"e109d8aa33837f86","repo":"earendil-works/pi","slug":"unable-to-resolve-an-auth-provider","errorCode":null,"errorMessage":"Unable to resolve an auth provider","messagePattern":"Unable to resolve an auth provider","errorType":"validation","errorClass":"AuthCommandError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/auth-check.ts","lineNumber":36,"sourceCode":"\treason?: AuthCheckReason;\n\tauthType?: \"api_key\" | \"oauth\";\n}\n\nexport async function checkProviderAuth(\n\targs: Args,\n\tmodelRuntime: ModelRuntime,\n\toptions: { refresh: boolean } = { refresh: false },\n): Promise<AuthCheckResult> {\n\tconst { provider: cliProvider, model: cliModel } = validateAuthCommandArgs(args, \"check\");\n\tlet provider = cliProvider;\n\tif (cliModel) {\n\t\tconst resolved = resolveCliModel({ cliProvider, cliModel, modelRuntime });\n\t\tif (resolved.error || !resolved.model) {\n\t\t\tthrow new AuthCommandError(resolved.error ?? `Unable to resolve model \"${cliModel}\"`);\n\t\t}\n\t\tprovider = resolved.model.provider;\n\t}\n\tif (!provider) throw new AuthCommandError(\"Unable to resolve an auth provider\");\n\tif (modelRuntime.getError()) {\n\t\treturn { status: \"invalid\", provider, reason: \"invalid_state\" };\n\t}\n\tif (!modelRuntime.getProvider(provider)) {\n\t\treturn { status: \"not_ready\", provider, reason: \"provider_not_found\" };\n\t}\n\ttry {\n\t\tconst auth = await modelRuntime.checkAuth(provider);\n\t\tif (!auth) return { status: \"not_ready\", provider, reason: \"credentials_not_configured\" };\n\t\tif (options.refresh && !(await modelRuntime.getAuth(provider))) {\n\t\t\treturn { status: \"not_ready\", provider, reason: \"credentials_not_configured\" };\n\t\t}\n\t\treturn { status: \"ready\", provider, authType: auth.type };\n\t} catch {\n\t\treturn { status: \"invalid\", provider, reason: \"invalid_state\" };\n\t}\n}\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/cli/auth-check.ts#L18-L54","documentation":"Error \"Unable to resolve an auth provider\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/cli/auth-check.ts:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}