-
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Problem
ChatHistoryManager.load_session() wraps its entire body in except Exception and returns [] on any failure. This means:
FileNotFoundError(missing session file) → silently returns empty listPermissionError(access denied) → silently returns empty listValueError(corrupted JSON) → silently returns empty list
The granular exception catches added in #1797 at the API layer are purely defensive — they can only fire if load_session is refactored to let exceptions propagate.
Suggested Fix
Have load_session raise specific exceptions instead of catching everything:
- Let
FileNotFoundErrorpropagate (caller decides how to handle missing sessions) - Let
PermissionErrorpropagate (real problem, shouldn't be silent) - Wrap JSON parse errors in
ValueErrorand propagate - The API layer (feat: Add timeout + granular error mapping to chat message processing #1797) already has the correct catches for all three
Discovered During
Implementing #1797 (chat timeout + granular error mapping)
Impact
Low — current behavior is safe (returns empty), but hides real problems from operators.
Reactions are currently unavailable