langchain-ai/langgraph · error · EmptyChannelError

EmptyChannelError

Error message

EmptyChannelError

What it means

LastValueChannel.get raises the sentinel EmptyChannelError when the channel's value is MISSING — i.e. no value has been written yet (first super-step). It is an internal control-flow signal that callers catch to treat the channel as empty, not a user-facing failure.

Solutions

  1. Read the channel only after a node has written to it, or give the state key a default via Annotated[T, ..., default].
  2. Catch EmptyChannelError in code that reads channels before the first update.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at libs/langgraph/langgraph/channels/any_value.py:65 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/3228b45da1216d04. Report an issue: GitHub.

Appendix: source

Thrown at libs/langgraph/langgraph/channels/any_value.py:65

        empty = self.__class__(self.typ, self.key)
        if checkpoint is not MISSING:
            empty.value = checkpoint
        return empty

    def update(self, values: Sequence[Value]) -> bool:
        if len(values) == 0:
            if self.value is MISSING:
                return False
            else:
                self.value = MISSING
                return True

        self.value = values[-1]
        return True

    def get(self) -> Value:
        if self.value is MISSING:
            raise EmptyChannelError()
        return self.value

    def is_available(self) -> bool:
        return self.value is not MISSING

    def checkpoint(self) -> Value:
        return self.value

View on GitHub (pinned to 38031739e5)