{"record":{"id":"8f98d89f86d8dd05","repo":"HKUDS/Vibe-Trading","slug":"unknown-universe-universe-r-expected-one-of-so","errorCode":null,"errorMessage":"unknown universe {universe!r}; expected one of {sorted(_VALID_UNIVERSES)}","messagePattern":"unknown universe (.+?); expected one of (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"agent/src/api/alpha_routes.py","lineNumber":405,"sourceCode":"        universe: str | None = Query(None, max_length=64),\n        limit: int = Query(100, ge=1, le=1000),\n    ) -> dict[str, Any]:\n        \"\"\"List alphas, optionally filtered by zoo / theme / universe.\"\"\"\n        if zoo is not None and zoo not in _VALID_ZOOS:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"unknown zoo {zoo!r}; expected one of {sorted(_VALID_ZOOS)}\",\n            )\n        if theme is not None and theme not in _VALID_THEMES:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"unknown theme {theme!r}; expected one of {sorted(_VALID_THEMES)}\",\n            )\n        if universe is not None:\n            _ALIAS = {\"csi300\": \"equity_cn\", \"sp500\": \"equity_us\", \"btc-usdt\": \"crypto\"}\n            universe = _ALIAS.get(universe, universe)\n        if universe is not None and universe not in _VALID_UNIVERSES:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"unknown universe {universe!r}; expected one of {sorted(_VALID_UNIVERSES)}\",\n            )\n\n        from src.factors.registry import get_default_registry\n\n        registry = get_default_registry()\n        try:\n            ids = registry.list(zoo=zoo, theme=theme, universe=universe)\n        except Exception as exc:  # noqa: BLE001\n            logger.exception(\"registry.list failed\")\n            raise HTTPException(status_code=500, detail=_safe_error(exc))\n\n        total = len(ids)\n        sliced = ids[:limit]\n        alphas: list[dict[str, Any]] = []\n        for aid in sliced:\n            try:","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/api/alpha_routes.py#L387-L423","documentation":"The trading service maps broker_sdk connector keys to SDK module paths via _SDK_CONNECTOR_MODULES. _sdk_module raises ValueError when the connector key has no registered mapping, i.e. the built-in SDK doesn't support that broker.","triggerScenarios":"A profile using transport 'broker_sdk' with a connector key not present in _SDK_CONNECTOR_MODULES, then calling check_connection/get_account/get_positions/get_open_orders/get_quote/search_instruments which all resolve through _sdk_module.","commonSituations":"Typos in the connector key in a profile/config, upgrading the agent where an SDK connector was renamed or removed, or expecting a broker to be supported when its SDK integration doesn't exist.","solutions":["Check the _SDK_CONNECTOR_MODULES dict keys in service.py and correct the connector key in the profile to a supported one","If the broker isn't supported by the SDK, use a local connector plugin instead","Pin/align the agent version whose SDK module map matches the connector key you use"],"exampleFix":"# before: key not in map\nprofile = TradingProfile(connector=\"acme\", transport=\"broker_sdk\")\n\n# after: use a registered connector key\nprofile = TradingProfile(connector=\"alpaca\", transport=\"broker_sdk\")\n# or route via local plugin:\nprofile = TradingProfile(connector=\"acme\", transport=\"local_plugin\")","handlingStrategy":"validation","validationCode":"from src.trading.service import _SDK_CONNECTOR_MODULES\n\ndef sdk_connector_supported(connector: str) -> bool:\n    return connector in _SDK_CONNECTOR_MODULES","typeGuard":"def uses_supported_sdk_connector(profile) -> bool:\n    from src.trading.service import _SDK_CONNECTOR_MODULES\n    return profile.transport != \"broker_sdk\" or profile.connector in _SDK_CONNECTOR_MODULES","tryCatchPattern":"try:\n    module = _sdk_module(connector)\nexcept ValueError as e:\n    if \"no SDK connector module\" in str(e):\n        # fall back to a local plugin profile or surface supported keys\n        supported = sorted(_SDK_CONNECTOR_MODULES)\n        raise ValueError(f\"unsupported connector {connector!r}; supported: {supported}\") from e\n    raise","preventionTips":["Check the supported connector map before configuring broker_sdk profiles","Pin the agent version and review _SDK_CONNECTOR_MODULES on upgrade","Prefer local connector plugins for brokers without SDK support"],"tags":["sdk","connector","unsupported-broker","trading"],"backgroundTag":"unsupported-connector-type","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}