fix(langgraph): keep tool calls after text chunks#1829
fix(langgraph): keep tool calls after text chunks#1829ranst91 merged 5 commits intoag-ui-protocol:mainag-ui-protocol/ag-ui:mainfrom he-yufeng:fix/langgraph-text-tool-transition-1678he-yufeng/ag-ui:fix/langgraph-text-tool-transition-1678Copy head branch name to clipboard
Conversation
|
@he-yufeng is attempting to deploy a commit to the CopilotKit Team on Vercel. A member of the Team first needs to authorize it. |
ranst91
left a comment
There was a problem hiding this comment.
Thanks for the contribution! A couple things:
-
A chunk carrying both trailing text content and a tool call would have its text delta dropped.
is_message_content_eventisFalsewhenevertool_call_datais set, so this block treats the chunk purely as the tool-call boundary and the chunk'scontentnever gets emitted asTEXT_MESSAGE_CONTENT. If some provider emits final text + tool call in a single chunk, that text is lost. If that case doesn't occur in practice, fine, just worth confirming. -
The regression asserts ordering and the tool start/args/end, but not that the preceding
TEXT_MESSAGE_START/CONTENTwere emitted for the text message. Adding that would lock the full transition shape.
|
Updated, thanks.
Validated locally against the updated branch: The remaining red Vercel status is still the CopilotKit team authorization gate. |
Python Preview PackagesVersion
Install with uvAdd the TestPyPI index to your [[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
explicit = trueThen install the packages you need: # Core SDK
uv add 'ag-ui-protocol==0.0.0.dev1780592254' --index testpypi
# Integrations (each already depends on the matching ag-ui-protocol preview)
uv add 'ag-ui-langgraph==0.0.0.dev1780592254' --index testpypi
uv add 'ag-ui-crewai==0.0.0.dev1780592254' --index testpypi
# NOTE: ag-ui-agent-spec depends on pyagentspec (git-only, not on PyPI).
# You will need to install pyagentspec separately from its git repo.
uv add 'ag-ui-agent-spec==0.0.0.dev1780592254' --index testpypi
uv add 'ag_ui_adk==0.0.0.dev1780592254' --index testpypi
uv add 'ag_ui_strands==0.0.0.dev1780592254' --index testpypiInstall with pippip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
ag-ui-protocol==0.0.0.dev1780592254
Commit: 9f4af0c |
@ag-ui/a2a-middleware
@ag-ui/a2ui-middleware
@ag-ui/event-throttle-middleware
@ag-ui/mcp-apps-middleware
@ag-ui/mcp-middleware
@ag-ui/middleware-starter
@ag-ui/a2a
@ag-ui/adk
@ag-ui/ag2
@ag-ui/agno
@ag-ui/aws-strands
@ag-ui/claude-agent-sdk
@ag-ui/crewai
@ag-ui/langchain
@ag-ui/langgraph
@ag-ui/langroid
@ag-ui/llamaindex
@ag-ui/mastra
@ag-ui/pydantic-ai
@ag-ui/server-starter
@ag-ui/server-starter-all-features
@ag-ui/vercel-ai-sdk
@ag-ui/watsonx
@ag-ui/a2ui-toolkit
create-ag-ui-app
@ag-ui/client
@ag-ui/core
@ag-ui/encoder
@ag-ui/proto
commit: |
|
Thanks for your contribution @he-yufeng! 🚢 |
Summary
Fixes #1678
To verify
.\.venv\Scripts\python.exe -m py_compile ag_ui_langgraph\agent.py tests\test_nested_tool_end_dedup.py.\.venv\Scripts\python.exe -m pytest tests\test_nested_tool_end_dedup.py -q.\.venv\Scripts\python.exe -m pytest -q