dify/api/core/app/apps/agent_chat
Yansong Zhang 96374d7f6a refactor(api): replace legacy agent runners with StrategyFactory in AgentChatAppRunner (Phase 4)
Replace the hardcoded FunctionCallAgentRunner / CotChatAgentRunner /
CotCompletionAgentRunner selection in AgentChatAppRunner with the new
AgentAppRunner class that uses StrategyFactory from Phase 1.

Before: AgentChatAppRunner manually selects FC/CoT runner class based on
model features and LLM mode, then instantiates it directly.

After: AgentChatAppRunner instantiates AgentAppRunner (from sandbox branch),
which internally uses StrategyFactory.create_strategy() to auto-select
the right strategy, and uses ToolInvokeHook for proper agent_invoke
with file handling and thought persistence.

This unifies the agent execution engine: both the new Agent V2 workflow
node and the legacy agent-chat app now use the same StrategyFactory
and AgentPattern implementations.

Also fix: command and file_upload nodes use string node_type instead of
BuiltinNodeTypes.COMMAND/FILE_UPLOAD (not in current graphon version).

46 tests pass. Flask starts successfully.

Made-with: Cursor
2026-04-09 09:42:23 +08:00
..
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
app_config_manager.py refactor(api): add TypedDict definitions to models/model.py (#32925) 2026-03-06 08:42:54 +09:00
app_generator.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
app_runner.py refactor(api): replace legacy agent runners with StrategyFactory in AgentChatAppRunner (Phase 4) 2026-04-09 09:42:23 +08:00
generate_response_converter.py test: unit test cases for core.app.apps module (#32482) 2026-03-12 11:23:25 +08:00