Summary
get_global_news_yfinance() slices all_news[:limit] before filtering out articles published after the requested date. If those first articles are filtered, the function may return an empty news section without a no-news message, even though later collected articles might be usable.
Evidence
tradingagents/dataflows/yfinance_news.py:173 iterates all_news[:limit].
tradingagents/dataflows/yfinance_news.py:177-181 can skip items after the slice.
tradingagents/dataflows/yfinance_news.py:199 returns the header regardless of whether news_str is empty.
Expected
Filtering should happen before applying the final limit, and empty post-filter results should return a clear no-news message.
Suggested fix
Build a filtered list first, then slice to limit, and check whether the formatted body is empty.
Summary
get_global_news_yfinance()slicesall_news[:limit]before filtering out articles published after the requested date. If those first articles are filtered, the function may return an empty news section without a no-news message, even though later collected articles might be usable.Evidence
tradingagents/dataflows/yfinance_news.py:173iteratesall_news[:limit].tradingagents/dataflows/yfinance_news.py:177-181can skip items after the slice.tradingagents/dataflows/yfinance_news.py:199returns the header regardless of whethernews_stris empty.Expected
Filtering should happen before applying the final limit, and empty post-filter results should return a clear no-news message.
Suggested fix
Build a filtered list first, then slice to
limit, and check whether the formatted body is empty.