Open drfenixlinghu opened 2 weeks ago
Hello @drfenixlinghu! I'm here to assist you with bug fixes, answer questions, and guide you on becoming a contributor. Let's tackle this issue together!
Yes, the issue you described with Dify version 0.6.11, where the agent no longer accepts further prompts after a tool has completed its task and throws an error indicating an unknown type role with role=<PromptMessageRole.TOOL: 'tool'>
, has been experienced by others. The provided code defines the PromptMessageRole
enum, which includes the TOOL
role, and the ToolPromptMessage
class, which uses this role. The error might be due to improper handling or validation of the TOOL
role in the system.
From the api/core/agent/base_agent_runner.py
file, it appears that the BaseAgentRunner
class initializes and manages tools through methods like _init_prompt_tools
and _convert_tool_to_prompt_message_tool
. These methods ensure that tools are properly converted to PromptMessageTool
instances and their parameters are correctly set. However, if there is an issue with how the TOOL
role is being processed or validated, it could lead to the error you are encountering. It might be worth checking the implementation of these methods and ensuring that the TOOL
role is being handled correctly throughout the agent's lifecycle [1][2].
To continue talking to Dosu, mention @dosu.
I think this should be fixed in latest main branch.
the error exist a long time since 0.6.10 and can't resolved at 0.6.11
Yes we just fixed yesterday. https://github.com/langgenius/dify/pull/5245
Yes we just fixed yesterday. #5245
updated today the problem is still there
最新mast版本, sd遇到同样错误
which model are you using for this?
@Yeuoly I'm using GLM-4 with the same problem.
Self Checks
Dify version
0.6.11
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
every time i use a tool in the agent mode, after the tool perform its job, the agent no longer accept any further prompts. seems the agent feels that it has used the tool and the tool has done the job, therefore no more action is required or accepted. This happens with all tools available to dify.
![0efff3d09b4986e4a6f215f96423143](https://github.com/langgenius/dify/assets/156991093/53437151-8d53-4951-86d2-30552866a5ca)
anyone has the same issue?
✔️ Expected Behavior
to be able to continue with the conversation
❌ Actual Behavior
cannot go on with the conversation.