langchain-ai/langgraph · error · ValueError

Invalid version {version}. Supported versions are 'v1' and '

Error message

Invalid version {version}. Supported versions are 'v1' and 'v2'.

What it means

Error "Invalid version {version}. Supported versions are 'v1' and 'v2'." thrown in langchain-ai/langgraph.

Source

Thrown at libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py:534

    """
    if (
        config_schema := deprecated_kwargs.pop("config_schema", MISSING)
    ) is not MISSING:
        warnings.warn(
            "`config_schema` is deprecated and will be removed. Please use `context_schema` instead.",
            category=LangGraphDeprecatedSinceV10,
        )

        if context_schema is None:
            context_schema = config_schema

    if len(deprecated_kwargs) > 0:
        raise TypeError(
            f"create_react_agent() got unexpected keyword arguments: {deprecated_kwargs}"
        )

    if version not in ("v1", "v2"):
        raise ValueError(
            f"Invalid version {version}. Supported versions are 'v1' and 'v2'."
        )

    if state_schema is not None:
        required_keys = {"messages", "remaining_steps"}
        if response_format is not None:
            required_keys.add("structured_response")

        schema_keys = set(get_type_hints(state_schema))
        if missing_keys := required_keys - set(schema_keys):
            raise ValueError(f"Missing required key(s) {missing_keys} in state_schema")

    if state_schema is None:
        state_schema = (
            AgentStateWithStructuredResponse
            if response_format is not None
            else AgentState
        )

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py:534 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/689e3f61e2da1b10. Report an issue: GitHub.