Tool response print is duplicated in Dify Plugin Agent Strategies 0.0.14 #210

Closed
opened 2026-02-16 10:18:27 -05:00 by yindo · 3 comments
Owner

Originally created by @rcruzin on GitHub (Apr 20, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Plugin version

0.0.14

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

{
"output": {
"tool_call_id": "xKa...",
"tool_call_input": {
"employee_id": "1",
"token": "eyJhbG...."
},
"tool_call_name": "Getting_Leave_Type_IDs",
"tool_response": "{"result": "

Leave Type IDLeave Type Name
4Vacation
2Sick
"}tool response: {"result": "
Leave Type IDLeave Type Name
4Vacation
2Sick
"}."
}
}

✔️ Error log

No response

Originally created by @rcruzin on GitHub (Apr 20, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Plugin version 0.0.14 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce { "output": { "tool_call_id": "xKa...", "tool_call_input": { "employee_id": "1", "token": "eyJhbG...." }, "tool_call_name": "Getting_Leave_Type_IDs", "tool_response": "{\"result\": \"<table><tr><th>Leave Type ID</th><th>Leave Type Name</th></tr><tr><td>4</td><td>Vacation</td></tr><tr><td>2</td><td>Sick</td></tr></table>\"}tool response: {\"result\": \"<table><tr><th>Leave Type ID</th><th>Leave Type Name</th></tr><tr><td>4</td><td>Vacation</td></tr><tr><td>2</td><td>Sick</td></tr></table>\"}." } } ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:18:27 -05:00
yindo closed this issue 2026-02-16 10:18:27 -05:00
Author
Owner

@rcruzin commented on GitHub (Apr 20, 2025):

@crazywoola

# function_calling.py
                       elif response.type == ToolInvokeMessage.MessageType.JSON:
                                text = json.dumps(
                                    cast(ToolInvokeMessage.JsonMessage, response.message).json_object,
                                    ensure_ascii=False,
                                )
                                result += f"tool response: {text}."
@rcruzin commented on GitHub (Apr 20, 2025): @crazywoola ```python # function_calling.py elif response.type == ToolInvokeMessage.MessageType.JSON: text = json.dumps( cast(ToolInvokeMessage.JsonMessage, response.message).json_object, ensure_ascii=False, ) result += f"tool response: {text}." ```
Author
Owner

@EcoleKeine commented on GitHub (Apr 25, 2025):

can be fixed like https://github.com/langgenius/dify/pull/14216

            elif response.type == ToolInvokeMessage.MessageType.JSON:
                result = json.dumps(
                    cast(ToolInvokeMessage.JsonMessage, response.message).json_object, ensure_ascii=False
                )
            else:
                result += str(response.message)
@EcoleKeine commented on GitHub (Apr 25, 2025): can be fixed like https://github.com/langgenius/dify/pull/14216 ```python elif response.type == ToolInvokeMessage.MessageType.JSON: result = json.dumps( cast(ToolInvokeMessage.JsonMessage, response.message).json_object, ensure_ascii=False ) else: result += str(response.message) ```
Author
Owner

@dosubot[bot] commented on GitHub (Aug 17, 2025):

Hi, @rcruzin. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported duplicated tool responses in Dify Plugin Agent Strategies v0.0.14 when used with Dify v1.2.0 self-hosted via Docker.
  • You provided a code snippet in function_calling.py illustrating the problem.
  • Contributor EcoleKeine suggested a fix by adjusting JSON response handling to prevent duplication.
  • The fix referenced a similar pull request (langgenius/dify#14216) as a resolution approach.
  • No error logs were provided in the original report.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If no response is received within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 17, 2025): Hi, @rcruzin. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported duplicated tool responses in Dify Plugin Agent Strategies v0.0.14 when used with Dify v1.2.0 self-hosted via Docker. - You provided a code snippet in function_calling.py illustrating the problem. - Contributor EcoleKeine suggested a fix by adjusting JSON response handling to prevent duplication. - The fix referenced a similar pull request (langgenius/dify#14216) as a resolution approach. - No error logs were provided in the original report. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here. - If no response is received within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#210