{"record":{"id":"d6542a516c725e03","repo":"HKUDS/Vibe-Trading","slug":"alpha-id-and-zoo-are-mutually-exclusive","errorCode":null,"errorMessage":"alpha_id and zoo are mutually exclusive","messagePattern":"alpha_id and zoo are mutually exclusive","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/alpha_bench_tool.py","lineNumber":719,"sourceCode":"    meta = alpha.meta or {}\n    return {\n        \"id\": alpha_id,\n        \"zoo\": alpha.zoo,\n        \"theme\": meta.get(\"theme\", []),\n        \"formula_latex\": meta.get(\"formula_latex\", \"\"),\n        \"ic_mean\": round(ic_mean, 6),\n        \"ic_std\": round(ic_std, 6),\n        \"ir\": round(ir, 4),\n        \"ic_positive_ratio\": round(ic_pos, 4),\n        \"ic_count\": int(len(ic_series)),\n    }\n\n\ndef _select_alpha_ids(\n    registry: Any, *, alpha_id: str | None, zoo: str | None\n) -> list[str]:\n    if alpha_id and zoo:\n        raise ValueError(\"alpha_id and zoo are mutually exclusive\")\n    if alpha_id:\n        registry.get(alpha_id)  # raises KeyError if unknown\n        return [alpha_id]\n    if zoo:\n        return registry.list(zoo=zoo)\n    return registry.list()\n\n\n# ---------------------------------------------------------------------------\n# HTML rendering\n# ---------------------------------------------------------------------------\n\n_CSP = (\n    \"<meta http-equiv=\\\"Content-Security-Policy\\\" \"\n    \"content=\\\"default-src 'none'; style-src 'unsafe-inline'; script-src 'none'\\\">\"\n)\n\n_REPORT_CSS = \"\"\"","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/alpha_bench_tool.py#L701-L737","documentation":"_select_alpha_ids accepts either a single alpha_id or a zoo filter, never both — combining them is ambiguous about which alphas to bench and is rejected immediately.","triggerScenarios":"Calling run_alpha_bench with both alpha_id='momentum' and zoo='technical' set to non-empty values.","commonSituations":"Wrapper code that forwards optional kwargs verbatim; LLM tool calls filling every field; defaults changed so both become populated.","solutions":["Pass only one: alpha_id for a single alpha, zoo for a filtered set","Omit the unused parameter entirely (None) rather than empty string","In wrappers, drop empty-string values to None before forwarding"],"exampleFix":"// before\nrun_alpha_bench(universe='csi300', period='2023', alpha_id='mom', zoo='technical')\n// after\nrun_alpha_bench(universe='csi300', period='2023', alpha_id='mom')","handlingStrategy":"validation","validationCode":"alpha_id = alpha_id or None; zoo = zoo or None\nassert not (alpha_id and zoo)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Drop empty strings to None for optional params","Generate tool schemas that forbid both fields being set (oneOf)"],"tags":["api-parameters","validation","mutually-exclusive"],"backgroundTag":"conflicting-parameters","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}