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 <noreply@anthropic.com>
This commit is contained in:
@@ -363,7 +363,8 @@ class _Handler(BaseHTTPRequestHandler):
|
|||||||
try:
|
try:
|
||||||
cached = json.loads(cache_path.read_text('utf-8'))
|
cached = json.loads(cache_path.read_text('utf-8'))
|
||||||
if cached.get('threshold') == threshold and cached.get('min_gap') == min_gap:
|
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
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user