langchain-ai/langgraph · error · ValueError
Unrecognized {format=}. Expected one of 'langchain-openai',
Error message
Unrecognized {format=}. Expected one of 'langchain-openai', None. What it means
Error "Unrecognized {format=}. Expected one of 'langchain-openai', None." thrown in langchain-ai/langgraph.
Source
Thrown at libs/langgraph/langgraph/graph/message.py:240
ids_to_remove.add(m.id)
else:
ids_to_remove.discard(m.id)
merged[existing_idx] = m
else:
if isinstance(m, RemoveMessage):
raise ValueError(
f"Attempting to delete a message with an ID that doesn't exist ('{m.id}')"
)
merged_by_id[m.id] = len(merged)
merged.append(m)
merged = [m for m in merged if m.id not in ids_to_remove]
if format == "langchain-openai":
merged = _format_messages(merged)
elif format:
msg = f"Unrecognized {format=}. Expected one of 'langchain-openai', None."
raise ValueError(msg)
else:
pass
return merged
def _messages_delta_reducer(
state: list[AnyMessage], writes: list[list[AnyMessage]]
) -> list[AnyMessage]:
"""**Experimental.** Batch reducer for use with `DeltaChannel`.
Processes all writes in one pass — dedup by ID, `RemoveMessage`
tombstoning — without calling `add_messages`.
This reducer is batching-invariant, as required by `DeltaChannel`:
`reducer(reducer(state, xs), ys) == reducer(state, xs + ys)`.
Raw dict / string / tuple inputs are coerced to typed `BaseMessage`View on GitHub (pinned to 38031739e5)
When it happens
Trigger: Thrown at libs/langgraph/langgraph/graph/message.py:240 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/7e38f1757924c0d4.
Report an issue: GitHub.