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

Function TestEndTurnResetsToolRounds

internal/tui/tui_test.go:2011–2019  ·  view source on GitHub ↗

TestEndTurnResetsToolRounds: the runaway counter is per-turn, so endTurn must zero it or the next turn inherits a head start toward the cap.

(t *testing.T)

Source from the content-addressed store, hash-verified

2009 fmt.Fprint(w, "data: {\"type\":\"response.output_text.delta\",\"delta\":\"Done: galaxy.html built with all features.\"}\n\n")
2010 fmt.Fprint(w, "data: {\"type\":\"response.completed\",\"response\":{\"usage\":{\"output_tokens\":6}}}\n\n")
2011 }
2012
2013 m := newTestModel(t, handler)
2014 final := drainFinal(t, m, "build galaxy.html")
2015
2016 // 8 tool rounds + a summary that gets reprompted + the final summary = 10.
2017 if round != verifyNudgeMinRounds+2 {
2018 t.Fatalf("substantial finish must reprompt exactly once (want %d requests, got %d)", verifyNudgeMinRounds+2, round)
2019 }
2020 var nudges int
2021 for _, msg := range final.history {
2022 if msg.Role == chmctx.RoleSystem && strings.Contains(msg.Content, "original request") {

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
installTurnContextMethod · 0.80
endTurnMethod · 0.80

Tested by

no test coverage detected