DeepTutor
DeepTutor copied to clipboard
Capability failures render as blank assistant messages and persist completed status
Summary
When a chat capability raises before producing assistant content (for example, an LLM provider returns HTTP 401), the web UI renders an empty assistant message instead of the existing terminal-error card. The persisted turn is also incorrectly marked as completed.
Steps to reproduce
- Start DeepTutor from the current
devbranch. - Leave the LLM catalog without a valid API key, or otherwise make the selected capability raise before emitting content.
- Send a chat message.
- Reload the session.
Actual behavior
- The assistant message has empty
content. - The provider error is persisted as an
errorevent with empty metadata. - The orchestrator still emits
DONEwithout a failure status. - The turn runtime writes the turn status as
completed. - The frontend only renders terminal errors carrying
metadata.turn_terminal, so the user sees a blank assistant area.
Expected behavior
- Capability exceptions emit a terminal error with
turn_terminal: trueandstatus: failed. - The matching
DONEevent carriesstatus: failed. - The persisted turn status is
failed, including the error text. - The existing error card is visible both live and after reloading the session.
Root cause
ChatOrchestrator.handle() converts capability exceptions into ordinary error events and unconditionally emits a status-less DONE. TurnRuntimeManager then unconditionally persists completed, ignoring terminal error and done metadata. ChatMessages correctly avoids showing non-terminal errors, which leaves an empty message for this protocol shape.
Environment
- DeepTutor v1.5.7
- Base branch:
dev - Reproduced through the real WebSocket chat flow and persisted session API
Thanks for your comments~ feel free to check v1.5.9