{"record":{"id":"5cf1bb54f31ee609","repo":"langchain-ai/langgraph","slug":"idle-timeout-is-required-when-kind-idle","errorCode":null,"errorMessage":"idle_timeout is required when kind='idle'","messagePattern":"idle_timeout is required when kind='idle'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/errors.py","lineNumber":219,"sourceCode":"    node: str\n    timeout: float\n    run_timeout: float | None\n    idle_timeout: float | None\n    elapsed: float\n    kind: Literal[\"idle\", \"run\"]\n\n    def __init__(\n        self,\n        node: str,\n        elapsed: float,\n        *,\n        kind: Literal[\"idle\", \"run\"],\n        idle_timeout: float | None = None,\n        run_timeout: float | None = None,\n    ) -> None:\n        if kind == \"idle\":\n            if idle_timeout is None:\n                raise ValueError(\"idle_timeout is required when kind='idle'\")\n            message = (\n                f\"Node '{node}' exceeded its idle timeout of \"\n                f\"{idle_timeout:.3f}s without making progress \"\n                f\"(elapsed: {elapsed:.3f}s).\"\n            )\n            self.timeout = idle_timeout\n        elif kind == \"run\":\n            if run_timeout is None:\n                raise ValueError(\"run_timeout is required when kind='run'\")\n            message = (\n                f\"Node '{node}' exceeded its run timeout of \"\n                f\"{run_timeout:.3f}s (elapsed: {elapsed:.3f}s).\"\n            )\n            self.timeout = run_timeout\n        else:\n            raise ValueError(\"kind must be 'idle' or 'run'\")\n        super().__init__(message)\n        self.node = node","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/errors.py#L201-L237","documentation":"Raised by GraphTimeoutError.__init__ when kind='idle' is requested but no idle_timeout was passed. The constructor uses the timeout to build its message, so it validates that the required kind-specific timeout argument is present.","triggerScenarios":"Thrown at libs/langgraph/langgraph/errors.py:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive `idle_timeout` value whenever constructing the error with kind='idle'","Use kind='run' with run_timeout if you meant a total-run timeout","Build the exception via the code path that computes timeouts rather than manually"],"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"}