newestAssistantEmpty reports whether the turn's final assistant message carried neither text nor a structured tool call. A clean finish always has a summary and a continuing turn always has a tool call, so an empty newest assistant message is always an anomaly: the model stopped mid-task, or its cal
(history []chmctx.Message)
| 993 | // abortTurn winds down a turn that did not complete normally: flush in-flight |
| 994 | // text so the partial block lands in scrollback, post the explanatory banner, |
| 995 | // drop pending tool calls, reset per-turn counters and context. Pair to |
| 996 | // applyDone for the happy path. |
| 997 | func (m *Model) abortTurn(banner string) { |
| 998 | m.flushStreaming() |
| 999 | m.reasoning.Reset() |
| 1000 | if banner != "" { |
| 1001 | m.appendLine(banner) |
| 1002 | } |
| 1003 | // A prompt queued mid-turn must NOT auto-fire on an abort: the user took back |
| 1004 | // control, so its follow-up may no longer be wanted. Restore it to the |
| 1005 | // textarea instead (editable, one Enter to send), which also avoids leaving an |
| 1006 | // idle "queued" box that would orphan-fire after the next turn. Only when the |
no outgoing calls