Critical panic for every dify python plugin #172

Closed
opened 2026-02-16 00:20:20 -05:00 by yindo · 1 comment
Owner

Originally created by @Betula-L on GitHub (Aug 7, 2025).

Versions

  1. dify-plugin-daemon Version >= 0.1.3 (0.1.3 0.2.0)
  2. dify-api Version 1.6.0
  3. dify-plugin python sdk >= 0.4.2 (0.4.2 0.4.3)

Describe the bug
dify python plugin raise Pydantic validate error as follows

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for ToolInvokeRequest\ncredential_type\n Input should be 'api-key' or 'oauth2' [type=enum, input_value='', input_type=str]\n For further information visit https://errors.pydantic.dev/2.11/v/enum"}

In python sdk dify-plugin, every python plugin with credential configs must have parameter credential_type with enum api-key or oauth2, which introduced by version 0.4.2.

In dify-api, it calls dify-plugin-daemon without parameter credential_type. link

In dify-plugin-daemon, credential_type of RequestInvokeTool is not omitempty, so credential_type for calling dify-plugin is str ''. link

Then, things gonna wrong. Every plugin failed if dify-plugin updated to 0.4.3

To Reproduce
Every python plugin with credential config if using dify-plugin-daemon >= 0.1.3 and dify-plugin 0.4.3

Expected behavior
No Pydantic validate error .

Screenshots
Image

Originally created by @Betula-L on GitHub (Aug 7, 2025). **Versions** 1. dify-plugin-daemon Version >= 0.1.3 (0.1.3 0.2.0) 2. dify-api Version 1.6.0 3. dify-plugin python sdk >= 0.4.2 (0.4.2 0.4.3) **Describe the bug** dify python plugin raise Pydantic validate error as follows ``` Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for ToolInvokeRequest\ncredential_type\n Input should be 'api-key' or 'oauth2' [type=enum, input_value='', input_type=str]\n For further information visit https://errors.pydantic.dev/2.11/v/enum"} ``` In python sdk dify-plugin, every python plugin with credential configs must have parameter `credential_type` with enum `api-key` or `oauth2`, which introduced by version [0.4.2](https://github.com/langgenius/dify-plugin-sdks/commits/main/python/dify_plugin/entities/provider_config.py). In dify-api, it calls dify-plugin-daemon without parameter `credential_type`. [link](https://github.com/langgenius/dify/blob/d98071a088c46f61f2608415bb23f9aa5f40f737/api/core/plugin/impl/tool.py#L233) In dify-plugin-daemon, `credential_type` of RequestInvokeTool **is not** omitempty, so `credential_type` for calling dify-plugin is str ''. [link](https://github.com/langgenius/dify-plugin-daemon/blob/222ab80a6b5767327c8e529bb6c73fa56c4273e6/pkg/entities/requests/model.go#L11) Then, things gonna wrong. Every plugin failed if dify-plugin updated to 0.4.3 **To Reproduce** Every python plugin with credential config if using dify-plugin-daemon >= 0.1.3 and dify-plugin 0.4.3 **Expected behavior** No Pydantic validate error . **Screenshots** <img width="552" height="214" alt="Image" src="https://github.com/user-attachments/assets/b5d940cb-3018-416f-937d-58ff661dd8be" />
yindo closed this issue 2026-02-16 00:20:20 -05:00
Author
Owner

@Niklaus1028 commented on GitHub (Sep 3, 2025):

怎么解决呢

@Niklaus1028 commented on GitHub (Sep 3, 2025): 怎么解决呢
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#172