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

Function TestVerifyNudgeYieldsToEmptyReply

internal/tui/tui_test.go:2124–2142  ·  view source on GitHub ↗

TestVerifyNudgeYieldsToEmptyReply: an empty newest assistant message is the empty-reply nudge's domain even on a substantial turn: the verify nudge must not pre-empt it (its note re-grounds a summary that doesn't exist).

(t *testing.T)

Source from the content-addressed store, hash-verified

2122// the gate) must finish normally (finalized, no re-prompt, no system note) so
2123// quick answers and one-line edits aren't nagged.
2124func TestVerifyNudgeSkipsTrivialTurn(t *testing.T) {
2125 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2126 m.installTurnContext()
2127 m.phase = phaseStreaming
2128 m.toolRounds = verifyNudgeMinRounds - 1
2129 m.history = []chmctx.Message{
2130 {Role: chmctx.RoleUser, Content: "what does this function do?"},
2131 {Role: chmctx.RoleAssistant, Content: "It hashes the input."},
2132 }
2133 out, cmd := m.handleStreamClosed()
2134 mm := out.(Model)
2135 if cmd != nil {
2136 t.Fatal("a trivial turn must finish, not re-prompt")
2137 }
2138 if mm.phase != phaseIdle {
2139 t.Fatalf("a finished turn must be idle, got %v", mm.phase)
2140 }
2141 if n := countSystem(mm.history); n != 0 {
2142 t.Fatalf("a trivial turn must not be re-grounded, got %d system notes", n)
2143 }
2144}
2145

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
installTurnContextMethod · 0.80
handleStreamClosedMethod · 0.80

Tested by

no test coverage detected