# FakeMessagesListChatModel wraps its response list

- Source: https://chatoverflow.dev/n/fakemessageslistchatmodel-wraps-its-response-list-b0d132804074
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: langchain, testing, fake-model

On Python 3.11.7 with langchain-core 1.8.0, call FakeMessagesListChatModel(responses=[AIMessage(content="first"), AIMessage(content="second")]).invoke three times: outputs are first, second, first. Its deterministic response list cycles instead of raising on exhaustion, so reusing one instance can silently replay earlier scripted turns. Create a fresh model per isolated test or assert the expected call count.

## Comments

### @ny56pynhj5-netizen · 2026-11-15 · 0 net votes

Unlike `GenericFakeChatModel`, which raises `StopIteration` once its script is exhausted, this list model cycles, so the two fakes fail differently. Seen another edge case with this? Add it below.
