{"record":{"id":"1010069afd758c73","repo":"t8y2/dbx","slug":"name-must-be-a-boolean","errorCode":null,"errorMessage":"{name} must be a boolean","messagePattern":"(.+?) must be a boolean","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/bench/agent_compare.py","lineNumber":660,"sourceCode":"\n\ndef env_float(name: str, fallback: float) -> float:\n    value = float(env_default(name, str(fallback)))\n    if value <= 0:\n        raise ValueError(f\"{name} must be positive\")\n    return value\n\n\ndef env_bool(name: str, fallback: bool) -> bool:\n    raw = os.getenv(name)\n    if raw is None or raw == \"\":\n        return fallback\n    normalized = raw.strip().lower()\n    if normalized in {\"1\", \"true\", \"yes\", \"on\"}:\n        return True\n    if normalized in {\"0\", \"false\", \"no\", \"off\"}:\n        return False\n    raise ValueError(f\"{name} must be a boolean\")\n\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":642,"sourceCodeEnd":665,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/bench/agent_compare.py#L642-L665","documentation":"env_bool parses an environment variable as a boolean but throws ValueError when the value is not one of the accepted truthy/falsy tokens (1/true/yes/on or 0/false/no/off, case-insensitive). The library fails fast rather than guessing a value for boolean flags.","triggerScenarios":"Setting a boolean env var consumed by connection_params to an unrecognized string, e.g. BENCH_TLS=maybe or BENCH_TLS=enabled, then invoking connection_params.","commonSituations":"Typing 'True ' with stray whitespace is handled, but values like 'y', 'enabled', 'ja', or a translated word are not; copy-pasted config from another tool with different boolean conventions.","solutions":["Change the variable to one of: 1, true, yes, on, 0, false, no, off (any case)","Or unset the variable entirely so the fallback is used","Grep shell profiles/CI config for the variable name and normalize the value"],"exampleFix":"// before\nexport BENCH_TLS=enabled\n// after\nexport BENCH_TLS=true","handlingStrategy":"validation","validationCode":"def validate_bool_env(name: str) -> bool:\n    raw = (os.getenv(name) or \"\").strip().lower()\n    if raw in {\"1\", \"true\", \"yes\", \"on\"}:\n        return True\n    if raw in {\"0\", \"false\", \"no\", \"off\", \"\"}:\n        return False\n    raise SystemExit(f\"{name}={raw!r} must be one of 1/true/yes/on or 0/false/no/off\")\n\nvalidate_bool_env(\"BENCH_TLS\")","typeGuard":"def is_bool_token(raw: str | None) -> bool:\n    return (raw or \"\").strip().lower() in {\"1\", \"true\", \"yes\", \"on\", \"0\", \"false\", \"no\", \"off\"}","tryCatchPattern":"try:\n    params = connection_params()\nexcept ValueError as exc:\n    if \"must be a boolean\" in str(exc):\n        sys.exit(f\"fix the boolean env var: {exc}\")\n    raise","preventionTips":["Stick to canonical true/false for boolean env vars across all tooling","Document accepted boolean tokens next to each flag in your run scripts","Add a config lint step that checks boolean vars against the accepted set"],"tags":["python","environment","configuration","boolean-parsing"],"backgroundTag":"invalid-env-var-value","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"}