Practical technical guides / Recent development

LangGraph 1.2.25 Assigns Message IDs Before Saving: Stable Stream and Replay IDs

LangGraph 1.2.25, released 1 December 2026, sets message ids before writes are saved. A probe compares streamed, saved and replayed ids with 1.2.24.

By Sandeep Belgavi · Published 2026-12-04 · Prepared 2026-12-03

LangGraph 1.2.25, released 1 December 2026, sets message ids before writes are saved. A probe compares streamed, saved and replayed ids with 1.2.24.

A small release with a visible change

LangGraph 1.2.25 was released on 1 December 2026. Among its changes is pull request 9772, merged on 24 November, titled "give add_messages writes and StateGraph input message ids before they are saved". It changes when a message gets its id, and that changes what applications see in streamed updates, in checkpoint history and after a replay.

The pull request explains the motivation in one line: servers reading checkpoints key messages by id, so messages need ids before saving. Before the change, on channels using the add_messages reducer and for StateGraph input, only the reducer assigned ids. A node that returned a plain role and content dictionary produced an update with no id, the reducer minted one when it applied the write, and a replay, fork or resume applied the saved write again and minted a different one.

If your application keys anything by message id, such as a chat interface that renders messages incrementally, feedback stored against a message, or a downstream store that deduplicates by id, this is worth understanding before and after the upgrade.

Worked example: one return request, two versions

The probe below builds the smallest possible graph: a single node that answers a return request for CASE-4101 at Belgavi's Book Store by returning a plain dictionary, the way many custom nodes do. No model is called. It runs the graph with an in-memory checkpointer, records the message ids in the streamed updates and in the saved state, then replays from the input checkpoint.

from typing import Annotated, TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages
from langgraph.checkpoint.memory import InMemorySaver

class State(TypedDict):
    messages: Annotated[list, add_messages]

def reply(state: State):
    return {"messages": [{"role": "assistant", "content": "Return CASE-4101 accepted"}]}

g = StateGraph(State)
g.add_node("reply", reply)
g.add_edge(START, "reply")
g.add_edge("reply", END)
graph = g.compile(checkpointer=InMemorySaver())
cfg = {"configurable": {"thread_id": "CASE-4101"}}

streamed = []
for chunk in graph.stream({"messages": [{"role": "user", "content": "Return my order"}]},
                          cfg, stream_mode="updates"):
    for update in chunk.values():
        streamed += [m.get("id") if isinstance(m, dict) else m.id for m in update["messages"]]

saved = [m.id for m in graph.get_state(cfg).values["messages"]]
input_checkpoint = list(graph.get_state_history(cfg))[-1]
graph.invoke(None, input_checkpoint.config)
replayed = [m.id for m in graph.get_state(cfg).values["messages"]]

print("streamed reply id equals saved:", streamed[0] == saved[1])
print("user message id kept on replay:", saved[0] == replayed[0])
print("reply id kept on replay:", saved[1] == replayed[1])

Run in two virtual environments with only the LangGraph version changed, the results were:

Observationlanggraph 1.2.24langgraph 1.2.25
Id of the reply in the streamed updatenonea UUID
Streamed reply id equals the saved idnoyes
User message id kept after replay from the input checkpointnoyes
Reply id kept after replay from the input checkpointnono

The first two rows are the fix as described. In 1.2.24, a client consuming updates could not know the id the message would have in saved state, so it could not reconcile the two without matching on content. In 1.2.25 the id is set before the write is saved, and the stream and the checkpoint agree.

The third row is the input side. In 1.2.24 the user's message got its id from the reducer, so replaying from the input checkpoint gave the same user message a new id. In 1.2.25 input messages receive ids by channel and are saved with the input checkpoint, so the replay keeps them.

The fourth row is not a bug, and it is the one most likely to be misread. Replaying from the input checkpoint runs the node again. The node produces a new message, which gets a new id. What 1.2.25 makes stable is the id of a write that was already saved: a resume or fork that re-applies the saved write keeps it. A message that is generated again is a new message, even if its content happens to be identical.

