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

Function drainFinal

internal/tui/tui_test.go:3337–3342  ·  view source on GitHub ↗

drainFinal submits a prompt and pumps the whole turn to completion, returning the settled model. Centralises the submit+drain dance the empty-reply tests share.

(t *testing.T, m Model, prompt string)

Source from the content-addressed store, hash-verified

3335}
3336
3337// TestEmptyReplyNudgeReArmsAfterProgress pins the galaxy1 fix: once an empty
3338// reply has nudged this turn, a round that issues a real tool call is genuine
3339// progress and must re-arm the latch, so a LATER transient empty on the same
3340// long turn earns its own re-prompt instead of hitting the leak-and-die branch.
3341// A flaky stream that drops the occasional call must not abandon a half-built
3342// file. Two CONSECUTIVE empties (no tool call between) still terminate: that
3343// path has pending=0 and so never reaches the re-arm.
3344func TestEmptyReplyNudgeReArmsAfterProgress(t *testing.T) {
3345 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})

Calls 2

drainFunction · 0.85
submitMethod · 0.80

Tested by

no test coverage detected