perf(webui/session-load-latency) tier3e: fix empty-scene inconclusive prefix read (Greptile P1)

When cached session has no anchor_activity_scenes and the prefix reader
returns None (e.g. sidecar too large for prefix), the empty-scenes path
did not mark _scene_check_inconclusive = True. This meant an inactive
session with matching message counts would return False (cache fresh)
even though disk may have gained its first scene record.

Fix: the empty-scenes else-branch now sets _scene_check_inconclusive
when disk_meta_quick is None, matching the existing behavior in the
cached-scenes branch (line 3173). The code then falls through to the
full metadata comparison instead of serving a stale cache.

discussion_r3548650345
This commit is contained in:
Konstantin M committed 2026-07-09 03:44:55 +00:00
1 parent db99f72505
commit 12a60a88b4
1 file changed
+6
+6
View File
@@ -3180,6 +3180,12 @@ def _cached_session_lags_disk(cached) -> bool:
disk_scenes = disk_meta_quick.get('anchor_activity_scenes') or {}
if isinstance(disk_scenes, dict) and disk_scenes:
return True
else:
# Prefix read failed (may still succeed via index fallback for
# message count). Mark inconclusive so we fall through to the
# full metadata comparison instead of returning False with
# stale cache. Greptile P1 (discussion_r3548650345).
_scene_check_inconclusive = True
if getattr(cached, 'active_stream_id', None) or getattr(cached, 'pending_user_message', None):
# Active session: messages may be in flight; fall through to the
# full check to be safe.