chore(agent): raise core LangChain dependency baseline (#6301)

This commit is contained in:
InfinityPacer
2026-08-13 17:59:14 +08:00
committed by GitHub
parent 8dc6774d47
commit dc9f8ef168
3 changed files with 22 additions and 13 deletions

View File

@@ -77,8 +77,8 @@ pympler~=1.1
smbprotocol~=1.16.1
setproctitle~=1.3.7
httpx[socks,http2]~=0.28.1
langchain~=1.3.9
langchain-core~=1.4.7
langchain~=1.3.15
langchain-core~=1.5.4
langchain-community~=0.4.2
langchain-anthropic~=1.4.6
langchain-aws~=1.6.2
@@ -86,7 +86,8 @@ boto3~=1.42.42
langchain-openai~=1.3.2
langchain-google-genai~=4.2.5
langchain-deepseek~=1.1.0
langgraph~=1.2.5
langgraph~=1.2.11
langgraph-checkpoint~=4.2.0
anthropic~=0.109.1
openai~=2.41.1
google-genai~=2.8.0

View File

@@ -42,6 +42,18 @@ class _EchoInput(BaseModel):
query: str = Field(description="待回显文本")
class _AgentFactoryLLM:
"""满足 Agent 构建与摘要中间件所需合同的测试模型。"""
_llm_type = "openai-chat"
model = "fake"
profile = {"max_input_tokens": 64000}
def with_retry(self):
"""返回可供摘要中间件调用的 Runnable。"""
return self
class _EchoTool(MoviePilotTool):
"""返回输入文本的测试工具。"""
@@ -769,11 +781,7 @@ def test_agent_middleware_secret_setting_result_stays_out_of_receipt_logs() -> N
def test_main_agent_registers_policy_middleware_as_outermost() -> None:
"""主 Agent 必须把宿主策略中间件放在 middleware 链最外层。"""
agent = agent_module.MoviePilotAgent(session_id="session-1", user_id="user-1")
fake_llm = SimpleNamespace(
_llm_type="openai-chat",
model="fake",
profile={"max_input_tokens": 64000},
)
fake_llm = _AgentFactoryLLM()
captured = {}
def _fake_create_agent(**kwargs):
@@ -801,11 +809,7 @@ def test_main_agent_preserves_activity_log_middleware_order() -> None:
channel=MessageChannel.WebAgent.value,
source="web-agent",
)
fake_llm = SimpleNamespace(
_llm_type="openai-chat",
model="fake",
profile={"max_input_tokens": 64000},
)
fake_llm = _AgentFactoryLLM()
captured = {}
def _fake_create_agent(**kwargs):

View File

@@ -394,6 +394,10 @@ class LlmHelperTestCallTest(unittest.TestCase):
self.model = kwargs["model"]
self.profile = {"tool_calling": True}
def with_retry(self):
"""满足 LangChain 摘要模型的 Runnable 合同。"""
return self
with patch.dict(
sys.modules,
{"langchain_openai": SimpleNamespace(ChatOpenAI=_FakeChatOpenAI)},