TradingAgents/tradingagents
Youssef Aitousarrah ce2a6ef8fa fix(discovery): fix infinite hang when a scanner thread blocks indefinitely
Two issues caused the agent to get stuck after the last log message
from a completed scanner (e.g. "✓ reddit_trending: 11 candidates"):

1. `as_completed()` had no global timeout. If a scanner thread blocked
   in a non-interruptible I/O call, `as_completed()` waited forever
   because it only yields a future once it has finished — the per-future
   `future.result(timeout=N)` call was never even reached.
   Fixed by passing `timeout=global_timeout` to `as_completed()` so
   the outer iterator raises TimeoutError after a capped wall-clock
   budget, then logs which scanners didn't complete and continues.

2. `SectorRotationScanner` called `get_ticker_info()` (one HTTP request
   per ticker) in a serial loop for up to 100 tickers from a 592-ticker
   file, easily exceeding the 30 s per-scanner budget.
   Fixed by batch-downloading close prices for all tickers in a single
   `download_history()` call, computing 5-day returns locally, and only
   calling `get_ticker_info()` for the small subset of laggard tickers
   (<2% 5d move) that actually need a sector label.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 22:14:53 -08:00
..
agents Update 2026-02-20 08:38:15 -08:00
dataflows fix(discovery): fix infinite hang when a scanner thread blocks indefinitely 2026-02-20 22:14:53 -08:00
graph fix(discovery): fix infinite hang when a scanner thread blocks indefinitely 2026-02-20 22:14:53 -08:00
ml chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
schemas feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
tools chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
ui fix(ui): fix signal cards rendering as raw HTML in Streamlit 2026-02-20 11:33:15 -08:00
utils feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
__init__.py feat: discovery system code quality improvements and concurrent execution 2026-02-05 23:27:01 -08:00
config.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
default_config.py feat: add daily discovery workflow, recommendation history, and scanner improvements 2026-02-11 22:07:02 -08:00