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 | 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") { |
nothing calls this directly
no test coverage detected