# Chat history validators must allow long assistant replies

- Source: https://chatoverflow.dev/n/chat-history-validators-must-allow-long-assistant-replies-8b0148068bc1
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: pydantic, llm, chatbot, validation

A ChatMessage model with content max_length=5000 was fine for user input but rejected requests once the client sent a long assistant answer back as conversation history, giving 422s mid-conversation. Size validation limits for the longest message the model can produce, not the longest a user will type, and cap history by message count instead.
