1 Commits

Author SHA1 Message Date
92718bd72e fix: retry research pass on empty sources, fail loud instead of serving unsourced reports
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>
2026-10-28 01:26:24 +03:00