{"record":{"id":"1f9fd09548a59f9e","repo":"langchain-ai/langgraph","slug":"got-unexpected-type-for-prompt-type","errorCode":null,"errorMessage":"Got unexpected type for `prompt`: {type}","messagePattern":"Got unexpected type for `prompt`: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py","lineNumber":168,"sourceCode":"        prompt_runnable = RunnableCallable(\n            lambda state: [prompt] + _get_state_value(state, \"messages\"),\n            name=PROMPT_RUNNABLE_NAME,\n        )\n    elif inspect.iscoroutinefunction(prompt):\n        prompt_runnable = RunnableCallable(\n            None,\n            prompt,\n            name=PROMPT_RUNNABLE_NAME,\n        )\n    elif callable(prompt):\n        prompt_runnable = RunnableCallable(\n            prompt,\n            name=PROMPT_RUNNABLE_NAME,\n        )\n    elif isinstance(prompt, Runnable):\n        prompt_runnable = prompt\n    else:\n        raise ValueError(f\"Got unexpected type for `prompt`: {type(prompt)}\")\n\n    return prompt_runnable\n\n\ndef _should_bind_tools(\n    model: LanguageModelLike, tools: Sequence[BaseTool], num_builtin: int = 0\n) -> bool:\n    if isinstance(model, RunnableSequence):\n        model = next(\n            (\n                step\n                for step in model.steps\n                if isinstance(step, (RunnableBinding, BaseChatModel))\n            ),\n            model,\n        )\n\n    if not isinstance(model, RunnableBinding):","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py#L150-L186","documentation":"Error \"Got unexpected type for `prompt`: {type}\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py:168 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"}