mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:29:23 +08:00
When a question's turn is gone, `submit_user_reply` is refused — correctly; the backend has no waiter left. What the three composers did with that refusal is the bug: they raised "This question is no longer active, so your answer could not be sent. Send a new message to continue." and returned. The composer had already cleared the box, so the return discarded what the user had typed. And the advice was impossible to follow: every subsequent message hit the same branch, because the predicate that routes into it reads only the persisted card, which nothing ever retires. The one instruction the error gave was the one thing it was preventing. So a refused reply now falls through to `sendMessage` with the same content. The card is one way to answer, never the only one, and the conversation cannot trap the user — whichever of the several ways in to a dead turn they came by (a backend restart, a Stop, a replay race). The message says what actually happened rather than reporting a failure: the text was delivered, just not to the question. `REPLY_NOT_DELIVERED` stays for the card banners, where it remains true — a card's own Submit has no composer to fall through to. The regression test pins the refusal path specifically: it fails against the previous `return`, which is the shape that stranded the reporter. This does not remove the need to retire a dead card server-side (no `ask_user_resolved` counterpart is ever emitted when a turn dies) — that is the deeper half and is left as follow-up.