{"record":{"id":"d2ae02935d41a50a","repo":"langchain-ai/langgraph","slug":"cannot-write-to-the-reserved-channel-tasks","errorCode":null,"errorMessage":"Cannot write to the reserved channel TASKS","messagePattern":"Cannot write to the reserved channel TASKS","errorType":"exception","errorClass":"InvalidUpdateError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/pregel/_write.py","lineNumber":115,"sourceCode":"            for write in self.writes\n        ]\n        self.do_write(\n            config,\n            writes,\n        )\n        return input\n\n    @staticmethod\n    def do_write(\n        config: RunnableConfig,\n        writes: Sequence[ChannelWriteEntry | ChannelWriteTupleEntry | Send],\n        allow_passthrough: bool = True,\n    ) -> None:\n        # validate\n        for w in writes:\n            if isinstance(w, ChannelWriteEntry):\n                if w.channel == TASKS:\n                    raise InvalidUpdateError(\n                        \"Cannot write to the reserved channel TASKS\"\n                    )\n                if w.value is PASSTHROUGH and not allow_passthrough:\n                    raise InvalidUpdateError(\"PASSTHROUGH value must be replaced\")\n            if isinstance(w, ChannelWriteTupleEntry):\n                if w.value is PASSTHROUGH and not allow_passthrough:\n                    raise InvalidUpdateError(\"PASSTHROUGH value must be replaced\")\n        # if we want to persist writes found before hitting a ParentCommand\n        # can move this to a finally block\n        write: TYPE_SEND = config[CONF][CONFIG_KEY_SEND]\n        write(_assemble_writes(writes))\n\n    @staticmethod\n    def is_writer(runnable: Runnable) -> bool:\n        \"\"\"Used by PregelNode to distinguish between writers and other runnables.\"\"\"\n        return (\n            isinstance(runnable, ChannelWrite)\n            or getattr(runnable, \"_is_channel_writer\", MISSING) is not MISSING","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/pregel/_write.py#L97-L133","documentation":"Error \"Cannot write to the reserved channel TASKS\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/pregel/_write.py:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}