{"record":{"id":"a7d39cf1cad70d32","repo":"nexu-io/open-design","slug":"no-sources-are-available-for-this-run","errorCode":null,"errorMessage":"No sources are available for this run.","messagePattern":"No sources are available for this run\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"design-templates/last30days/scripts/lib/pipeline.py","lineNumber":202,"sourceCode":"    settings = DEPTH_SETTINGS[depth]\n    requested_sources = normalize_requested_sources(requested_sources)\n    from_date, to_date = dates.get_date_range(lookback_days)\n\n    if mock:\n        runtime = providers.mock_runtime(config, depth)\n        reasoning_provider = None\n        available = list(requested_sources or MOCK_AVAILABLE_SOURCES)\n    else:\n        runtime, reasoning_provider = providers.resolve_runtime(config, depth)\n        available = available_sources(config, requested_sources)\n        if requested_sources:\n            available = [source for source in available if source in requested_sources]\n    if web_backend == \"none\":\n        available = [s for s in available if s != \"grounding\"]\n    elif web_backend in (\"brave\", \"exa\", \"serper\") and \"grounding\" not in available:\n        available.append(\"grounding\")\n    if not available:\n        raise RuntimeError(\"No sources are available for this run.\")\n\n    if external_plan:\n        # External plan provided (e.g., from Claude Code via --plan flag).\n        # Parse it through the same sanitizer to validate structure.\n        plan = planner._sanitize_plan(\n            external_plan, topic, available, requested_sources, depth,\n        )\n        plan_source = \"external\"\n    else:\n        plan = planner.plan_query(\n            topic=topic,\n            available_sources=available,\n            requested_sources=requested_sources,\n            depth=depth,\n            provider=None if mock else reasoning_provider,\n            model=None if mock else runtime.planner_model,\n            context=config.get(\"_auto_resolve_context\", \"\"),\n            internal_subrun=internal_subrun,","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/design-templates/last30days/scripts/lib/pipeline.py#L184-L220","documentation":"pipeline.run() computes the effective source list `available` from available_sources(config, requested_sources), filters it by requested_sources, drops 'grounding' when web_backend == 'none' (or adds it when a web backend is active), and then asserts `if not available: raise RuntimeError(\"No sources are available for this run.\")`. In mock mode, available defaults to MOCK_AVAILABLE_SOURCES (or requested_sources), so this normally only fires on real runs where no source could be enabled — i.e. no provider keys, no X/Threads/etc. credentials, and the request filtered everything out.","triggerScenarios":"Real (non-mock) run with no API keys/credentials of any kind AND `--search` restricts to sources that all need credentials; or `--search X` where X is never available in this env; or web_backend='none' combined with `--search grounding` (grounding is then removed, leaving an empty list).","commonSituations":"First run with no env configured; revoked/expired X (bird) session; OPENAI/OPENROUTER/XAI keys removed and `--search` restricted to x only; CI without secrets; explicitly passing `--web-backend none --search grounding`.","solutions":["Run `last30days ... --diagnose` (or inspect pipeline.diagnose output) to see which sources are available and why.","Set at least one provider key (OPENAI_API_KEY / XAI_API_KEY / OPENROUTER_API_KEY) and/or a web backend key (BRAVE/EXA/SERPER/PARALLEL).","Re-authenticate the X source (bird) if `--search x` is required.","Drop the offending `--search` filter, or do not combine `--web-backend none` with `--search grounding`.","Use `--mock` for an offline run that does not require credentials."],"exampleFix":"# before (no keys, grounding-only, web off)\npython3.12 last30days.py --topic x --web-backend none --search grounding\n# after\nexport OPENAI_API_KEY=sk-...\npython3.12 last30days.py --topic x --web-backend auto","handlingStrategy":"validation","validationCode":"from lib import pipeline\ndiag = pipeline.diagnose(config, requested_sources)\navailable = diag['available_sources']\nif not available:\n    raise RuntimeError(f'no sources available with current config: providers={diag[\"providers\"]}, x_backend={diag[\"x_backend\"]}')","typeGuard":null,"tryCatchPattern":"try:\n    report = pipeline.run(topic=t, config=config, depth=depth, requested_sources=src, web_backend=wb)\nexcept RuntimeError as e:\n    if 'No sources are available' in str(e):\n        # surface diagnose() to the user and/or retry with --mock\n        print(pipeline.diagnose(config, src))\n    raise","preventionTips":["Run `--diagnose` first to confirm at least one source is available.","Do not combine `--web-backend none` with `--search grounding`.","Keep at least one provider key and/or one web-search key configured."],"tags":["config","python","pipeline","api-key","credentials","startup-guard"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}