mirror of
https://github.com/langgenius/dify.git
synced 2026-08-29 19:54:46 +08:00
1. Fix workflow-level total_tokens=0: Call graph_runtime_state.add_tokens(usage.total_tokens) in both _run_without_tools and _run_with_tools paths after node execution. Previously only graphon's internal ModelInvokeCompletedEvent handler called add_tokens, which agent-v2 doesn't emit. 2. Fix Turn 2 SSE empty response: Set PUBSUB_REDIS_CHANNEL_TYPE=streams in .env. Redis Streams provides durable event delivery (consumers can replay past events), solving the pub/sub at-most-once timing issue. 3. Skill -> Agent runtime integration: SandboxBuilder.build() now auto-includes SkillInitializer if not already present. This ensures sandbox.attrs has the skill bundle loaded for downstream consumers (tool execution in sandbox). 4. LegacyResponseAdapter: New module at core/app/apps/common/legacy_response_adapter.py. Filters workflow-specific SSE events (workflow_started, node_started, node_finished, workflow_finished) from the stream, passing through only message/message_end/agent_log/error/ping events that old clients expect. 46 unit tests pass. Made-with: Cursor |
||
|---|---|---|
| .. | ||
| advanced_chat | ||
| agent_chat | ||
| chat | ||
| common | ||
| completion | ||
| pipeline | ||
| workflow | ||
| __init__.py | ||
| base_app_generate_response_converter.py | ||
| base_app_generator.py | ||
| base_app_queue_manager.py | ||
| base_app_runner.py | ||
| draft_variable_saver.py | ||
| exc.py | ||
| message_based_app_generator.py | ||
| message_based_app_queue_manager.py | ||
| message_generator.py | ||
| streaming_utils.py | ||
| workflow_app_runner.py | ||