mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [google] Error: can only concatenate str (not \"list\") to str"} #462
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SAGAYARAJ0 on GitHub (Jul 18, 2025).
Self Checks
Dify version
v1.6.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [google] Error: can only concatenate str (not "list") to str"}
✔️ Expected Behavior
The error comes from the agent. What is the reason for this issue, and how can I find a solution?
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (Jul 18, 2025):
Hi @SAGAYARAJ0! I'm Dosu and I’m helping the dify team.
This error happens because Dify's agent logic expects LLM responses to be strings, but some providers (like Google Gemini) can return a list (often for multimodal or structured outputs). When the code tries to concatenate a string with a list, you get the "can only concatenate str (not 'list') to str" TypeError. This is a known issue in the Dify codebase, especially when integrating with plugin-based providers that may emit lists instead of plain text strings [source].
Recent PRs have addressed this in some places by adding type checks and flattening lists to strings where needed (see PR langgenius/dify#21837 and langgenius/dify#22036). To work around this, you can patch your deployment by ensuring that wherever message content is consumed or transformed (especially in agent runners or message transformation logic), you check if the content is a list and join or extract the text segments before concatenating. For example:
This will prevent the TypeError and ensure compatibility with providers that return structured or multimodal outputs. If you update to a version after these PRs, or apply a similar patch, the issue should be resolved.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@crazywoola commented on GitHub (Jul 18, 2025):
Please provide the plugin version as well.
@gokulavelan commented on GitHub (Jul 23, 2025):
Version 0.2.8
@dosubot[bot] commented on GitHub (Aug 21, 2025):
Hi, @SAGAYARAJ0. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!