Repository navigation
Keep global news on topic and spread it across queries - #1690
Open
barlowa124 wants to merge 1 commit into
Open
barlowa124 wants to merge 1 commit into
barlowa124 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1678.
get_global_news_yfinancepassedenable_fuzzy_query=Truetoyf.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:
global_news_queriesare 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.global_news_article_limitis 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 -qpasses.pytest tests/ -q -m "not integration"also passes, with one skip for a missing optional dependency. A live run ofget_global_news_yfinanceagainst Yahoo on 2026-11-12 returned on-topic macro headlines across the configured queries.