{"record":{"id":"bbab58370b826379","repo":"HKUDS/Vibe-Trading","slug":"universe-universe-r-produced-empty-panel-for-st","errorCode":null,"errorMessage":"universe {universe!r} produced empty panel for {start}..{end}; check network / token / date range","messagePattern":"universe (.+?) produced empty panel for (.+?)\\.\\.(.+?); check network / token / date range","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/alpha_bench_tool.py","lineNumber":145,"sourceCode":"    cache_dir = Path.home() / \".vibe-trading\" / \"cache\"\n    cache_path = cache_dir / f\"{universe}_{start}_{end}.pkl\"\n    if use_cache and cache_path.is_file():\n        cached = _read_pickle_cache(cache_path)\n        if cached is not None:\n            logger.info(\"universe %s: loaded from cache %s\", universe, cache_path)\n            return cached\n\n    if universe == \"csi300\":\n        panel = _load_csi300_panel(start, end)\n    elif universe == \"sp500\":\n        panel = _load_sp500_panel(start, end)\n    elif universe == \"btc-usdt\":\n        panel = _load_btc_panel(start, end)\n    else:  # pragma: no cover — guarded above\n        raise ValueError(f\"unhandled universe {universe!r}\")\n\n    if not panel or \"close\" not in panel or panel[\"close\"].empty:\n        raise RuntimeError(\n            f\"universe {universe!r} produced empty panel for {start}..{end}; \"\n            \"check network / token / date range\"\n        )\n\n    # btc-usdt loader returns a single-column close (one instrument). Cross-\n    # sectional IC needs >= 2 instruments — short-circuit with a clean error\n    # that propagates to API (400) and CLI.\n    close_df = panel[\"close\"]\n    if universe == \"btc-usdt\" and close_df.shape[1] < 2:\n        raise ValueError(\n            \"btc-usdt is single-asset; cross-sectional IC needs >=2 instruments. \"\n            \"Use a multi-symbol crypto basket (e.g. multiple OKX pairs) for \"\n            \"meaningful results.\"\n        )\n\n    if use_cache:\n        _write_pickle_cache(cache_dir, cache_path, panel)\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/alpha_bench_tool.py#L127-L163","documentation":"After loading, the panel must contain a non-empty 'close' DataFrame. This RuntimeError means the data loader returned nothing usable — typically a network failure, invalid/expired API token, or a date range with no trading data.","triggerScenarios":"Requesting csi300 or crypto data while offline; a Tushare token without permission for the window; a period entirely outside the asset's history (e.g. btc-usdt before 2010).","commonSituations":"CI runs without network access; expired TUSHARE_TOKEN; sandbox/proxy blocking the data API; caching disabled plus transient API outage.","solutions":["Verify network connectivity and that the data API is reachable","Check/refresh the token in agent/.env (TUSHARE_TOKEN) and confirm it has the needed endpoints","Widen or shift the date range to overlap actual trading history","Retry after transient outages; inspect ~/.vibe-trading/cache for stale artifacts"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"assert period covers known trading history for the universe (e.g. csi300 >= 2005)","typeGuard":null,"tryCatchPattern":"try:\n    panel = _load_universe_panel(u, p, use_cache=False)\nexcept RuntimeError as e:\n    if 'empty panel' in str(e):\n        panel = retry_with_backoff(lambda: _load_universe_panel(u, p), attempts=3)\n    else: raise","preventionTips":["Warm the ~/.vibe-trading cache before batch runs","Health-check tokens/network before long bench sessions"],"tags":["network","data-loading","runtime","alpha-bench"],"backgroundTag":"empty-dataset-from-data-source","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}