Skip to content

fix: fix tool output duplicate - #34962

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
fatelei:issue-34723
Apr 11, 2026
Merged

asukaminato0721 merged 1 commit into
langgenius:mainfrom
fatelei:issue-34723

Conversation

@fatelei

@fatelei fatelei commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

when tool message type is variable skip it, str(response.message) is no use for llm fix #34723

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-04-11 13:01:28.930825991 +0000
+++ /tmp/pyrefly_pr.txt	2026-04-11 13:01:21.391696960 +0000
@@ -5508,7 +5508,7 @@
 ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.tools.tool_engine.ToolEngine.agent_invoke` [bad-argument-type]
    --> tests/unit_tests/core/tools/test_tool_engine.py:253:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.tools.tool_engine.ToolEngine.agent_invoke` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_engine.py:274:21
+   --> tests/unit_tests/core/tools/test_tool_engine.py:296:21
 ERROR Argument `None` is not assignable to parameter `metadata` with type `Mapping[str, Any]` in function `core.tools.entities.tool_entities.LogMessage.__init__` [bad-argument-type]
   --> tests/unit_tests/core/tools/test_tool_entities.py:20:18
 ERROR Argument `None` is not assignable to parameter `output_schema` with type `Mapping[str, Any]` in function `core.tools.entities.tool_entities.ToolEntity.__init__` [bad-argument-type]

@asukaminato0721
asukaminato0721 added this pull request to the merge queue Apr 11, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 11, 2026
Merged via the queue into langgenius:main with commit 65d6676 Apr 11, 2026
30 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
Ssazurov pushed a commit to Ssazurov/dify that referenced this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool returns duplicate results when called via agent

2 participants