DeepTutor
DeepTutor copied to clipboard
Fix terminal capability error handling
Summary
- mark capability exceptions and unknown capabilities as terminal failures
- emit
DONEwith the matching failed status - persist terminal turns as
failedwith their error text instead ofcompleted - skip post-turn title generation for failed turns
- add regression coverage for terminal and non-terminal errors
Root cause
Capability exceptions were converted into ordinary error events without turn_terminal metadata, followed by a status-less DONE. The turn runtime then unconditionally persisted completed. Because the existing frontend error card intentionally renders only terminal errors, the saved assistant message appeared blank.
User impact
Provider and capability failures now display the existing inline error card both during the live stream and after a session reload. Failed turns also retain the correct persisted status.
Validation
pytest -q tests/runtime/test_orchestrator.py tests/services/session/test_turn_runtime_subscribe.py— 14 passedpytest -q tests/api/test_unified_ws_turn_runtime.py— 10 passedruff checkandruff format --checkon all changed files- real local WebSocket flow emitted
error(status=failed, turn_terminal=true)followed bydone(status=failed) - session API persisted
status=failedand the terminal error event - browser reload rendered the error message instead of a blank assistant area
Closes #731