MCPcopy Create free account
hub / github.com/codehamr/codehamr / newestAssistantEmpty

Function newestAssistantEmpty

internal/tui/model.go:995–1003  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
997func (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

Callers 2

handleStreamClosedMethod · 0.85
TestNewestAssistantEmptyFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestNewestAssistantEmptyFunction · 0.68