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 }
2010}
2011
2012// TestRunawayNudgeFiresWhenCounterSkipsCap: a multi-tool-call round increments
2013// toolRounds per call but the nudge is consulted only when the pending queue
2014// drains, so the counter can jump from below maxToolRounds to above it without
2015// ever landing on it. The latch (not a bare equality test) must still fire the
2016// nudge exactly once when the cap is overshot.
2017func TestRunawayNudgeFiresWhenCounterSkipsCap(t *testing.T) {
2018 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2019
2020 // Counter overshoots the cap without ever equaling it (the multi-call jump).
2021 m.toolRounds = maxToolRounds + 3
2022 m.maybeRunawayNudge()

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
installTurnContextMethod · 0.80
endTurnMethod · 0.80

Tested by

no test coverage detected