dify/api/core
Yansong Zhang 4f010cd4f5 fix(api): stop emitting StreamChunkEvent from tool path to prevent answer duplication
The EventAdapter was converting every LLMResultChunk from the agent
strategy into StreamChunkEvent. Combined with the answer node's
{{#agent.text#}} variable output, this caused the final answer to
appear twice (e.g., "It is 2026-04-09 04:27:45.It is 2026-04-09 04:27:45.").

Now LLMResultChunk from strategy output is silently consumed (text still
accumulates in AgentResult.text via the strategy). Only AgentLogEvent
(thought/tool_call/round) is forwarded to the pipeline.

Known remaining issues:
- workflow/message level total_tokens=0 (node level is correct at 33)
  because pipeline aggregation doesn't include agent-v2 node tokens
- Turn 2 SSE delivery timing with Redis pubsub (celery executes OK)

Made-with: Cursor
2026-04-09 12:31:49 +08:00
..
agent fix(api): remove unsupported 'user' param from FC/ReAct invoke_llm calls 2026-04-09 12:18:07 +08:00
app refactor(api): replace legacy agent runners with StrategyFactory in AgentChatAppRunner (Phase 4) 2026-04-09 09:42:23 +08:00
app_assets feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
app_bundle feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
base refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
callback_handler refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
datasource refactor(api): deduplicate I18nObject in datasource entities (#34701) 2026-04-08 01:36:56 +00:00
db fix(db): parameterize sessionmaker with Session (#30612) 2026-01-06 15:23:50 +08:00
entities refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
errors chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
extension change all to httpx (#26119) 2025-10-10 23:41:16 +08:00
external_data_tool chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
helper feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
llm_generator feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
logging refactor(api): reuse IdentityDict TypedDict in logging filters (#34593) 2026-04-06 11:30:21 +00:00
mcp refactor(api): type MCP tool schema and arguments with TypedDict (#34612) 2026-04-07 01:02:06 +00:00
memory feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
moderation refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
ops refactor(api): type aliyun trace utils with TypedDict and tighten return types (#34642) 2026-04-07 05:57:22 +00:00
plugin refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
prompt refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
rag refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
repositories chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
sandbox feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
schemas chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
session feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
skill feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
telemetry feat: enterprise otel exporter (#33138) 2026-03-27 07:56:31 +00:00
tools feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
trigger refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
virtual_environment feat(api): port Sandbox + VirtualEnvironment + Skill system from feat/support-agent-sandbox (Phase 5-6) 2026-04-08 17:39:02 +08:00
workflow fix(api): stop emitting StreamChunkEvent from tool path to prevent answer duplication 2026-04-09 12:31:49 +08:00
zip_sandbox feat(api): enable all sandbox/skill controller routes and resolve dependencies (P0) 2026-04-09 09:36:16 +08:00
__init__.py Fix basedpyright type errors (#25435) 2025-09-10 01:54:26 +08:00
hosting_configuration.py refactor(api): use standalone graphon package (#34209) 2026-03-27 21:05:32 +00:00
indexing_runner.py refactor: core/app pipeline, core/datasource, and core/indexing_runner (#34359) 2026-04-01 02:20:56 +00:00
model_manager.py refactor(api): tighten types for Tenant.custom_config_dict and MCPToolProvider.headers (#34698) 2026-04-08 01:36:42 +00:00
provider_manager.py refactor(api): replace json.loads with Pydantic validation in security and tools layers (#34380) 2026-04-07 12:11:51 +00:00