{"record":{"id":"54034cf414cd1288","repo":"can1357/oh-my-pi","slug":"no-oauth-accounts-resolved-for-provider-model-pr","errorCode":null,"errorMessage":"No OAuth accounts resolved for provider ${model.provider}","messagePattern":"No OAuth accounts resolved for provider (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/dry-balance-cli.ts","lineNumber":818,"sourceCode":"\t\tprogressClosed = true;\n\t\tprogress?.close();\n\t};\n\ttry {\n\t\tconst modelSelector = command.flags.model ?? command.model;\n\t\tconst { model, warning } = await resolveDryBalanceModel(\n\t\t\tmodelSelector,\n\t\t\truntime.modelRegistry,\n\t\t\truntime.settings,\n\t\t\trandomSessionId,\n\t\t);\n\t\tif (warning) writeStderr(`${chalk.yellow(`Warning: ${warning}`)}\\n`);\n\t\tlet results: DryBalanceAttemptResult[];\n\t\tlet benchResults: DryBalanceBenchResult[] | undefined;\n\t\tlet summarySamples = samples;\n\t\tlet summaryConcurrency = concurrency;\n\t\tif (isBench) {\n\t\t\tconst targets = await resolveBenchTargets(model, runtime.modelRegistry.authStorage);\n\t\t\tif (targets.length === 0) throw new Error(`No OAuth accounts resolved for provider ${model.provider}`);\n\t\t\tsummarySamples = targets.length;\n\t\t\tsummaryConcurrency = targets.length;\n\t\t\tconst progressWrite = command.flags.json ? writeStderr : writeStdout;\n\t\t\tconst progressInteractive = command.flags.json\n\t\t\t\t? (deps.stderrIsTTY ?? process.stderr.isTTY === true)\n\t\t\t\t: (deps.stdoutIsTTY ?? process.stdout.isTTY === true);\n\t\t\tconst progressColumns = command.flags.json\n\t\t\t\t? (deps.stderrColumns ?? process.stderr.columns ?? 80)\n\t\t\t\t: (deps.stdoutColumns ?? process.stdout.columns ?? 80);\n\t\t\tprogress = createBenchProgressSink(targets.length, progressWrite, progressInteractive, progressColumns);\n\t\t\tbenchResults = await runBenchTargets(\n\t\t\t\tmodel,\n\t\t\t\ttargets,\n\t\t\t\truntime.modelRegistry.authStorage,\n\t\t\t\trandomSessionId,\n\t\t\t\tprogress,\n\t\t\t\tstreamFn,\n\t\t\t\tnow,","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/dry-balance-cli.ts#L800-L836","documentation":"The dry-balance --bench mode benchmarks each OAuth account for the target model's provider via resolveBenchTargets. If no OAuth accounts resolve for that provider, there is nothing to bench and the command throws, naming the provider. This only applies to providers authenticated through OAuth (not API keys).","triggerScenarios":"Running `omp dry-balance --bench` with a model whose provider has zero resolved OAuth accounts: the provider was authenticated with an API key instead of OAuth, OAuth tokens expired and were dropped, or the provider is API-key-only.","commonSituations":"Benching an OpenAI/Anthropic-style model while logged in via API key env var rather than `omp auth` OAuth login; revoked or expired OAuth credentials; selecting a model from a provider (e.g. a custom OpenAI-compatible endpoint) that has no OAuth flow at all.","solutions":["Re-authenticate the provider with OAuth: omp auth login <provider> (or the auth command for that provider)","Check `omp auth` (status/list) to confirm at least one OAuth account exists for the provider","Pick a model whose provider has OAuth accounts, or run non-bench mode which uses the configured credential instead","Re-run OAuth login if tokens expired; stale/invalid tokens may resolve to zero accounts"],"exampleFix":"// before\nomp dry-balance --bench --model openai/gpt-4.1   # only API-key auth configured\n// after\nomp auth login openai\nomp dry-balance --bench --model openai/gpt-4.1","handlingStrategy":"validation","validationCode":"const accounts = await authStorage.list(model.provider); // provider auth storage\nif (!accounts || accounts.length === 0) {\n  console.error(`Provider ${model.provider} has no OAuth accounts; run the auth login command first.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(model);\n} catch (e) {\n  if (/No OAuth accounts resolved/.test((e as Error).message)) {\n    console.error(`Authenticate ${model.provider} via OAuth (auth login) or drop --bench to use the configured credential.`);\n  } else throw e;\n}","preventionTips":["Run the OAuth login flow (omp auth) for each provider before benching","Periodically re-login: expired/revoked tokens can drop to zero usable accounts","Remember API-key-only providers cannot be benched per-account; skip --bench for them"],"tags":["cli","oauth","authentication","dry-balance"],"backgroundTag":"no-oauth-accounts","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}