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

Function TestVerifyNudgeSkipsHonestUnverifiedFinish

internal/tui/tui_test.go:2150–2173  ·  view source on GitHub ↗

TestVerifyNudgeSkipsHonestUnverifiedFinish: a substantial turn whose summary already marks something `unverified` has done the honest self-assessment the nudge exists to elicit (it is the OPPOSITE of a false green) so it must finish without a re-prompt. Guards the round-5 regression where re-prompti

(t *testing.T)

Source from the content-addressed store, hash-verified

2148// not pre-empt it (its note re-grounds a summary that doesn't exist).
2149func TestVerifyNudgeYieldsToEmptyReply(t *testing.T) {
2150 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2151 m.installTurnContext()
2152 m.phase = phaseStreaming
2153 m.toolRounds = verifyNudgeMinRounds + 10
2154 m.history = []chmctx.Message{
2155 {Role: chmctx.RoleUser, Content: "build it"},
2156 {Role: chmctx.RoleAssistant, Content: ""}, // empty: stopped mid-task
2157 }
2158 out, _ := m.handleStreamClosed()
2159 mm := out.(Model)
2160 if mm.verifyNudged {
2161 t.Fatal("an empty reply belongs to the empty-reply nudge; verify nudge must not fire")
2162 }
2163 last := mm.history[len(mm.history)-1]
2164 if last.Role != chmctx.RoleSystem || !strings.Contains(last.Content, "no reply and no tool call") {
2165 t.Fatalf("expected the empty-reply nudge to own this finish, got %+v", last)
2166 }
2167}
2168
2169// TestVerifyNudgeSkipsHonestUnverifiedFinish: a substantial turn whose summary
2170// already marks something `unverified` has done the honest self-assessment the
2171// nudge exists to elicit (it is the OPPOSITE of a false green) so it must
2172// finish without a re-prompt. Guards the round-5 regression where re-prompting an
2173// honest "unverified: browser runtime" finish produced a confident, caveat-free
2174// "it works" on the next round.
2175func TestVerifyNudgeSkipsHonestUnverifiedFinish(t *testing.T) {
2176 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
countSystemFunction · 0.85
installTurnContextMethod · 0.80
handleStreamClosedMethod · 0.80

Tested by

no test coverage detected