Repository navigation
feat(tunnel): support explicit LangGraph StateGraph tools - #123
Closed
hunter-xue wants to merge 2 commits into
Closed
hunter-xue wants to merge 2 commits into
hunter-xue wants to merge 2 commits into
Conversation
Contributor
Author
|
补充上传设计文档 langgraph中提供了3种agent抽象:
当前设计中,只计划支持state graph和create agent / create react agent两种,deep agent注入外部自定义mcp比较“拧巴”,大概率会涉及到对langgraph自身代码的修改和定制,因此短期内不会支持deep agent。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更摘要
在保留现有 Google ADK 自动注入路径、Connector 通信协议和凭证分层的基础上,为自定义 LangGraph
StateGraph增加显式 MCP Tunnel 接入能力。LangGraphTunnelTools,合并业务工具与当前在线的 Tunnel 工具,提供稳定的server__tool命名空间、基于原始 MCP 名称的tool_filter、最终重名检查以及逐 server 发现故障隔离。TunnelRegistry,不修改用户的 compiled graph,也不修改上游 LangGraph 代码。invoke、legacy stream、canonical stream、取消和交错 App 执行,避免ContextVar状态跨越公开yield泄漏。langgraphextra 中加入langchain-mcp-adapters>=0.3.2,同步 Code/Container/Deploy 依赖路径和公开导出清单。agent.py、现有图迁移指南、Runtime/Connector 配置边界和 MCP 清理日志说明。tunnel-e2e示例,同时保留 ADK 与 LangGraph 两条路径,拆分 Agent/Connector 环境文件,并补充真实云端部署顺序。支持范围与兼容性
StateGraph在模型节点和ToolNode执行节点中显式获取当前工具,包括通过ksadk_graph_factory重建图。create_agent、DeepAgents、旧式create_react_agent,以及不修改代码就向任意 compiled graph 自动注入工具。structuredContent,也不承诺对包含未完成 Tunnel ToolCall 的执行进行冷恢复。验证结果
StateGraph的工具发现和调用已通过,覆盖直接invoke、legacy stream、canonical stream 及断连移除。twine check通过。LangGraphTunnelTools和langchain-mcp-adapters==0.3.2可正常导入。uv lock --check和git diff --check均通过。尚未验证及既有问题
langgraph_runner.py当前为 1429 行,而记录的 legacy 上限为 1415 行;本 PR 未修改该文件。dirty-public-export-source,未发现其他公开内容违规。