Skip to content

Bug: Global news can return an empty report after filtering future articles #993

@RSXLX

Description

@RSXLX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions