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

Function TestClearResetsFailureStreak

internal/tui/tui_test.go:1935–1945  ·  view source on GitHub ↗

TestClearResetsFailureStreak: /clear starts the conversation over, including the repeated-failure backstop's counters.

(t *testing.T)

Source from the content-addressed store, hash-verified

1933 }
1934 }
1935 if final.failStreak != 1 {
1936 t.Fatalf("after distinct-target failures the streak should sit at 1, got %d", final.failStreak)
1937 }
1938}
1939
1940// TestSubmitResetsFailureStreak: a fresh user submission is a new goal, so a
1941// stale streak from the previous goal must not carry over and trip the nudge
1942// early. submit's non-slash path zeroes failKey/failStreak.
1943func TestSubmitResetsFailureStreak(t *testing.T) {
1944 m := newTestModel(t, func(w http.ResponseWriter, _ *http.Request) {
1945 fmt.Fprint(w, "data: "+`{"choices":[{"delta":{"content":"ok"}}]}`+"\n\n")
1946 fmt.Fprint(w, "data: [DONE]\n\n")
1947 })
1948 m.failKey = tools.BashName + "|make build"

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
runSlashMethod · 0.80

Tested by

no test coverage detected