What changes for applications

The pull request lists the observable differences for reviewers, and they are the ones to check in your own code:

  • Message dictionaries in updates, in history and in saved writes gain an "id" key. Tests that compare a node's output to an exact dictionary will fail after the upgrade. The pull request notes that two tests in another LangChain package broke for this reason.
  • Strings, role and content tuples, and JSON pair lists cannot carry an id, so they are converted to message objects before saving. Code that inspected the saved write and expected the original tuple will see a message object instead.
  • An Overwrite write, in any form, keeps its form, and its items get ids.
  • Input is copied and only message fields change. A frozen dataclass input is not re-initialised.

If you key data by message id

The help desk interface at the store attaches staff feedback to agent replies by message id, and the analytics job deduplicates conversation exports by id. With 1.2.24, both had subtle problems: the interface received updates without ids and had to wait for the saved state, and a resumed run could export the same user message twice under different ids.

After upgrading, both can rely on ids from the stream matching saved ids. Two practices remain good regardless of version:

  1. Assign ids yourself where they carry meaning. If a node creates a message that external systems will reference, set the id explicitly when constructing it. Then neither the reducer nor a library upgrade decides it for you.
  2. Treat a re-generated message as new. Feedback attached to a reply belongs to that reply. If a replay produces a new reply, the old feedback does not transfer, and your interface should show the replay as a new branch rather than silently re-pointing feedback.

Why ids before saving is the right place

An id is useful only if every observer sees the same one. In 1.2.24 there were three observers with different views: the stream saw no id, the saved state saw the id the reducer minted, and a replay saw a newly minted id. Any system that joins these views, such as a server that streams updates to a browser and later serves history from checkpoints, had to reconcile them by content or by position, both of which break as soon as two messages look alike or a message is removed.

Assigning the id before the write is saved makes the saved write the single source of the id, and every later view, including replays that re-apply that write, derives it from there. This is the same principle as assigning an idempotency key when a command is created rather than when it is processed: identity is fixed at the moment the thing comes into existence, not each time someone looks at it.

Upgrade steps

  1. Pin langgraph==1.2.25 in a branch and run the test suite. Expect failures in tests that compare exact message dictionaries; update them to ignore or check the id key.
  2. Search for code that reads saved writes or updates and expects tuples or strings. Adapt it to message objects.
  3. If a client deduplicated messages by content because ids were missing from updates, switch it to ids and remove the content matching, which is fragile for repeated replies.
  4. The pull request describes ids being set before new writes are saved. It does not say that writes saved by older versions are rewritten, so test resuming a thread created before the upgrade instead of assuming its ids are stable.
  5. If you use LangGraph JavaScript as well, note that the pull request says the same change is needed there and is tracked separately. Check the JavaScript release notes before assuming parity.

Failure modes

  • Tests that encode the old behaviour. A test asserting that a streamed message has no id, or that a dictionary equals an exact literal, fails for a correct reason.
  • Assuming replays preserve replies. As the probe shows, a replay that re-runs a node produces new messages with new ids.
  • Mixed versions across services. If one service writes checkpoints with 1.2.25 and another reads them with an older client that rebuilds ids, the two can disagree. Upgrade readers and writers together where they share checkpoints.

Verification

The probe above is a complete check: run it against the version you deploy and compare the three printed lines with the table. Add an equivalent test to your own graph, using your real node outputs, that asserts the streamed id equals the saved id. That test documents the behaviour you depend on and fails loudly if a future change alters it.

Primary references: LangGraph pull request 9772 in the langchain-ai/langgraph repository, merged 24 November 2026; the langgraph 1.2.25 release, published 1 December 2026; and issue 9757, which the pull request fixes.

Primary references and authorship

Sources checked 2026-12-03. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/langgraph_message_ids. Views are my own and do not represent any employer, past or present.