mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
The Agent uses the qwen model. When memory is enabled, an error occurs after sending a document message and then sending another message. #671
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 @lucidity99 on GitHub (Sep 24, 2025).
Self Checks
Dify version
1.8.0
Plugin version
通义千问 0.0.47
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Error log
Run failed: Failed to transform agent message: req_id: 48266379f3 PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [tongyi] Error: req_id: 2ecafaa296 PluginInvokeError: {"args":{"description":"[models] Error: 'dict' object has no attribute 'dashscope_api_key'"},"error_type":"InvokeError","message":"[models] Error: 'dict' object has no attribute 'dashscope_api_key'"}"}
@dosubot[bot] commented on GitHub (Sep 24, 2025):
The error is caused by a bug in the Tongyi (qwen) plugin: the code tries to access the API key using dot notation (
credentials.dashscope_api_key), but credentials are passed as a dictionary, so it should usecredentials['dashscope_api_key']instead. This leads to the'dict' object has no attribute 'dashscope_api_key'error when memory is enabled and the agent node tries to make an API request [details & fix].To fix this, update the plugin code in the
_upload_file_to_tongyimethod (and any similar places) to use dictionary key access. If you can't patch the code, you can try these workarounds: downgrade the Tongyi plugin to version 0.0.18 (users report this avoids the bug in recent Dify releases), or switch the agent node strategy from EnhanceFunctionCalling to Dify's official agent strategy, which has resolved similar errors for others [workaround].Also, double-check that your provider configuration includes the correct
dashscope_api_keyvalue, with no typos or formatting issues [config advice]. If you update the plugin or config and still see the error, let me know if you need a sample config or more details.To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@lucidity99 commented on GitHub (Sep 24, 2025):
Hi @dosu , based on the solutions you provided, I have tried the following steps:
However, the issue still persists.
@dosubot[bot] commented on GitHub (Sep 24, 2025):
The error persists because the Tongyi plugin has a bug where it sometimes tries to access the API key using dot notation (
credentials.dashscope_api_key) instead of dictionary access (credentials['dashscope_api_key']). This bug is present in both recent and older plugin versions, and downgrading or switching agent strategies often doesn't resolve it—especially when memory is enabled in agent nodes. The only robust fix is to patch the plugin code so all credential access uses dictionary keys, or to ensure credentials are always normalized before use.Also, double-check that your API key starts with
sk-, matches the expected provider config, and that your endpoint (domestic/international) is correct. Even if the UI shows the key as valid, backend validation may still reject it if the format or config is off. In self-hosted or firewalled environments, make sure Dify can reach the Tongyi API endpoints, and check backend logs for more details if the error continues. If you need to skip key validation or patch the plugin, you can fork the repo and adjust the credential handling logic as needed. More details and config tips are here: API key and config advice, plugin credential handling, prompt message requirements.If you want a minimal workaround: try disabling memory, or use a different model/plugin to confirm the issue is isolated to Tongyi + memory. If you need a sample config or code patch, let me know.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
