Migrate from v0.2 to v0.3
How to migrate from v0.2 to v0.3.
What's new in v0.3?
Starting with v0.3, we changed how messages are synced between the agent (LangGraph) and CopilotKit. Essentially, both will now share exactly the same message history.
This means that you need to return the messages you want to appear in CopilotKit chat from your LangGraph nodes, for example:
def my_node(state: State, config: RunnableConfig) -> State:
response = # ... llm call ...
return {
"messages": response,
}All tool messages are now emitted by default, so you don't need to manually call copilotkit_customize_config to configure tool call emissions.

How do I migrate?
-
Make sure to return any messages (tool calls or text messages) you want to be part of the message history from your LangGraph nodes.
-
Optionally, remove manual
copilotkit_customize_configcalls when you want to emit tool calls. -
If you want to hide tool calls or messages from the chat, use
copilotkit_customize_configand setemit_tool_callsoremit_messagestoFalse. Make sure to not return these messages in your nodes so they don't become part of the message history.
