nexu-io/open-design · error · RuntimeError
Unsupported source: {source}
Error message
Unsupported source: {source} What it means
Trailing fallthrough in the stream_results dispatcher. Every source is matched by an explicit `if source == '<name>':` branch; if the source string matches none of them (reddit, x, youtube, tiktok, instagram, hackernews, bluesky, threads, truthsocial, polymarket, github, pinterest, xiaohongshu, perplexity, xquik), execution reaches the RuntimeError. It is a strict allow-list guard, not a network/auth failure.
Source
Thrown at design-templates/last30days/scripts/lib/pipeline.py:1012
return pinterest.parse_pinterest_response(result), {}
if source == "xiaohongshu":
return xiaohongshu_api.search_feeds(
subquery.search_query,
from_date,
to_date,
env.get_xiaohongshu_api_base(config),
depth=depth,
), {}
if source == "perplexity":
return perplexity.search(subquery.search_query, date_range, config, deep=config.get("_deep_research", False))
if source == "xquik":
result = xquik.search_xquik(
subquery.search_query, from_date, to_date,
depth=depth,
token=env.get_xquik_token(config),
)
return xquik.parse_xquik_response(result), {}
raise RuntimeError(f"Unsupported source: {source}")
def _google_key(config: dict[str, Any]) -> str | None:
return config.get("GOOGLE_API_KEY") or config.get("GEMINI_API_KEY") or config.get("GOOGLE_GENAI_API_KEY")
def _mock_stream_results(source: str, subquery: schema.SubQuery) -> tuple[list[dict], dict]:
payloads = {
"reddit": [
{
"id": "R1",
"title": f"{subquery.search_query} discussion thread",
"url": "https://reddit.com/r/example/comments/1",
"subreddit": "example",
"date": dates.get_date_range(5)[0],
"engagement": {"score": 120, "num_comments": 48, "upvote_ratio": 0.91},View on GitHub (pinned to 5be4028344)
Solutions
- Check the failing source string in the error message and correct it to a supported name (use 'x' not 'twitter').
- Validate SubQuery.sources against the supported-source allow-list at plan-build time rather than at retrieval time.
- If you added a new source, extend the dispatch chain in pipeline.py stream_results before routing to it.
Example fix
# before SubQuery(label='t', search_query='q', ranking_query='q', sources=['twitter']) # after SubQuery(label='t', search_query='q', ranking_query='q', sources=['x'])
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_SOURCES = {
"reddit", "x", "youtube", "tiktok", "instagram", "hackernews",
"bluesky", "threads", "truthsocial", "polymarket", "github",
"pinterest", "xiaohongshu", "perplexity", "xquik",
}
def validate_sources(subquery):
bad = [s for s in subquery.sources if s not in SUPPORTED_SOURCES]
if bad:
raise ValueError(f"Unsupported source(s) in subquery {subquery.label!r}: {bad}") Type guard
null
Try / catch
null
Prevention
- Centralize the supported-source allow-list in one constant and import it in both the planner validator and the dispatcher.
- Run source validation right after parsing the planner JSON, before any retrieval.
- Add a unit test that asserts every source name emitted by the planner is in the allow-list.
When it happens
Trigger: A SubQuery whose sources list contains a string not in the supported set (e.g. 'twitter' instead of 'x', 'medium', or a custom source name) reaches stream_results. Also triggered by typos or uppercase variants since matching is case-sensitive and lowercase only.
Common situations: Planner LLM emits an unsupported source name. Manual QueryPlan construction with an unvalidated source string. Renaming a source upstream without updating the planner prompt or the dispatcher.
Related errors
- public_github_repository_metric only supports https://api.gi
- SubQuery must have at least one source
- invalid JSON in ${filePath}: ${message}
- ${filePath} must contain a JSON object
- ARTIFACT_MANIFEST_INVALID
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/20230e2cf830acb6.
Report an issue: GitHub.