From 75434ca96d5291ae8c7d10ae5cecd43f28cff12b Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 2 Jun 2026 22:39:34 +0200 Subject: [PATCH] feat: flag cached analysis responses with cached:true Allows the UI to distinguish instant cache hits from live computation. Co-Authored-By: Claude Sonnet 4.6 --- web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web.py b/web.py index 50932ff..2963a0a 100644 --- a/web.py +++ b/web.py @@ -363,7 +363,8 @@ class _Handler(BaseHTTPRequestHandler): try: cached = json.loads(cache_path.read_text('utf-8')) if cached.get('threshold') == threshold and cached.get('min_gap') == min_gap: - self._send(200, json.dumps(cached['result']).encode('utf-8'), 'application/json') + payload = dict(cached['result']); payload['cached'] = True + self._send(200, json.dumps(payload).encode('utf-8'), 'application/json') return except Exception: pass