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

Function TestEndTurnResetsVerifyNudged

internal/tui/tui_test.go:2220–2228  ·  view source on GitHub ↗

TestEndTurnResetsVerifyNudged: the latch is per-turn, so endTurn must clear it or a later turn never re-grounds.

(t *testing.T)

Source from the content-addressed store, hash-verified

2218 fmt.Fprint(w, "data: {\"choices\":[{\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"completion_tokens\":6}}\n\n")
2219 fmt.Fprint(w, "data: [DONE]\n\n")
2220 }
2221
2222 m := newTestModel(t, handler)
2223 final := drainFinal(t, m, "build galaxy.html")
2224
2225 // 8 tool rounds + a summary that gets re-prompted + the final summary = 10.
2226 if round != verifyNudgeMinRounds+2 {
2227 t.Fatalf("substantial finish must re-prompt exactly once (want %d requests, got %d)", verifyNudgeMinRounds+2, round)
2228 }
2229 var nudges int
2230 for _, msg := range final.history {
2231 if msg.Role == chmctx.RoleSystem && strings.Contains(msg.Content, "acceptance criteria") {

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
installTurnContextMethod · 0.80
endTurnMethod · 0.80

Tested by

no test coverage detected