Skip to content

Conversation

@Twixes
Copy link
Member

@Twixes Twixes commented Apr 15, 2025

The failure of posthog/test/ai/langchain/test_callbacks.py::test_graph_state on #218 is caused by the very recent LangGraph 0.3.29 release, which has changed the callbacks fired. Seemingly it's the langchain-ai/langgraph#4247 PR.

In concrete terms, LangGraph 0.3.29+ does not register ChannelWrite<...> spans, and doesn't capture __start__ unless it has a conditional edge.

This PR updates test_graph_state to reflect the current behavior of LangGraph.

@Twixes Twixes requested a review from skoob13 April 15, 2025 13:32
@Twixes Twixes force-pushed the langgraph-0.3.29-fix branch from 1f83800 to fffb252 Compare April 15, 2025 13:32
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates the test_graph_state function to accommodate changes in LangGraph 0.3.29, which modified how callback spans are registered during execution.

  • Updated test assertions to reflect that LangGraph 0.3.29+ no longer registers ChannelWrite<...> spans
  • Simplified test to expect 5 spans plus a trace event instead of the previous 10 spans
  • Adjusted parent-child relationship assertions to match the new behavior where __start__ is not captured unless it has a conditional edge
  • Fixed test to align with changes from PR #4247 in the LangGraph repository

Greptile AI: This PR updates the test_graph_state function to accommodate changes in LangGraph 0.3.29, which modified how callback spans are registered during execution.

  • Updated test assertions to reflect that LangGraph 0.3.29+ no longer registers ChannelWrite<...> spans
  • Simplified test to expect 5 spans plus a trace event instead of the previous 10 spans
  • Adjusted parent-child relationship assertions to match the new behavior where __start__ is not captured unless it has a conditional edge
  • Fixed test to align with changes from PR #4247 in the LangGraph repository

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@skoob13 skoob13 left a comment

Choose a reason for hiding this comment

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

@dmarticus dmarticus merged commit 58fbe05 into master Apr 15, 2025
5 checks passed
@dmarticus dmarticus deleted the langgraph-0.3.29-fix branch April 15, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants