Skip to content

Fix/support langgraph 0.5.0 - #2073

Merged
ranst91 merged 9 commits into
mainfrom
fix/support-langgraph-0.5.0
Jun 30, 2025
Merged

ranst91 merged 9 commits into
mainfrom
fix/support-langgraph-0.5.0

Conversation

@ranst91

@ranst91 ranst91 commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Documentation
    • Updated the LangGraphAgent documentation to reflect a new type for the graph property.
  • Chores
    • Upgraded dependency versions for copilotkit, langgraph-cli, langgraph, and langchain in project configuration files.
    • Bumped CopilotKit Python SDK version to 0.1.52.
  • Refactor
    • Updated type annotations in LangGraphAgent to use CompiledStateGraph instead of CompiledGraph.
    • Improved event streaming logic to better handle metadata cases in LangGraphAgent.

@vercel

vercel Bot commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
copilotkit-feature-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 8:12pm
demo-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 8:12pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 8:12pm
examples-coagents-ai-travel-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 8:12pm
examples-coagents-research-canvas-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 8:12pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
examples-coagents-ai-researcher-ui ⬜️ Ignored (Inspect) Visit Preview Jun 30, 2025 8:12pm

@coderabbitai

coderabbitai Bot commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

"""

Walkthrough

The changes update type annotations from CompiledGraph to CompiledStateGraph in the LangGraphAgent class and its documentation. Dependency versions for copilotkit, langgraph-cli[inmem], langgraph, and langchain are also updated in relevant configuration files. No control flow or logic is modified except a refined fallback in event streaming.

Changes

File(s) Change Summary
sdk-python/copilotkit/langgraph_agent.py, docs/content/docs/reference/sdk/python/LangGraphAgent.mdx Replaced all CompiledGraph references with CompiledStateGraph in code and docs; refined _stream_events fallback logic.
sdk-python/pyproject.toml Updated CopilotKit SDK version; expanded version ranges for langgraph and langchain dependencies.
examples/coagents-research-canvas/agent/pyproject.toml, examples/coagents-qa-native/agent/pyproject.toml, examples/coagents-qa-text/agent/pyproject.toml, examples/coagents-routing/agent/pyproject.toml Upgraded dependency versions for copilotkit, langchain, langgraph-cli[inmem], and related packages.

Suggested reviewers

  • mme
  • ataibarkai
    """

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 525ed81 and 96c3985.

⛔ Files ignored due to path filters (1)
  • examples/coagents-research-canvas/agent/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • examples/coagents-research-canvas/agent/pyproject.toml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/coagents-research-canvas/agent/pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Build Images (coagents-qa-text, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-native, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-native, agent, js, local-deps)
  • GitHub Check: Build Images (coagents-qa-text, ui)
  • GitHub Check: Build Images (coagents-qa-native, ui)
  • GitHub Check: Build Images (coagents-routing, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-text, agent, js, local-deps)
  • GitHub Check: Build Images (next-openai, next-openai)
  • GitHub Check: Build Images (coagents-routing, ui)
  • GitHub Check: Build Images (coagents-research-canvas, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-routing, agent, js, local-deps)
  • GitHub Check: Build Images (coagents-research-canvas, ui)
  • GitHub Check: Build Images (coagents-research-canvas, agent, js, local-deps)
  • GitHub Check: Test (18.x)
  • GitHub Check: Test (20.x)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
sdk-python/copilotkit/langgraph_agent.py (1)

238-241: Add a runtime type guard to avoid silent misuse

cast(CompiledStateGraph, graph or agent) suppresses static-type errors but won’t protect at runtime. A tiny assert keeps failures obvious:

- self.graph = cast(CompiledStateGraph, graph or agent)
+ _g = graph or agent
+ if not isinstance(_g, CompiledStateGraph):
+     raise TypeError("graph must be a CompiledStateGraph instance")
+ self.graph = cast(CompiledStateGraph, _g)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de2a8c7 and f554b54.

⛔ Files ignored due to path filters (1)
  • examples/coagents-research-canvas/agent/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • docs/content/docs/reference/sdk/python/LangGraphAgent.mdx (1 hunks)
  • examples/coagents-research-canvas/agent/pyproject.toml (4 hunks)
  • sdk-python/copilotkit/langgraph_agent.py (4 hunks)
  • sdk-python/pyproject.toml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: Build Images (coagents-qa-native, ui)
  • GitHub Check: Build Images (next-openai, next-openai)
  • GitHub Check: Build Images (coagents-qa-native, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-text, ui)
  • GitHub Check: Build Images (coagents-routing, ui)
  • GitHub Check: Build Images (coagents-qa-text, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-research-canvas, ui)
  • GitHub Check: Build Images (coagents-routing, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-research-canvas, agent, python, local-deps)
  • GitHub Check: Test (18.x)
  • GitHub Check: Test (20.x)
