[BUG] `legacy/multi_agent.py` 可以将部分部分完成视为全部研究完成

作者: bossjoker1创建于 2026年6月25日更新于 2026年7月23日

import asyncio import sys import types sys.path.insert(0, "src")

Stub just enough imports to exercise the real supervisor logic without

requiring live models, MCP servers, or external search providers.

LangChain = types.ModuleType("LangChain") chat_models = types.ModuleType("LangChain.chat_models")

class FakeLLM: def init(self): self.captured = None

def bind_tools(self, tools, **kwargs):
    return self

async def ainvoke(self, messages):
    self.captured = messages
    return types.SimpleNamespace(tool_calls=[])

fake_llm = FakeLLM() chat_models.init_chat_model = lambda *args, **kwargs: fake_llm LangChain.chat_models = chat_models sys.modules["LangChain"] = LangChain sys.modules["LangChain.chat_models"] = chat_models

内容来源: langchain-ai/open_deep_research