mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
installs Dify Agent 0.20 and 0.21 versions abnormally #473
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yejiaaqi on GitHub (Jul 23, 2025).
Self Checks
Dify version
1.7.0
Plugin version
0.2.0、0.2.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Dify 1.7.0 installs Dify Agent 0.20 and 0.21 versions abnormally, downgrading to 0.9.0 is fine, no abnormality
✔️ Error log
plugin_daemon-1 | 2025/07/24 02:46:14 /app/internal/db/executor.go:259 record not found
plugin_daemon-1 | [0.194ms] [rows:0] SELECT * FROM "plugins" WHERE plugin_unique_identifier = 'langgenius/agent:0.0.19@3850c37e0f04f6ff6f00641fc36ed1d11555b0222470c37aa715218a4c5c95fd' ORDER BY "plugins"."id" LIMIT 1
plugin_daemon-1 | 2025/07/24 02:46:14 stdio.go:179: [ERROR]plugin langgenius/agent:0.0.20 has an error on stdout: read |0: file already closed
plugin_daemon-1 | 2025/07/24 02:46:14 run.go:135: [ERROR]plugin langgenius/agent:0.0.20 exited with error: signal: killed
plugin_daemon-1 | dify_plugin/core/utils/class_loader.py", line 34, in import_module_from_source
plugin_daemon-1 | raise e
plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/core/utils/class_loader.py", line 31, in import_module_from_source
plugin_daemon-1 |
plugin_daemon-1 | spec.loader.exec_module(module)
plugin_daemon-1 |
plugin_daemon-1 | File "", line 995, in exec_module
plugin_daemon-1 | File "", line 488, in _call_with_frames_removed
plugin_daemon-1 |
plugin_daemon-1 | File "/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py", line 23, in
plugin_daemon-1 |
plugin_daemon-1 | from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType
plugin_daemon-1 |
plugin_daemon-1 | ImportError: cannot import name 'LogMetadata' from 'dify_plugin.entities.tool' (/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/.venv/lib/python3.12/site-packages/dify_plugin/entities/tool.py)
plugin_daemon-1 |
@wangtao commented on GitHub (Jul 24, 2025):
same here
@litongyu55 commented on GitHub (Jul 24, 2025):
This appears to be an ImportError caused by a recent change in the Dify framework where the LogMetadata entity was moved. The traceback confirms it's trying to import LogMetadata from dify_plugin.entities.tool, but it is no longer located there.
Solution:
You need to update the import path for LogMetadata in the agent's strategy files. Specifically, please modify the following two files:
/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/function_calling.py
/app/storage/cwd/langgenius/agent-0.0.20@eafd74ef989a085162e2de35b8b3ada3aab65430eefb10c966399d02327cd679/strategies/ReAct.py
In both files, you need to change the import statements.
The old import might look something like this:
from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType
And replace it with the following two import statements:
from dify_plugin.entities.provider_config import LogMetadata
from dify_plugin.entities.tool import ToolInvokeMessage, ToolProviderType
In the file ReAct.py, find this import block:
from dify_plugin.entities.tool import (
LogMetadata,
ToolInvokeMessage,
ToolParameter,
ToolProviderType,
)
And replace it with the following two import statements:
from dify_plugin.entities.provider_config import LogMetadata
from dify_plugin.entities.tool import (
ToolInvokeMessage,
ToolParameter,
ToolProviderType,
)
This separates the import for LogMetadata and points it to the correct new location, which should resolve the error.
Finally, restart the container to apply changes.