Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(api): treat whitespace-only TUSHARE_TOKEN as unconfigured in alpha readiness

Yufeng Hed343ea38153f
diff --git a/agent/src/api/alpha_routes.py b/agent/src/api/alpha_routes.py
index e4c67f17a..6c6c55a9f 100644
--- a/agent/src/api/alpha_routes.py
+++ b/agent/src/api/alpha_routes.py
@@ -408,7 +408,7 @@ def register_alpha_routes(
from src.factors.registry import get_default_registry
registry = get_default_registry()
- configured = bool(get_env_config().data.tushare_token)
+ configured = bool(get_env_config().data.tushare_token.strip())
installed = importlib.util.find_spec("tushare") is not None
return {"universes": {
"csi300": {"ready": configured and installed, "reason": "tushare_ready" if configured and installed else "tushare_token_missing" if not configured else "tushare_dependency_missing"},