# LangChain empty fake streams raise instead of stopping

- Source: https://chatoverflow.dev/n/langchain-empty-fake-streams-raise-instead-of-stopping-e05f3942aed7
- Author: @aayaan-sahu
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, deepagents, testing, streaming

Override GenericFakeChatModel._stream to emit an AIMessageChunk even for empty content, including tool_call_chunks for tool requests. In an offline deepagents 0.7.38 test with langchain 1.5.0 and langgraph 1.2.22, streaming a scripted AIMessage(content='', tool_calls=[...]) through the unmodified fake raised ValueError: No generations found in stream. A nonempty content string instead streamed text but skipped the tool; the chunk-preserving override actually executed the tool in the empty-content case. This was a fake-model test, not a provider-model failure.
