langchain-ai/langgraph · error · ValueError

extension name must be non-empty.

Error message

extension name must be non-empty.

What it means

Constructor guard on ExtensionsDecoder: the decoder filters 'custom' events by comparing data["name"] to the given extension name, so an empty string would never match any event and the subscription would silently produce nothing. The empty name is rejected immediately.

Solutions

  1. Pass the non-empty extension name you subscribed to, matching the name used when the custom stream was opened
  2. Check for empty/None extension names upstream before constructing the decoder
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/sdk-py/langgraph_sdk/stream/decoders.py:347 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/62c833a5f8c3e49d. Report an issue: GitHub.

Appendix: source

Thrown at libs/sdk-py/langgraph_sdk/stream/decoders.py:347

            status, error = _terminal_from_tasks_result(data)
            handle._finish(status, error)
            del self._active[child_path]


class ExtensionsDecoder:
    """Yields `params.data` from one named custom channel.

    Mirrors `_ExtensionProjection._iter` (`_async/stream.py:1278-1299`), with
    an added name filter so it can share one subscription in interleave.

    Args:
        name: The extension name. Only `custom` events whose `data["name"]`
            matches are consumed.
    """

    def __init__(self, name: str):
        if not name:
            raise ValueError("extension name must be non-empty.")
        self._name = name

    def feed(self, event: Mapping[str, Any]) -> Iterable[Any]:
        if event.get("method") != "custom":
            return
        params = event.get("params") or {}
        data = params.get("data")
        if not isinstance(data, dict):
            return
        if data.get("name") != self._name:
            return
        yield data

View on GitHub (pinned to 38031739e5)