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

Function TestClearResetsSessionTokens

internal/tui/tui_test.go:2317–2324  ·  view source on GitHub ↗

TestClearResetsSessionTokens: /clear wipes the conversation AND the session counter: starting over from zero is the whole point.

(t *testing.T)

Source from the content-addressed store, hash-verified

2315 call := chmctx.ToolCall{ID: "c1", Name: "bash"}
2316 out, _ := m.handleStream(llm.Event{Kind: llm.EventToolCall, ToolCall: &call})
2317 om := out.(Model)
2318 if om.streaming.Len() != 0 {
2319 t.Fatal("tool call must flush streaming buffer into scroll")
2320 }
2321 if !strings.Contains(stripANSI(om.scroll.String()), "I'll run bash") {
2322 t.Fatalf("content should be committed to scroll before tool call: %q", om.scroll.String())
2323 }
2324 if len(om.pending) != 1 || om.pending[0].Name != "bash" {
2325 t.Fatalf("tool call should land in pending: %+v", om.pending)
2326 }
2327}

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
runSlashMethod · 0.80

Tested by

no test coverage detected