🔇 Additional comments (8)
sdk-python/pyproject.toml (2)

3-3: Ensure pre-release version string is PEP-440 compliant

0.1.52-alpha.1 parses as a pre-release, but the dotted suffix (alpha.1) is non-standard. Packaging tools usually expect 0.1.52a1. Please double-check that poetry publish/pip install behave as expected.


14-15: Verify langgraph 0.5.0 with langchain<=0.3.26

langgraph often follows the latest langchain APIs. Limiting langchain to <=0.3.26 could create an incompatibility window if langgraph 0.5.0 already depends on newer interfaces. Run the resolver/tests to confirm there are no import errors.

examples/coagents-research-canvas/agent/pyproject.toml (2)

12-12: Version-scheme mismatch between repo and example

Core SDK is published as 0.1.52-alpha.1 while the example consumes >=0.1.52a1.
Although both resolve to the same pre-release epoch, it is easy to miss during manual upgrades. Consider aligning the notation to avoid confusion.


26-26: langgraph-cli lagging behind core langgraph

SDK moves to langgraph 0.5.0, but the CLI is pinned at ^0.3.3. Make sure CLI 0.3.x remains forward-compatible; if not, bump it in sync with the core library.

Also applies to: 52-52

docs/content/docs/reference/sdk/python/LangGraphAgent.mdx (1)

55-57: Doc update correctly reflects new API

graph type annotation updated to CompiledStateGraph – matches the codebase change. No further action needed.

sdk-python/copilotkit/langgraph_agent.py (3)

6-8: Confirm new import path exists in langgraph 0.5.0

from langgraph.graph.state import CompiledStateGraph assumes the symbol is re-exported from langgraph.graph.state. If the module layout changes again, this will fail at import time. Please run python -c "import langgraph, langgraph.graph.state as s; print(hasattr(s,'CompiledStateGraph'))" after upgrading.


178-182: Docstring parameter change looks correct

Parameter docs now reference CompiledStateGraph. Good catch keeping runtime docs in sync.


190-202: Ensure all call-sites use the new CompiledStateGraph type

Constructor now expects graph: Optional[CompiledStateGraph] (and deprecated agent of same type). A quick repo grep for LangGraphAgent( would help verify that no CompiledGraph instances are still passed.

@changesets-bot-copilotkit

Copy link
Copy Markdown

⏭️ Changeset Not Required

Latest commit: 96c3985

No changes in this PR affected the @copilitkit/* packages. Merging this PR will not cause a version bump for any packages.

Changeset is not required for this PR.

@github-actions

github-actions Bot commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

Preview environments destroyed for this pull request.

@github-actions

github-actions Bot commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

Test Results

Status: ❌ Failed (View Run)

Commit: 8b307f2

Duration: 347.9s

Total Tests: 20

Pass Rate: 95.0%

Failed Tests: 1

❌ Failed Tests

🔍 Detailed Results

coagents-research-canvas

CoAgents Research Canvas (UI) - Local Depenencies

Model Browser Status Video
OpenAI chromium ❌ FAILED Video
Anthropic chromium ✅ PASSED -
CrewAI chromium ✅ PASSED -

coagents-qa-native

CoAgents QA Native (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

coagents-qa-text

CoAgents QA Text (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

coagents-routing

CoAgents Routing (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

next-openai

Next OpenAI - Self Hosted

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
Google Generative AI chromium ✅ PASSED -
LangChain (OpenAI) chromium ✅ PASSED -
LangChain (Anthropic) chromium ✅ PASSED -
LangChain (Gemini) chromium ✅ PASSED -
Groq chromium ✅ PASSED -

This branch was successfully deployed

5 active deployments
Preview – examples-coagents-ai-travel-app — 96c39858 Deployed Jun 30, 2025 by vercel[bot]
Preview – examples-coagents-research-canvas-ui — 96c39858 Deployed Jun 30, 2025 by vercel[bot]
Preview – docs — 96c39858 Deployed Jun 30, 2025 by vercel[bot]
Preview – copilotkit-feature-viewer — 96c39858 Deployed Jun 30, 2025 by vercel[bot]
Preview – demo-viewer — 96c39858 Deployed Jun 30, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant