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)
| 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. |
| 2017 | func 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() |
nothing calls this directly
no test coverage detected