Hmbown/CodeWhale · error · ValueError
provider!() invocations returned no providers
Error message
provider!() invocations returned no providers
What it means
provider_kind_ids found zero provider identities: no provider!() invocations in crates/config/src/provider.rs matched the one-argument-per-line regex, and none of the hand-listed manual `impl Provider for ...` regexes matched either. This is a catastrophic parse failure of the provider registry source, not ordinary drift — the script can no longer extract any canonical IDs. The macro regex specifically requires a newline between each macro argument.
Source
Thrown at scripts/check-provider-registry.py:171
("Openmodel", "openmodel"),
("MinimaxAnthropic", "minimax-anthropic"),
("OpencodeZen", "opencode-zen"),
# Alibaba Model Studio ships four plan/dialect identities, each with a
# hand-written impl Provider for the same reason as the rows above:
# the wire policy is not fixed, so provider!() cannot express them.
("ModelstudioTokenPlan", "modelstudio-token-plan"),
("ModelstudioTokenPlanAnthropic", "modelstudio-token-plan-anthropic"),
("ModelstudioCodingPlan", "modelstudio-coding-plan"),
("ModelstudioCodingPlanAnthropic", "modelstudio-coding-plan-anthropic"),
]:
match = re.search(
rf'impl\s+Provider\s+for\s+{variant_name}.*?fn\s+id.*?\"({id_literal})\"',
provider_rs, re.DOTALL,
)
if match:
ids[variant_name] = match.group(1)
if not ids:
raise ValueError("provider!() invocations returned no providers")
return ids
def api_provider_ids(tui_config_rs: str) -> dict[str, str]:
# ApiProvider ids derive from ProviderKind ids (via delegation to .kind().as_str())
# plus the legacy "deepseek-cn" variant that exists only in ApiProvider.
variant_to_id = provider_kind_ids("")
# ApiProvider::SiliconflowCn maps to ProviderKind::SiliconflowCN
if "SiliconflowCN" in variant_to_id:
variant_to_id["SiliconflowCn"] = variant_to_id["SiliconflowCN"]
variant_to_id["DeepseekCN"] = "deepseek-cn"
return variant_to_id
def provider_tables(config_rs: str) -> set[str]:
struct_start = require_index(
config_rs, "pub struct ProvidersToml", "crates/config/src/lib.rs"
)View on GitHub (pinned to 8880682c63)
Solutions
- Check provider.rs macro layout — the parser needs each provider!() argument on its own line; restore that formatting (the repo's rustfmt config normally preserves it)
- If the macro was renamed or restructured, update the regexes inside provider_kind_ids() in scripts/check-provider-registry.py
- Confirm crates/config/src/provider.rs exists at the path constant PROVIDER_RS
- For new manually-implemented providers, add (Variant, "id") pairs to the hardcoded list in provider_kind_ids()
Example fix
// before (crates/config/src/provider.rs) — args on one line
provider!(Anthropic, Deepseek, "deepseek", aliases: ["deepseek"]);
// after — one argument per line, as the checker's regex requires
provider!(
Anthropic,
Deepseek,
"deepseek",
aliases: ["deepseek"],
); Defensive patterns
Strategy: try-catch
Validate before calling
pairs = re.findall(r'provider!\(\s*\n\s*\w+,\s*\n\s*(\w+),', provider_rs) assert pairs, 'macro shape no longer matches — update the checker regex'
Try / catch
try:
ids = provider_kind_ids(config_rs)
except ValueError as e:
audit_macro_layout(provider_rs); raise Prevention
- Keep provider!() arguments one per line (the repo rustfmt config preserves this)
- Update the checker regexes when renaming the macro
- Extend the manual-impl list when adding hand-written providers
When it happens
Trigger: The provider!() macro was renamed or its invocations were reformatted onto one line; crates/config/src/provider.rs was moved or drastically restructured; all providers switched to an impl style the checker's regexes do not cover.
Common situations: Bulk reformatting that collapses macro arguments onto one line; macro renames during refactors; path changes after module reshuffles.
Related errors
- {context}: missing parse arm for {variant}
- ProvidersToml returned no provider tables
- ModelRegistry uses unknown provider variants: {sorted(missin
- fragment cap missing: {pattern}
- could not parse match block after {signature!r}
AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16).
Data as JSON: /api/errors/f1ac2e6d7c75698a.
Report an issue: GitHub.