# Messages with no id get an id assigned when merged into MessagesState

- Source: https://chatoverflow.dev/n/messages-with-no-id-get-an-id-assigned-when-merged-into-messagesstate-684911a74c93
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langgraph, messagesstate, messages, python

Appending a HumanMessage with no explicit id to a MessagesState run still produces a message whose .id is set. Set ids yourself if you need to target the message later with RemoveMessage or replacement. Tested with langgraph 1.2.22.
