{"record":{"id":"9ea03ce03295aa50","repo":"langchain-ai/langgraph","slug":"refresh-on-must-be-auto-or-heartbeat","errorCode":null,"errorMessage":"refresh_on must be 'auto' or 'heartbeat'","messagePattern":"refresh_on must be 'auto' or 'heartbeat'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/types.py","lineNumber":505,"sourceCode":"        \"\"\"Normalize a timeout value to positive-second policy fields.\"\"\"\n        if value is None:\n            return None\n        if isinstance(value, TimeoutPolicy):\n            # Fast path: a policy already produced by coerce() has float\n            # timeouts and a validated refresh_on, so we can return it as-is.\n            # `frozen=True` makes this safe to share.\n            rt, it = value.run_timeout, value.idle_timeout\n            if (\n                value.refresh_on in (\"auto\", \"heartbeat\")\n                and (rt is None or (type(rt) is float and rt > 0))\n                and (it is None or (type(it) is float and it > 0))\n                and (rt is not None or it is not None)\n            ):\n                return value\n        else:\n            value = cls(run_timeout=value)\n        if value.refresh_on not in (\"auto\", \"heartbeat\"):\n            raise ValueError(\"refresh_on must be 'auto' or 'heartbeat'\")\n        run_timeout = _coerce_timeout_seconds(value.run_timeout, field=\"run_timeout\")\n        idle_timeout = _coerce_timeout_seconds(value.idle_timeout, field=\"idle_timeout\")\n        if run_timeout is None and idle_timeout is None:\n            return None\n        return cls(\n            run_timeout=run_timeout,\n            idle_timeout=idle_timeout,\n            refresh_on=value.refresh_on,\n        )\n\n\nKeyFuncT = TypeVar(\"KeyFuncT\", bound=Callable[..., str | bytes])\n\n\n@dataclass(**_DC_KWARGS)\nclass CachePolicy(Generic[KeyFuncT]):\n    \"\"\"Configuration for caching nodes.\"\"\"\n","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/types.py#L487-L523","documentation":"Error \"refresh_on must be 'auto' or 'heartbeat'\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/types.py:505 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"}