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
+4 -2
View File
@@ -236,11 +236,13 @@ def main():
progress = ui.ProgressDisplay(args.topic, show_banner=True)
if not args.refresh and not args.mock:
cached = cache.load_cache(cache_key)
cached, cache_age = cache.load_cache_with_age(cache_key)
if cached:
# Use cached data
progress.show_cached()
progress.show_cached(cache_age)
report = schema.Report.from_dict(cached)
report.from_cache = True
report.cache_age_hours = cache_age
output_result(report, args.emit)
return