Skip to content

Keep global news on topic and spread it across queries - #1690

Open
barlowa124 wants to merge 1 commit into
TauricResearch:mainfrom
barlowa124:fix/global-news-fuzzy
Open

barlowa124 wants to merge 1 commit into
TauricResearch:mainfrom
barlowa124:fix/global-news-fuzzy

Conversation

@barlowa124

@barlowa124 barlowa124 commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes #1678.

get_global_news_yfinance passed enable_fuzzy_query=True to yf.Search. In fuzzy mode Yahoo resolves each long keyword query to the closest tickers and returns their company news. The News Analyst's macro section was built from unrelated headlines, such as a Take-Two story for a query about the Fed.

Two changes:

  • Fuzzy matching is off, and the default global_news_queries are now the short phrases the issue verified return on-topic headlines, such as "Federal Reserve" and "oil prices". A configured query too long for literal matching now contributes nothing, where fuzzy mode fed it wrong-ticker news.
  • The article budget no longer goes to the first query that fills it. Per-query results merge round-robin until global_news_article_limit is spent, so every configured topic is represented when it has in-window articles.

Two tests cover the regressions and fail on the unfixed code. One asserts no search enables fuzzy matching. The other asserts a first query that fills the limit does not crowd out a later one.

uv run --no-project --with '.[dev]' python -m pytest tests/test_news_lookahead.py tests/test_yahoo_rate_limit.py tests/test_undated_tools_as_of.py tests/test_tool_date_enforcement.py tests/test_news_analyst_prompt.py -q passes.

pytest tests/ -q -m "not integration" also passes, with one skip for a missing optional dependency. A live run of get_global_news_yfinance against Yahoo on 2026-11-12 returned on-topic macro headlines across the configured queries.

Yahoo fuzzy matching resolves a long keyword string to whatever tickers it
thinks are closest and returns that company's news, so every get_global_news
call served unrelated ticker headlines to the News Analyst (TauricResearch#1678). Fuzzy
matching is off now and the default queries are the short phrases that return
on-topic results.

The article budget also went to the first query that filled it, so one topic
crowded out every later one. Per-query results now merge round-robin until the
limit is spent.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global news returns an unrelated ticker's company news instead of macro news

1 participant