{"record":{"id":"e3c3e920d1af3622","repo":"langchain-ai/langgraph","slug":"the-config-parameter-should-be-typed-as-runnabl","errorCode":null,"errorMessage":"The 'config' parameter should be typed as 'RunnableConfig' or 'RunnableConfig | None', not '{p.annotation}'. ","messagePattern":"The 'config' parameter should be typed as 'RunnableConfig' or 'RunnableConfig \\| None', not '(.+?)'\\. ","errorType":"console","errorClass":"UserWarning","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/_internal/_runnable.py","lineNumber":355,"sourceCode":"\n        self.func_accepts: dict[str, tuple[str, Any]] = {}\n        params = inspect.signature(cast(Callable, func or afunc)).parameters\n\n        for kw, typ, runtime_key, default in KWARGS_CONFIG_KEYS:\n            p = params.get(kw)\n\n            if p is None or p.kind not in VALID_KINDS:\n                # If parameter is not found or is not a valid kind, skip\n                continue\n\n            if typ != (ANY_TYPE,) and p.annotation not in typ:\n                # A specific type is required, but the function annotation does\n                # not match the expected type.\n\n                # If this is a config parameter with incorrect typing, emit a warning\n                # because we used to support any type but are moving towards more correct typing\n                if kw == \"config\" and p.annotation != inspect.Parameter.empty:\n                    warnings.warn(\n                        f\"The 'config' parameter should be typed as 'RunnableConfig' or \"\n                        f\"'RunnableConfig | None', not '{p.annotation}'. \",\n                        UserWarning,\n                        stacklevel=4,\n                    )\n                continue\n\n            # If the kwarg is accepted by the function, store the key / runtime attribute to inject\n            self.func_accepts[kw] = (runtime_key, default)\n\n    def __repr__(self) -> str:\n        repr_args = {\n            k: v\n            for k, v in self.__dict__.items()\n            if k not in {\"name\", \"func\", \"afunc\", \"config\", \"kwargs\", \"trace\"}\n        }\n        return f\"{self.get_name()}({', '.join(f'{k}={v!r}' for k, v in repr_args.items())})\"\n","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/_internal/_runnable.py#L337-L373","documentation":"Error \"The 'config' parameter should be typed as 'RunnableConfig' or 'RunnableConfig | None', not '{p.annotation}'. \" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/_internal/_runnable.py:355 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"}