{"record":{"id":"f4a1add1d6092126","repo":"Hmbown/CodeWhale","slug":"no-default-provider-model-base-url-constants-found","errorCode":null,"errorMessage":"no default provider model/base URL constants found","messagePattern":"no default provider model/base URL constants found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/check-provider-registry.py","lineNumber":236,"sourceCode":"    if missing:\n        raise ValueError(f\"ModelRegistry uses unknown provider variants: {sorted(missing)}\")\n    return {variant_to_id[variant] for variant in variants}\n\n\ndef default_strings(tui_config_rs: str) -> set[str]:\n    # Model/base-URL constants now live in config/models.rs (#3311); scan it\n    # alongside config.rs so the check follows the leaf split.\n    sources = tui_config_rs + \"\\n\" + read(TUI_CONFIG_MODELS_RS)\n    defaults = set()\n    for name, value in re.findall(\n        r'const\\s+(DEFAULT_[A-Z0-9_]+(?:MODEL|BASE_URL)):\\s*&str\\s*=\\s*\"([^\"]+)\"',\n        sources,\n    ):\n        if name == \"DEFAULT_DEEPSEEKCN_BASE_URL\":\n            continue\n        defaults.add(value)\n    if not defaults:\n        raise ValueError(\"no default provider model/base URL constants found\")\n    return defaults\n\n\ndef missing_default_strings(providers_md: str, defaults: set[str]) -> list[str]:\n    # Inline-code validation should not let fenced TOML/bash examples pair a\n    # stray backtick with later prose; strip fenced blocks before scanning.\n    inline_source = re.sub(r\"```.*?```\", \"\", providers_md, flags=re.DOTALL)\n    code_spans = set(re.findall(r\"`([^`]+)`\", inline_source))\n    return sorted(defaults - code_spans)\n\n\ndef report_set(label: str, expected: set[str], actual: set[str]) -> list[str]:\n    errors = []\n    missing = sorted(expected - actual)\n    extra = sorted(actual - expected)\n    if missing:\n        errors.append(f\"{label} missing: {', '.join(missing)}\")\n    if extra:","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-provider-registry.py#L218-L254","documentation":"default_strings found no `const DEFAULT_*_MODEL: &str = \"...\"` or `const DEFAULT_*_BASE_URL: &str = \"...\"` constants across crates/tui/src/config.rs and crates/tui/src/config/models.rs. Those constants are what the PROVIDERS.md drift check requires to appear as inline code spans, so zero matches means the check cannot run at all. The script already follows one historical move of these constants (#3311); any further move breaks it.","triggerScenarios":"Moving the default model/base-URL constants to a new module without updating TUI_CONFIG_MODELS_RS; renaming constants away from the DEFAULT_*_MODEL / DEFAULT_*_BASE_URL pattern; changing the type away from a plain &str literal (for example concat! or env! macros).","commonSituations":"Further leaf splits of the tui config module; constant-cleanup renames; switching defaults to runtime configuration.","solutions":["Locate where the DEFAULT_*_MODEL / DEFAULT_*_BASE_URL constants now live and update TUI_CONFIG_MODELS_RS (or add the new path) in scripts/check-provider-registry.py","Keep the constants as &str literals named DEFAULT_<PROVIDER>_MODEL or DEFAULT_<PROVIDER>_BASE_URL","Remember DEFAULT_DEEPSEEKCN_BASE_URL is intentionally excluded from the docs check; do not rename other constants into that shape to dodge the check"],"exampleFix":"# before (scripts/check-provider-registry.py) — constants moved to a new leaf module\nTUI_CONFIG_MODELS_RS = ROOT / 'crates' / 'tui' / 'src' / 'config' / 'models.rs'\n# after\nTUI_CONFIG_MODELS_RS = ROOT / 'crates' / 'tui' / 'src' / 'config' / 'defaults.rs'","handlingStrategy":"validation","validationCode":"sources = tui_config_rs + '\\n' + models_rs_text\ndefaults = re.findall(r'const\\s+(DEFAULT_[A-Z0-9_]+(?:MODEL|BASE_URL)):\\s*&str\\s*=\\s*\"([^\"]+)\"', sources)\nassert defaults, 'default constants moved or renamed — update the checker paths'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Update TUI_CONFIG_MODELS_RS whenever the default constants move","Keep DEFAULT_*_MODEL / DEFAULT_*_BASE_URL naming with &str literal values","Mention new default strings in docs/PROVIDERS.md as inline code spans"],"tags":["python","rust","docs-drift","static-analysis"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}