{"record":{"id":"66afbe75b877525a","repo":"t8y2/dbx","slug":"name-is-required","errorCode":null,"errorMessage":"{name} is required","messagePattern":"(.+?) is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/bench/agent_compare.py","lineNumber":618,"sourceCode":"    shift = offset % len(values)\n    return values[shift:] + values[:shift]\n\n\ndef percentile(values: list[float], fraction: float) -> float:\n    if not values:\n        return 0.0\n    index = min(len(values) - 1, max(0, round((len(values) - 1) * fraction)))\n    return values[index]\n\n\ndef elapsed_ms(started: float) -> float:\n    return (time.perf_counter() - started) * 1000\n\n\ndef required_path(name: str) -> Path:\n    value = os.getenv(name, \"\")\n    if not value:\n        raise ValueError(f\"{name} is required\")\n    path = Path(value).expanduser().resolve()\n    if not path.is_file():\n        raise FileNotFoundError(path)\n    return path\n\n\ndef env_default(name: str, fallback: str) -> str:\n    return os.getenv(name, \"\") or fallback\n\n\ndef env_int(name: str, fallback: int) -> int:\n    value = int(env_default(name, str(fallback)))\n    if value < 1:\n        raise ValueError(f\"{name} must be positive\")\n    return value\n\n\ndef env_int_list(name: str, fallback: list[int]) -> list[int]:","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/bench/agent_compare.py#L600-L636","documentation":"required_path reads an environment variable holding a file path and raises ValueError if it is empty/unset, before even checking existence. It is used for mandatory inputs like candidate artifacts (agent binaries, JDBC jar).","triggerScenarios":"configured_candidates calls required_path(\"ARGO_GO_AGENT\") or similar and the variable is not exported (or exported as empty string) in the shell running the bench.","commonSituations":"Running the bench from a fresh shell/CI job where env vars weren't sourced from .env; misspelled variable name; var defined in one terminal but not the one running the script.","solutions":["Export the required variable, e.g. `export ARGO_GO_AGENT=/path/to/agent-binary` before running","Source the env file / CI secrets that define the artifact paths","Check the configured_candidates call sites for the exact variable names required for the selected BENCH_CANDIDATES","Wrap the run in a preflight script that checks all required vars and fails early with a clear message"],"exampleFix":"// before\npython3 agent_compare.py  # ValueError: ARGO_GO_AGENT is required\n// after\nexport ARGO_GO_AGENT=$PWD/agents/drivers/argo-go/bin/agent\npython3 agent_compare.py","handlingStrategy":"validation","validationCode":"import os\nfor var in (\"ARGO_GO_AGENT\", \"JDBC_JAR\"):\n    if not os.getenv(var):\n        raise SystemExit(f\"{var} is required; export it before running\")","typeGuard":null,"tryCatchPattern":"try:\n    jar = required_path(\"JDBC_JAR\")\nexcept ValueError as e:\n    sys.exit(f\"missing config: {e}\")\nexcept FileNotFoundError as e:\n    sys.exit(f\"path does not exist: {e}\")","preventionTips":["Source your .env / CI secrets before running the bench","Keep all artifact paths in one exported env file","Check configured_candidates for the exact required variable names","Add a preflight dry-run that resolves all paths before spawning agents"],"tags":["environment-variable","configuration","missing-file"],"backgroundTag":"missing-env-var","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}