(t *testing.T)
| 187 | } |
| 188 | |
| 189 | func TestCache_DisabledHasNoEffect(t *testing.T) { |
| 190 | t.Parallel() |
| 191 | |
| 192 | stream1 := newStreamBuilder().AddContent("first").AddStopWithUsage(5, 3).Build() |
| 193 | stream2 := newStreamBuilder().AddContent("second").AddStopWithUsage(5, 3).Build() |
| 194 | |
| 195 | prov := &messageRecordingProvider{ |
| 196 | id: "test/mock-model", |
| 197 | streams: []*mockStream{stream1, stream2}, |
| 198 | } |
| 199 | |
| 200 | sess1 := session.New(session.WithUserMessage("Same question")) |
| 201 | runWithCache(t, nil, prov, sess1) |
| 202 | sess2 := session.New(session.WithUserMessage("Same question")) |
| 203 | runWithCache(t, nil, prov, sess2) |
| 204 | |
| 205 | prov.mu.Lock() |
| 206 | defer prov.mu.Unlock() |
| 207 | assert.Len(t, prov.recordedMessages, 2, "without a cache, every turn must hit the model") |
| 208 | } |
| 209 | |
| 210 | // TestCache_EmptyResponseIsNotCached documents that the cache_response |
| 211 | // stop-hook deliberately drops empty (whitespace-only) assistant |
nothing calls this directly
no test coverage detected