{"record":{"id":"9dfdaf8ea1340cc6","repo":"zed-industries/zed","slug":"run-request-is-missing-a-benchmark-block","errorCode":null,"errorMessage":"run request is missing a 'benchmark' block","messagePattern":"run request is missing a 'benchmark' block","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"crates/eval_cli/zed_eval/harness_command.py","lineNumber":19,"sourceCode":"\"\"\"Build the harness command (Harbor or Pier) for a benchmark run request.\n\nThe command is driven by the self-describing `benchmark` block embedded in a run\nrequest (see `benchmarks.benchmark_metadata`), so it works for any registered\nbenchmark without a separate experiment registry lookup.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport json\nfrom typing import Any\n\nfrom . import benchmarks, config\n\n\ndef _benchmark_block(run_request: dict[str, Any]) -> dict[str, Any]:\n    block = run_request.get(\"benchmark\")\n    if not isinstance(block, dict):\n        raise ValueError(\"run request is missing a 'benchmark' block\")\n    return block\n\n\ndef dataset_args(benchmark: dict[str, Any]) -> list[str]:\n    dataset = benchmark.get(\"dataset\") or {}\n    kind = dataset.get(\"kind\")\n    if kind == benchmarks.DATASET_REGISTRY:\n        name = dataset.get(\"name\")\n        if not name:\n            raise ValueError(\"registry dataset requires a name\")\n        return [\"-d\", name]\n    if kind in (benchmarks.DATASET_PATH, benchmarks.DATASET_PIER_PATH):\n        data_dir = dataset.get(\"data_dir\")\n        if not data_dir:\n            raise ValueError(\"path dataset requires data_dir\")\n        return [\"-p\", dataset_path(benchmark)]\n    raise ValueError(f\"unsupported dataset kind: {kind}\")\n","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/eval_cli/zed_eval/harness_command.py#L1-L37","documentation":"When parsing an open request's wsl argument of the form user@distro, Zed splits on '@' and rejects the value when the user part before '@' is empty, before constructing WslConnectionOptions. It guards the remote connection options against a blank username.","triggerScenarios":"Passing a wsl argument whose text before '@' is empty: 'zed --wsl @Ubuntu-22.04', or an equivalent open-request payload (CLI flag, deep link) with wsl = \"@Distro\".","commonSituations":"Hand-typed CLI invocations or scripts that template the user ('--wsl ${USER}@Ubuntu' with USER unset); malformed deep links from other tools.","solutions":["Omit the user to connect with the default: zed --wsl Ubuntu-22.04","Or supply a real username: zed --wsl me@Ubuntu-22.04","Check the script/variable that builds the argument for an unset or empty user variable"],"exampleFix":"# before\nzed --wsl @Ubuntu-22.04   # empty user before '@'\n\n# after\nzed --wsl Ubuntu-22.04     # default user\n# or\nzed --wsl me@Ubuntu-22.04","handlingStrategy":"validation","validationCode":"// Validate the wsl argument before building connection options:\nif let Some((user, _)) = wsl.split_once('@') {\n    ensure!(!user.is_empty(), \"user is empty in wsl argument (use 'distro' or 'user@distro')\");\n}","typeGuard":"fn wsl_arg_is_well_formed(wsl: &str) -> bool {\n    match wsl.split_once('@') {\n        Some((user, distro)) => !user.is_empty() && !distro.is_empty(),\n        None => !wsl.is_empty(),\n    }\n}","tryCatchPattern":null,"preventionTips":["Build '--wsl' args from checked variables; skip the user@ prefix entirely when the user is unknown","Validate deep-link/CLI payloads at the boundary so malformed wsl values get a helpful message, not a connection attempt"],"tags":["wsl","cli","argument-validation","windows"],"backgroundTag":"argument-validation","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}