can1357/oh-my-pi · error
Unknown OAuth provider '${providerArg}'. Known: ${providers
Error message
Unknown OAuth provider '${providerArg}'. Known: ${providers
.map(p => p.id)
.sort()
.join(", ")} What it means
runLogin validates the provider argument against the registered OAuth providers (getOAuthProviders()). An unknown id throws this Error listing all known provider ids, sorted, so the caller can pick a valid one.
Source
Thrown at packages/coding-agent/src/cli/auth-broker-cli.ts:227
process.stdout.write(`${JSON.stringify({ token, path: getTokenFilePath() })}\n`);
} else {
process.stdout.write(`${token}\n`);
}
}
async function runLogin(flags: AuthBrokerCommandArgs["flags"]): Promise<void> {
const providers = getOAuthProviders();
let providerArg = flags.provider;
if (!providerArg) {
if (flags.via) {
throw new Error(
"Usage: omp auth-broker login <provider> --via=user@host (provider required for remote login)",
);
}
providerArg = await pickProviderInteractively(providers);
}
if (!providers.some(p => p.id === providerArg)) {
throw new Error(
`Unknown OAuth provider '${providerArg}'. Known: ${providers
.map(p => p.id)
.sort()
.join(", ")}`,
);
}
if (flags.via) {
await runRemoteLogin(providerArg, flags.via, flags.dryRun ?? false);
return;
}
await runLocalLogin(providerArg as OAuthProvider);
}
async function runLocalLogin(provider: OAuthProvider): Promise<void> {
// Drive the per-provider OAuth dance in-process. Persists into the same
// SQLite store the broker uses.
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
const ask = (msg: string) => promptLine(rl, `${msg} `);View on GitHub (pinned to 9690622007)
Solutions
- Use one of the ids listed after 'Known:' in the error message.
- Check spelling/casing — ids are matched exactly.
- Upgrade or downgrade omp if the target provider was added in a different version.
- Ensure any custom provider plugin/extension that registers the OAuth provider is loaded.
Example fix
// before omp auth-broker login claude // after omp auth-broker login anthropic
Defensive patterns
Strategy: validation
Validate before calling
import { getOAuthProviders } from "./auth-broker-cli-providers"; // or discover via omp auth-broker list
const ids = getOAuthProviders().map(p => p.id);
if (!ids.includes(provider)) {
throw new Error(`Unknown provider '${provider}'. Known: ${[...ids].sort().join(", ")}`);
} Type guard
function isKnownProvider(id: string, providers: { id: string }[]): boolean {
return providers.some(p => p.id === id);
} Try / catch
try {
await runAuthBrokerCommand(args);
} catch (err) {
if (err instanceof Error && err.message.startsWith("Unknown OAuth provider")) {
console.error(err.message); // message lists all valid ids
process.exitCode = 2;
return;
}
throw err;
} Prevention
- Copy provider ids exactly from the 'Known:' list or the docs for your installed version.
- Check `omp --version` when following tutorials from a different release.
- Keep provider ids in a shared constant in scripts instead of inlining strings.
When it happens
Trigger: Running `omp auth-broker login <provider>` (or with --via) where <provider> is misspelled, uses the wrong casing, or refers to a provider not compiled into this build/version.
Common situations: Typos (anthopic instead of anthropic), docs for a newer/older omp version with a different provider roster, or copying a provider id from another tool.
Related errors
- Unknown tool${unknown.length === 1 ? "" : "s"} in --tools: $
- invalid {} argument: {}
- invalid Zero increment value: {}
- Credential ${id} is not OAuth (provider=${provider}, type=${
- GitLab OAuth token response missing required fields
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/6255b9da99dc37e0.
Report an issue: GitHub.