Skip to content

v2.5.0 - Pluggable News Headlines

Choose a tag to compare

@pjdoland pjdoland released this 12 May 01:44
· 56 commits to main since this release

New Features

  • Pluggable news headlines provider: Top headlines are now injected into LLM context so personalities can naturally reference current events ("Did you hear about…", "Speaking of the news…"). New NewsProvider interface mirroring the v2.4.0 weather provider pattern with three adapters:

    • RSS (default) — any RSS or Atom feed via feedparser. NPR Topics: News is the built-in fallback if NEWS_RSS_URL is unset, so headlines work out-of-the-box with zero configuration.
    • Hacker News — free public API, parallel fan-out across items.
    • Manual — newline-separated env var for offline / testing (zero network egress).

    Cached 30 min, top 5 headlines per turn. Disable entirely with NEWS_PROVIDER=none.

Improvements

  • Robust RSS handling: HTML markup stripped from titles (e.g., <b>BREAKING:</b> Foo — would otherwise be read aloud by TTS). Polite identifying User-Agent on every HTTP request, since BBC / NYT / Reuters / Cloudflare-fronted feeds frequently 403 the default python-requests/X.Y UA. URL scheme validated (http/https only); allow_redirects=False so a misconfigured feed doesn't silently chain through arbitrary hosts. RequestException cleanly returns None per the ABC contract for uniform negative-caching.
  • Hacker News parallel fetch: top-stories + N item fetches use a shared requests.Session with a ThreadPoolExecutor so cold-miss latency stays bounded even with high NEWS_HEADLINE_LIMIT. Per-item timeout tightened to 2s. Per-item raise_for_status() added (HN's Firebase API can return Cloudflare HTML on 200 during incidents).
  • Better startup observability: news provider init log includes the resolved URL/feed name and a Set NEWS_PROVIDER=none in .env to disable hint, so users can grep one line to see exactly where headlines are coming from. Pre-warm-failure message clarifies that headlines are skipped but the toy itself still works.
  • Documentation refresh: project structure tree in README.md brought current with the actual filesystem (utils modules, scheduler, supervisor scripts, all tests subdirectories, top-level files like ROADMAP.md and CLAUDE.md). README .env Settings now covers Weather Context, News Headlines, Proactive Scheduler, and Supervisor / Watchdog — four whole categories that were previously undocumented. Architecture > Key Components lists the real-world context provider, proactive scheduler, and process supervisor. tests/README.md tree refreshed. docs/CREATING_PERSONALITIES.md now mentions scheduled_events.yaml and RVC models in the personality directory layout. docs/QUICKSTART.md gains a §5b for news with feed table, privacy callout, and child-safety guidance.

Configuration

New env vars (all optional; news is on by default with NPR):

#NEWS_PROVIDER=rss              # or hackernews / manual / none / auto
#NEWS_RSS_URL=https://feeds.npr.org/1001/rss.xml   # NPR by default
#MANUAL_NEWS=Headline one\nHeadline two
#NEWS_HEADLINE_LIMIT=5
#NEWS_CACHE_TTL_MINUTES=30

To disable entirely: NEWS_PROVIDER=none.

Upgrading and don't want news? Add NEWS_PROVIDER=none to your existing .env. Existing installs will start fetching NPR headlines at next restart until that line is added.

Privacy note: the news server (e.g., NPR) sees your IP and access cadence; OpenAI sees the headline text and can infer which feed you chose. Use NEWS_PROVIDER=manual or NEWS_PROVIDER=none for zero third-party news egress.

For child-facing personalities (e.g., teddy_ruxpin, fred): NPR Top News may include violence, politics, or other content unsuitable for children. Consider NEWS_PROVIDER=none or a kid-safe RSS feed when running with these personalities.

New dependency

  • feedparser>=6.0.10 (post-6.0 XXE/billion-laughs hardening enabled by default)