dify/api/core/workflow
Yansong Zhang d9d1e9b63a fix(api): resolve Agent V2 node E2E runtime issues
Fixes discovered during end-to-end testing of Agent workflow execution:

1. ModelManager instantiation: use ModelManager.for_tenant() instead of
   ModelManager() which requires a ProviderManager argument
2. Variable template resolution: use VariableTemplateParser(template).format()
   instead of non-existent resolve_template() static method
3. invoke_llm() signature: remove unsupported 'user' keyword argument
4. Event dispatch: remove ModelInvokeCompletedEvent from _run() yield
   (graphon base Node._dispatch doesn't support it via singledispatch)
5. NodeRunResult metadata: use WorkflowNodeExecutionMetadataKey enum keys
   (TOTAL_TOKENS, TOTAL_PRICE, CURRENCY) instead of arbitrary string keys
6. SSE topic mismatch: use AppMode.AGENT (not ADVANCED_CHAT) in
   retrieve_events() so publisher and subscriber share the same channel
7. Celery task routing: add AppMode.AGENT to workflow_execute_task._run_app()
   alongside ADVANCED_CHAT

All issues verified fixed: Agent V2 node successfully invokes LLM and
returns "Hello there!" through the full SSE streaming pipeline.

Made-with: Cursor
2026-04-08 16:21:12 +08:00
..
nodes fix(api): resolve Agent V2 node E2E runtime issues 2026-04-08 16:21:12 +08:00
__init__.py refactor(api): move workflow knowledge nodes and trigger nodes (#33445) 2026-03-15 15:24:59 +08:00
file_reference.py refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
human_input_compat.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
human_input_forms.py refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
node_factory.py feat(api): add Agent V2 node and new Agent app type (Phase 1-3) 2026-04-08 12:31:23 +08:00
node_runtime.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
system_variables.py refactor(api): rename dify_graph to graphon (#34095) 2026-03-25 21:58:56 +08:00
template_rendering.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
variable_pool_initializer.py refactor(api): rename dify_graph to graphon (#34095) 2026-03-25 21:58:56 +08:00
variable_prefixes.py refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
workflow_entry.py refactor(api): type single-node graph structure with TypedDicts in workflow_entry (#34671) 2026-04-07 13:18:00 +00:00
workflow_run_outputs.py refactor(api): rename dify_graph to graphon (#34095) 2026-03-25 21:58:56 +08:00