refactor(agent): 按需加载 Agent 运行时 (#6336)

This commit is contained in:
InfinityPacer
2026-08-16 19:25:24 +08:00
committed by GitHub
parent e5f0c53069
commit 5b367011c5
56 changed files with 5059 additions and 628 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ from app.agent.callback import StreamingHandler
from app.agent.middleware.subagents import is_subagent_stream_metadata
from app.agent.tools.base import MoviePilotTool
from app.agent.tools.impl.send_voice_message import SendVoiceMessageTool
from app.api.endpoints.openai import _OpenAIStreamingHandler
from app.api.endpoints.openai import _get_openai_streaming_handler_type
from app.runtime.config import settings
from app.schemas.message import MessageResponse
from app.schemas.types import MessageChannel, NotificationType
@@ -321,7 +321,7 @@ class TestAgentToolStreaming:
def test_openai_streaming_handler_flushes_pending_summary_to_queue(self):
"""校验 OpenAI 流式处理器将待发送摘要推入队列。"""
async def _run():
handler = _OpenAIStreamingHandler()
handler = _get_openai_streaming_handler_type()()
queue: asyncio.Queue = asyncio.Queue()
handler.bind_queue(queue)
await handler.start_streaming()