{"record":{"id":"3c2fddc8635f8bbc","repo":"TauricResearch/TradingAgents","slug":"method-method-not-supported","errorCode":null,"errorMessage":"Method '{method}' not supported","messagePattern":"Method '(.+?)' not supported","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tradingagents/dataflows/interface.py","lineNumber":175,"sourceCode":"    config = get_config()\n\n    # Check tool-level configuration first (if method provided)\n    if method:\n        tool_vendors = config.get(\"tool_vendors\", {})\n        if method in tool_vendors:\n            return tool_vendors[method]\n\n    # Fall back to category-level configuration\n    return config.get(\"data_vendors\", {}).get(category, \"default\")\n\ndef route_to_vendor(method: str, *args, **kwargs):\n    \"\"\"Route method calls to appropriate vendor implementation with fallback support.\"\"\"\n    category = get_category_for_method(method)\n    vendor_config = get_vendor(category, method)\n    primary_vendors = [v.strip() for v in vendor_config.split(',')]\n\n    if method not in VENDOR_METHODS:\n        raise ValueError(f\"Method '{method}' not supported\")\n\n    all_available_vendors = list(VENDOR_METHODS[method].keys())\n\n    # The configured vendor list IS the chain: we do NOT silently fall back to\n    # vendors the user did not choose (#988/#289) — that returned data from an\n    # unexpected source and caused cross-vendor inconsistencies. For multi-vendor\n    # fallback, list them in order, e.g. data_vendors=\"yfinance,alpha_vantage\".\n    # The \"default\" sentinel (no explicit config) uses all available vendors.\n    explicit = [v for v in primary_vendors if v and v != \"default\"]\n    if explicit:\n        vendor_chain = [v for v in explicit if v in VENDOR_METHODS[method]]\n        if not vendor_chain:\n            raise ValueError(\n                f\"Configured vendor(s) {explicit} not available for '{method}'. \"\n                f\"Available: {all_available_vendors}.\"\n            )\n    else:\n        vendor_chain = all_available_vendors","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/TauricResearch/TradingAgents/blob/a33fd4c0f134485a43553a2c23a63cb14adbd88f/tradingagents/dataflows/interface.py#L157-L193","documentation":"Raised by route_to_vendor() in tradingagents/dataflows/interface.py when the method exists in TOOLS_CATEGORIES but has no entry in VENDOR_METHODS (the method->vendor implementation map). Practically a defensive dead-check for registry drift: a method categorized but with no vendor implementation registered.","triggerScenarios":"A method name passes get_category_for_method() but was never added to VENDOR_METHODS — typically only after local modifications, forks that add a tool to one table but not the other, or version skew between files.","commonSituations":"Contributors adding a new tool to TOOLS_CATEGORIES without registering vendor implementations; vendored/partial upgrades where interface.py tables come from different versions; monkeypatching that replaces VENDOR_METHODS incompletely.","solutions":["If you maintain a fork/added a tool: register the method in VENDOR_METHODS with at least one vendor implementation","Reinstall/align the package so interface.py is a single consistent version: pip install --force-reinstall tradingagents","Check for stray local edits: git status / git diff -- tradingagents/dataflows/interface.py","As a caller, validate against VENDOR_METHODS (not just TOOLS_CATEGORIES) before dispatch"],"exampleFix":"# before\n# (fork added \"get_new_tool\" to TOOLS_CATEGORIES but not VENDOR_METHODS)\nroute_to_vendor(\"get_new_tool\", ...)\n# -> ValueError: Method 'get_new_tool' not supported\n\n# after\nVENDOR_METHODS[\"get_new_tool\"] = {\"yfinance\": my_new_tool_impl}  # register the implementation","handlingStrategy":"validation","validationCode":"from tradingagents.dataflows.interface import VENDOR_METHODS\n\ndef routable(method: str) -> bool:\n    return bool(VENDOR_METHODS.get(method))","typeGuard":null,"tryCatchPattern":"try:\n    route_to_vendor(method, *args)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        logger.error(\"Registry drift: %s categorized but has no vendors; reinstall consistent package\", method)\n    raise","preventionTips":["When adding tools in a fork, register them in BOTH TOOLS_CATEGORIES and VENDOR_METHODS","Reinstall a single consistent version instead of mixing files across releases","Check git diff on interface.py when a fork starts failing here"],"tags":["routing","interface","registry","version-skew"],"backgroundTag":null,"analyzedSha":"a33fd4c0f134485a43553a2c23a63cb14adbd88f","analyzedAt":"2026-08-14T19:45:16.920Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}