Skip to content

πŸ› Bug: The context passed from useCopilotReadable to LangGraph is getting lost at the graph node.Β #2769

Description

@WDDWDDWDD

♻️ Reproduction Steps

  1. Frontend code
Image

2.Agent code

Image Image

The printed state.copilotkit.context data is empty.

Image

...

βœ… Expected Behavior

The context data cannot be accessed by the model, so the model is unable to understand the page state. I expect the model to be able to receive and use the context data.

❌ Actual Behavior

From what I can see, there seems to be an issue in the langgraph_default_merge_state code β€” the merged context is being overwritten.

Image

It should be changed to:

return {
**merged_state,
'copilotkit': {
**merged_state.get('copilotkit', {}),
'actions': tools_in_state,
},
}

𝌚 CopilotKit Version

[[package]]
name = "copilotkit"
version = "0.1.60"
description = "CopilotKit python SDK"
optional = false
python-versions = "<3.13,>=3.10"
groups = ["main"]
files = [
    {file = "copilotkit-0.1.60-py3-none-any.whl", hash = "sha256:8418723aedec72a14dbccd95a974e1d07059153a14f06030ca9e4830e3acbf39"},
    {file = "copilotkit-0.1.60.tar.gz", hash = "sha256:1296b9a369a7d44db8497700e356e92385e3c9a40ab7bf3dea5f7dbd0365ae4f"},
]

πŸ“„ Logs (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions