mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-11-17 06:41:50 +02:00
feat(cli): tell people at a terminal about a newer release and Tauric's notices
- once a day a background thread records the latest GitHub release and the notices for each version; the welcome screen shows them from that cache, so no run waits on the network - the release notice names the upgrade command for how TradingAgents was installed - TRADINGAGENTS_NO_UPDATE_CHECK=1 turns the check off; unattended and CI runs never make it - notices are read from a new `notices` key, so earlier versions keep reading `announcements`
This commit is contained in:
+6
-4
@@ -8,7 +8,7 @@ import typer
|
||||
from rich.align import Align
|
||||
from rich.panel import Panel
|
||||
|
||||
from cli.announcements import display_announcements, fetch_announcements
|
||||
from cli import updates
|
||||
from cli.display import (
|
||||
console,
|
||||
)
|
||||
@@ -124,9 +124,11 @@ def _prompt_selections(prefs, flags):
|
||||
console.print()
|
||||
console.print() # Add vertical space before announcements
|
||||
|
||||
# Fetch and display announcements (silent on failure)
|
||||
announcements = fetch_announcements()
|
||||
display_announcements(console, announcements)
|
||||
# What's new comes from a cache refreshed in the background, and only for
|
||||
# someone at a terminal: a run never waits on it and unattended runs skip it.
|
||||
if updates.enabled():
|
||||
updates.show(console)
|
||||
updates.start_background_refresh()
|
||||
|
||||
def create_question_box(title, prompt, default=None):
|
||||
box_content = f"[bold]{title}[/bold]\n"
|
||||
|
||||
Reference in New Issue
Block a user