{"record":{"id":"fd8834dff2d179a6","repo":"HKUDS/DeepTutor","slug":"no-active-video-generation-model-is-configured-se","errorCode":null,"errorMessage":"No active video-generation model is configured. Set it in Settings > Media Generation > Video Generation.","messagePattern":"No active video-generation model is configured\\. Set it in Settings > Media Generation > Video Generation\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/config/provider_runtime.py","lineNumber":1126,"sourceCode":"        size=_as_str((model or {}).get(\"size\")),\n        quality=_as_str((model or {}).get(\"quality\")),\n        style=_as_str((model or {}).get(\"style\")),\n        response_format=_as_str((model or {}).get(\"response_format\")),\n    )\n\n\ndef resolve_videogen_runtime_config(\n    catalog: dict[str, Any] | None = None,\n    *,\n    service: ModelCatalogService | None = None,\n) -> VideogenConfig:\n    \"\"\"Resolve the active text-to-video config from the model catalog.\"\"\"\n    catalog_service = service or get_model_catalog_service()\n    loaded = _load_catalog(catalog)\n    profile, model = _active_profile_and_model(loaded, catalog_service, \"videogen\")\n    resolved_model = _as_str((model or {}).get(\"model\"))\n    if not resolved_model:\n        raise ValueError(\n            \"No active video-generation model is configured. \"\n            \"Set it in Settings > Media Generation > Video Generation.\"\n        )\n\n    provider = _canonical_generation_provider(\n        _as_str((profile or {}).get(\"binding\")), VIDEOGEN_PROVIDERS\n    )\n    spec = VIDEOGEN_PROVIDERS[provider]\n    api_base = _as_str((profile or {}).get(\"base_url\")) or spec.default_api_base\n    api_key = _as_str((profile or {}).get(\"api_key\"))\n    if not api_key and spec.is_local:\n        api_key = \"sk-no-key-required\"\n\n    return VideogenConfig(\n        model=resolved_model,\n        provider_name=provider,\n        adapter=spec.adapter,\n        auth_style=spec.auth_style,","sourceCodeStart":1108,"sourceCodeEnd":1144,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/config/provider_runtime.py#L1108-L1144","documentation":"Raised by resolve_videogen_runtime_config when the active profile's model entry for the 'videogen' category has an empty or missing 'model' field. Without a concrete model id the resolver cannot construct a provider config for video generation. Pure configuration error, thrown before any network call.","triggerScenarios":"Calling generate_video, probe_video, or _test_videogen when no active text-to-video model is set in Settings > Media Generation > Video Generation, or the catalog's videogen profile lacks a 'model' string.","commonSituations":"Video generation feature enabled but never configured; catalog file edited by hand and model key removed; environment-specific catalog (dev vs prod) missing the videogen entry.","solutions":["Set an active video-generation model in Settings > Media Generation > Video Generation","Fix the catalog so the active videogen profile's model object has a non-empty 'model' value","Guard callers (e.g. probe_video UI) with a pre-check that shows a setup dialog instead of crashing"],"exampleFix":"// before\nvideo = generate_video(prompt=\"sunset timelapse\")  // ValueError\n// after\ntry:\n    video = generate_video(prompt=\"sunset timelapse\")\nexcept ValueError as e:\n    if \"video-generation model\" in str(e):\n        show_setup_dialog(\"videogen\")\n    else:\n        raise","handlingStrategy":"validation","validationCode":"def videogen_configured() -> bool:\n    try:\n        resolve_videogen_runtime_config()\n        return True\n    except ValueError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    cfg = resolve_videogen_runtime_config()\nexcept ValueError as e:\n    if \"video-generation model\" in str(e):\n        prompt_user_to_configure(\"videogen\")\n    raise","preventionTips":["Run probe_video with a pre-check that returns a setup hint instead of an error","Include videogen model selection in onboarding when the feature is enabled"],"tags":["config","video-generation","model-catalog"],"backgroundTag":"missing-model-configuration","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}