{"record":{"id":"92de65c8e015c2ed","repo":"abi/screenshot-to-code","slug":"no-model-was-provided","errorCode":null,"errorMessage":"No model was provided","messagePattern":"No model was provided","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/evals/runner.py","lineNumber":220,"sourceCode":"async def run_image_evals(\n    stack: Optional[Stack] = None,\n    model: Optional[str] = None,\n    n: int = 1,\n    input_files: Optional[List[str]] = None,\n    diff_mode: bool = False,\n    progress_callback: Optional[Callable[[dict[str, Any]], Any | Awaitable[Any]]] = None,\n    eval_set: Optional[str] = None,\n    eval_session_id: Optional[str] = None,\n    skip_input_files: Optional[set[str]] = None,\n) -> List[str]:\n    evals, briefs_by_id = _resolve_eval_items(input_files, eval_set)\n    is_text_set = bool(briefs_by_id)\n    INPUT_DIR = \"\" if is_text_set else _get_input_dir(eval_set)\n\n    if not stack:\n        raise ValueError(\"No stack was provided\")\n    if not model:\n        raise ValueError(\"No model was provided\")\n\n    print(\"User selected stack:\", stack)\n    print(\"User selected model:\", model)\n    selected_model = Llm(model)\n    print(f\"Running evals for {selected_model.value} model\")\n    \n    if input_files and len(input_files) > 0:\n        print(f\"Running on {len(evals)} selected files\")\n    else:\n        print(f\"Running on all {len(evals)} files in {INPUT_DIR}\")\n\n    output_subfolder = get_eval_output_subfolder(\n        stack=stack,\n        model=selected_model.value,\n    )\n    os.makedirs(output_subfolder, exist_ok=True)\n\n    task_coroutines: List[","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/abi/screenshot-to-code/blob/d026163f586dfa8c5c10d28c36edd59a9d3b0e88/backend/evals/runner.py#L202-L238","documentation":"ValueError raised immediately after the stack check when `model` is empty. It guards Llm(model) from receiving an invalid value: an empty model would raise a less clear conversion error, so the explicit check gives an actionable message first.","triggerScenarios":"Calling the eval runner with model omitted/None/empty string — e.g. a session UI where no model was selected for the run.","commonSituations":"Model dropdown left unselected in the eval sessions UI, or an API/slash-command caller forwarding an undefined field.","solutions":["Pass one of the model ids present in the Llm enum (the same list the Settings dialog shows).","Make the UI require a model before the run button is enabled.","If it still fails, log the exact incoming payload — an empty string usually means the caller read the wrong form field."],"exampleFix":"# before\nrun_evals(stack=\"html\", model=\"\")\n\n# after\nrun_evals(stack=\"html\", model=\"gpt-4o\")","handlingStrategy":"type-guard","validationCode":"if not model or not isinstance(model, str):\n    raise ValueError(\"model is required\")\ntry:\n    selected = Llm(model)\nexcept ValueError:\n    raise ValueError(f\"Unknown model {model!r}\")","typeGuard":"from enum import Enum\ndef is_valid_model(model: str) -> bool:\n    try:\n        Llm(model)\n        return True\n    except ValueError:\n        return False","tryCatchPattern":null,"preventionTips":["Populate the model selector from the Llm enum so only valid ids can be submitted.","Require selection before enabling the run button."],"tags":["evals","validation","model","valueerror"],"backgroundTag":null,"analyzedSha":"d026163f586dfa8c5c10d28c36edd59a9d3b0e88","analyzedAt":"2026-08-14T22:02:06.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}