Every logged run (research_run.log/2/3) showed gpt-researcher's free duckduckgo retriever silently returning 0 source URLs under its concurrent sub-query fan-out (ddgs swallows the error into an empty list, no exception raised), while the LLM still wrote a confident, fully unsourced report -- the exact failure this product exists to prevent. generate_market_brief() now retries the full research pass (fresh GPTResearcher -> fresh retriever session) with backoff when a pass returns zero sources, and raises WedgecheckResearchError instead of returning an unsourced MarketBrief if every attempt still comes back empty. Tunable via WEDGECHECK_RESEARCH_MAX_ATTEMPTS / WEDGECHECK_RESEARCH_RETRY_BACKOFF_SECONDS. Also: first commit of this product into version control (requirements.txt, .gitignore, README) -- it had never left the local filesystem before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
16 lines
600 B
Python
16 lines
600 B
Python
"""Errors Wedgecheck raises on purpose, instead of silently degrading.
|
|
|
|
Wedgecheck's one promise is "every claim is cited to a real source." If the
|
|
research engine cannot ground a single source URL, the product must say so
|
|
loudly -- never hand back an unsourced report as if it were sourced.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
|
|
class WedgecheckResearchError(RuntimeError):
|
|
"""Raised when gpt-researcher cannot produce any grounded source URLs.
|
|
|
|
This is a real, user-facing failure (HTTP 502 from the API, a visible
|
|
error banner from the form) -- not an internal bug to hide.
|
|
"""
|