Add clear cache indicators to output

- Show " CACHED RESULTS (Xh old)" in compact output header
- Add "use --refresh for fresh data" hint
- Track from_cache and cache_age_hours in Report schema
- Update UI to show cache age in stderr message

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-01-23 16:25:45 -08:00
parent 1e44f9d9b4
commit 26e8d53089
5 changed files with 59 additions and 4 deletions
+7
View File
@@ -29,6 +29,13 @@ def render_compact(report: schema.Report, limit: int = 15) -> str:
# Header
lines.append(f"## Research Results: {report.topic}")
lines.append("")
# Cache indicator
if report.from_cache:
age_str = f"{report.cache_age_hours:.1f}h old" if report.cache_age_hours else "cached"
lines.append(f"**⚡ CACHED RESULTS** ({age_str}) - use `--refresh` for fresh data")
lines.append("")
lines.append(f"**Date Range:** {report.range_from} to {report.range_to}")
lines.append(f"**Mode:** {report.mode}")
if report.openai_model_used: