TradingAgents/tradingagents/graph
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
..
__init__.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
conditional_logic.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
discovery_graph.py fix(discovery): fix infinite hang when a scanner thread blocks indefinitely 2026-02-20 22:14:53 -08:00
price_charts.py chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
propagation.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
reflection.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
setup.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
signal_processing.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
trading_graph.py chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00