{"record":{"id":"a70885f0ce729aaa","repo":"abi/screenshot-to-code","slug":"no-stack-was-provided","errorCode":null,"errorMessage":"No stack was provided","messagePattern":"No stack was provided","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/evals/runner.py","lineNumber":218,"sourceCode":"\n\nasync 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)","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/abi/screenshot-to-code/blob/d026163f586dfa8c5c10d28c36edd59a9d3b0e88/backend/evals/runner.py#L200-L236","documentation":"ValueError raised at the top of the eval run function when the `stack` parameter is empty/falsy. Stack selects the output technology (e.g. html vs react); evals cannot generate code without knowing it, so the run aborts before resolving eval items further (it runs after _resolve_eval_items but before model coercion).","triggerScenarios":"Calling the eval runner programmatically or via a UI route with stack omitted, empty string, or None (e.g. a form field the user left blank).","commonSituations":"Frontend sending an incomplete payload, API consumer not filling the stack field, or a slash-command wrapper that forwards an unset variable.","solutions":["Pass a supported stack value (the same identifiers the main generation route accepts, e.g. 'html' or 'react').","If building a caller, default the field in the UI/route so an empty submit is impossible.","Check the request payload in devtools when triggered from the eval sessions page."],"exampleFix":"# before\nrun_evals(stack=\"\", model=\"gpt-4o\")\n\n# after\nrun_evals(stack=\"html\", model=\"gpt-4o\")","handlingStrategy":"validation","validationCode":"if not stack or not isinstance(stack, str):\n    raise ValueError(\"stack is required (e.g. 'html' or 'react')\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make stack a required field in forms/routes that trigger eval runs.","Default the stack from the project's usual setting when calling the runner programmatically."],"tags":["evals","validation","stack","valueerror"],"backgroundTag":null,"analyzedSha":"d026163f586dfa8c5c10d28c36edd59a9d3b0e88","analyzedAt":"2026-08-14T22:02:06.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}