coleam00/Archon · error · InvalidProviderRunConfigError
provider did not accept the model
Error message
provider did not accept the model
What it means
parseProviderRunModel validates a run-owned model string by routing it through the provider's strict parseRunConfig. If the provider accepts the input but the parsed result has no non-blank model, the provider effectively rejected the model, so this throws InvalidProviderRunConfigError for the 'model' field. It catches models a provider silently drops rather than passing an empty model downstream.
Source
Thrown at packages/providers/src/registry.ts:93
if (!entry) {
throw new UnknownProviderError(id, [...registry.keys()]);
}
return entry;
}
/**
* Get provider capabilities without instantiating a provider.
* @throws UnknownProviderError if not registered
*/
export function getProviderCapabilities(id: string): ProviderCapabilities {
return getRegistration(id).capabilities;
}
/** Validate and normalize a run-owned model through the provider's strict parser. */
export function parseProviderRunModel(id: string, model: string): string {
const parsed = getRegistration(id).parseRunConfig({ model });
if (typeof parsed.model !== 'string' || parsed.model.trim().length === 0) {
throw new InvalidProviderRunConfigError('model', 'provider did not accept the model');
}
return parsed.model;
}
/**
* Get all registered providers.
*/
export function getRegisteredProviders(): ProviderRegistration[] {
return [...registry.values()];
}
/**
* Get API-safe provider info (excludes the factory).
*/
export function getProviderInfoList(): ProviderInfo[] {
return getRegisteredProviders().map(({ id, displayName, capabilities, builtIn }) => ({
id,
displayName,View on GitHub (pinned to 0773b97458)
Solutions
- Use a model identifier the provider's parser accepts (check the provider's supported model list/presets)
- Strip provider prefixes and pass the bare model ID the parser expects
- Log/inspect the raw input — an empty or blank model reaching this function indicates earlier validation is missing
Example fix
// before
const model = parseProviderRunModel('claude', 'anthropic/claude-sonnet-4');
// after
const model = parseProviderRunModel('claude', 'claude-sonnet-4'); Defensive patterns
Strategy: validation
Validate before calling
if (typeof model !== 'string' || model.trim().length === 0) {
throw new Error('model must be a non-blank string before parseProviderRunModel');
} Type guard
function isNonBlankString(v: unknown): v is string {
return typeof v === 'string' && v.trim().length > 0;
} Try / catch
import { InvalidProviderRunConfigError } from '@archon/providers';
try {
model = parseProviderRunModel(providerId, rawModel);
} catch (err) {
if (err instanceof InvalidProviderRunConfigError && err.fieldPath === 'model') {
console.error(`Provider '${providerId}' rejected model '${rawModel}'; use a supported model`);
}
throw err;
} Prevention
- Use model IDs from the provider's own supported/preset list
- Strip provider prefixes before passing the model
- Validate non-blank model strings before calling the parser
When it happens
Trigger: parseProviderRunModel(id, model) where getRegistration(id).parseRunConfig({ model }) returns an object whose .model is undefined, empty, or whitespace-only — e.g. the provider's parser strips/normalizes an unsupported alias to nothing.
Common situations: Model alias not recognized by the installed provider version; passing a provider-prefixed model ('claude/x') to a parser that expects a bare ID; empty or whitespace model string slipping through earlier validation; model renamed/deprecated upstream.
Related errors
- Pi SDK module '${moduleFile}' has no export '${exportName}'.
- Pi OAuth provider '${oauthAuth.name}' produced no apiKey for
- unknown provider setting
- expected ${expected}
- Tier '${tier}' has no configured preset and no built-in defa
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/f196c554761b9169.
Report an issue: GitHub.