{"record":{"id":"7d254958c485e842","repo":"langchain-ai/langgraph","slug":"managed-value-key-already-exists-with-a-differ","errorCode":null,"errorMessage":"Managed value '{key}' already exists with a different type","messagePattern":"Managed value '(.+?)' already exists with a different type","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/graph/state.py","lineNumber":369,"sourceCode":"                    f\"Invalid managed channels detected in {schema_name}: {names}.\"\n                    \" Managed channels are not permitted in Input/Output schema.\"\n                )\n            self.schemas[schema] = {**channels, **managed}\n            for key, channel in channels.items():\n                if key in self.channels:\n                    if self.channels[key] != channel:\n                        if isinstance(channel, LastValue):\n                            pass\n                        else:\n                            raise ValueError(\n                                f\"Channel '{key}' already exists with a different type\"\n                            )\n                else:\n                    self.channels[key] = channel\n            for key, managed in managed.items():\n                if key in self.managed:\n                    if self.managed[key] != managed:\n                        raise ValueError(\n                            f\"Managed value '{key}' already exists with a different type\"\n                        )\n                else:\n                    self.managed[key] = managed\n\n    @overload\n    def add_node(\n        self,\n        node: StateNode[NodeInputT, ContextT],\n        *,\n        defer: bool = False,\n        metadata: dict[str, Any] | None = None,\n        input_schema: None = None,\n        retry_policy: RetryPolicy | Sequence[RetryPolicy] | None = None,\n        cache_policy: CachePolicy | None = None,\n        error_handler: StateNode[Any, ContextT] | None = None,\n        destinations: dict[str, str] | tuple[str, ...] | None = None,\n        timeout: float | timedelta | TimeoutPolicy | None = None,","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/graph/state.py#L351-L387","documentation":"Raised during schema analysis of a StateGraph when a key exists both as a regular channel and as a managed value with a conflicting type (the non-LastValue case). Two competing definitions of the same state key cannot be reconciled, so the schema is rejected. Remove the duplicate key or align its types across channels and managed values.","triggerScenarios":"Thrown at libs/langgraph/langgraph/graph/state.py:369 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the same managed value type for the key in every schema","Remove the duplicate managed declaration from one schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}