Error2 reports
Fix FakeListChatModelError
in LangChain
✅ Solution
The "FakeListChatModelError" often arises in testing when the mock chat model's output is unexpectedly nested within a list (e.g., `[[]]`) instead of directly being a list of messages or an empty list (`[]`). To fix this, ensure your `FakeListChatModel` or similar mock returns the expected structure; usually, this means flattening nested lists or returning `[]` explicitly when no messages should be streamed. Verify the return value from the mock chat model aligns with the expected data structure in the test case.
Related Issues
Real GitHub issues where developers encountered this error:
Timeline
First reported:Apr 18, 2026
Last reported:Apr 18, 2026