the tool's output trans from a list json to a direct json ,but the outputtype declare is still list json #15174

Closed
opened 2026-02-21 19:20:32 -05:00 by yindo · 1 comment
Owner

Originally created by @chenqishi on GitHub (Jul 8, 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 search for existing issues, 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.5.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Image

just like the tools , the declare type is Array[json], but in the new version is direct dict,is this change is correct and no chanage in future?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @chenqishi on GitHub (Jul 8, 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 [search for existing issues](https://github.com/langgenius/dify/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.5.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/284b6407-c275-4523-81be-456f8b257252) just like the tools , the declare type is Array[json], but in the new version is direct dict,is this change is correct and no chanage in future? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the stale label 2026-02-21 19:20:32 -05:00
yindo closed this issue 2026-02-21 19:20:32 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 8, 2025):

Based on what I found, the change where the tool now outputs a direct JSON (dict) instead of a list (Array[json]), while the output type declaration still says Array[json], appears to be an inconsistency in the codebase. There’s no documentation or changelog confirming this as an intentional or permanent change, and no similar issues were found. The code shows that tool outputs are defined using Pydantic models, and the actual output format may have shifted to dict, but the type declaration (metadata) wasn’t updated to match, which can cause confusion or errors for consumers expecting a list format. This matches the bug you described and should be synchronized for consistency going forward. You can track or adjust the output_schema in your own tools to ensure alignment until this is resolved in the main codebase.
See relevant code reference

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 8, 2025): <!-- Answer --> Based on what I found, the change where the tool now outputs a direct JSON (dict) instead of a list (Array[json]), while the output type declaration still says Array[json], appears to be an inconsistency in the codebase. There’s no documentation or changelog confirming this as an intentional or permanent change, and no similar issues were found. The code shows that tool outputs are defined using Pydantic models, and the actual output format may have shifted to dict, but the type declaration (metadata) wasn’t updated to match, which can cause confusion or errors for consumers expecting a list format. This matches the bug you described and should be synchronized for consistency going forward. You can track or adjust the output_schema in your own tools to ensure alignment until this is resolved in the main codebase. [See relevant code reference](https://github.com/langgenius/dify/blob/a4bdeba60df49bd2ab52b2a45457b10beba835c6/api/core/tools/entities/tool_entities.py) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/34f7ee79-8951-4773-92d9-021127bbbd96?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22028)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15174