DocUA commited on
Commit
5142baa
·
1 Parent(s): 74dcdc4

feat: Task 6 - Add comprehensive error handling and fallback

Browse files

- Add handle_assistant_error() with fallback to Medical mode
- Add _retry_with_backoff() for temporary errors (timeout, connection)
- Add error handling to _handle_spiritual_mode()
- Add error handling to _handle_combined_mode()
- Add error handling to _handle_entry_classification() with last-known-mode fallback
- Update CombinedAssistant._combine_responses() with partial failure notifications
- Log all errors with traceback for debugging

Error handling strategy:
- Timeout/Connection errors: Retry with exponential backoff (max 3 attempts)
- Assistant errors: Fallback to Medical mode with clear user notification
- Entry Classifier errors: Use last known mode or default to Medical
- Partial failures in Combined mode: Show available assistant + error message

Requirements: 11.1, 11.2, 11.3, 11.4, 11.5

2 files changed +247 -21
Files changed (2)
lifestyle_app.py+204-20
src/core/combined_assistant.py+43-1