The official agent tool reports an error #378

Closed
opened 2026-02-16 10:19:12 -05:00 by yindo · 4 comments
Owner

Originally created by @z942588879 on GitHub (Jun 17, 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.4.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

Normal output

Actual Behavior

Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"AttributeError","message":"'AgentRuntime' object has no attribute 'model'"}

Originally created by @z942588879 on GitHub (Jun 17, 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.4.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/77dc426c-5c48-43b2-a790-d1d1ea0de2c4) ### ✔️ Expected Behavior Normal output ### ❌ Actual Behavior Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"AttributeError","message":"'AgentRuntime' object has no attribute 'model'"}
yindo closed this issue 2026-02-16 10:19:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 17, 2025):

This error happens because the agent runner classes in Dify (like BaseAgentRunner, CotAgentRunner, FunctionCallAgentRunner) do not have a direct model attribute. Instead, the model is accessed via model_instance.model or model_config.model. If a plugin or tool expects agent.model, it will trigger this AttributeError.

To fix this, update the code that expects agent.model to use agent.model_instance.model instead. Alternatively, you can add a property named model to the relevant agent runner class that returns self.model_instance.model. This will make the attribute available as expected by the plugin or tool code. The plugin error reporting just forwards this error; it doesn't cause it itself.

There is no AgentRuntime class in the Dify codebase, so the error is likely due to an interface mismatch between your plugin/tool and the agent runner implementation.
See supporting code references.

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 (Jun 17, 2025): <!-- Answer --> This error happens because the agent runner classes in Dify (like BaseAgentRunner, CotAgentRunner, FunctionCallAgentRunner) do not have a direct model attribute. Instead, the model is accessed via model_instance.model or model_config.model. If a plugin or tool expects agent.model, it will trigger this AttributeError. To fix this, update the code that expects agent.model to use agent.model_instance.model instead. Alternatively, you can add a property named model to the relevant agent runner class that returns self.model_instance.model. This will make the attribute available as expected by the plugin or tool code. The plugin error reporting just forwards this error; it doesn't cause it itself. There is no AgentRuntime class in the Dify codebase, so the error is likely due to an interface mismatch between your plugin/tool and the agent runner implementation. [See supporting code references](https://github.com/langgenius/dify/blob/0dcacdf83d3b03ef40b0006b8134a671fe543a6b/api/core/agent/base_agent_runner.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/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/62c99c6d-12fd-4aaf-9cc0-91b9b505323b?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/21118)
Author
Owner

@hxt365 commented on GitHub (Jun 18, 2025):

I have the same issue. The latest version of the Agent plugin is broken

@hxt365 commented on GitHub (Jun 18, 2025): I have the same issue. The latest version of the Agent plugin is broken
Author
Owner

@FocusProgram commented on GitHub (Jun 19, 2025):

Downgrade the version of the dify agent plugin to version 0.0.15 which is temporarily available.

@FocusProgram commented on GitHub (Jun 19, 2025): Downgrade the version of the dify agent plugin to version 0.0.15 which is temporarily available.
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi, @z942588879. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported an AttributeError in Dify v1.4.2 self-hosted via Docker where the official agent tool fails due to missing 'model' attribute in AgentRuntime.
  • The root cause is that agent runner classes do not have a direct model attribute.
  • A suggested fix is to modify the code to access model_instance.model or add a model property to the class.
  • Other users confirmed the issue and recommended downgrading the agent plugin to version 0.0.15 as a temporary workaround.
  • The issue has been resolved with these code adjustments and the downgrade workaround.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository.
  • If it is, feel free to keep the discussion open by commenting here; otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @z942588879. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported an AttributeError in Dify v1.4.2 self-hosted via Docker where the official agent tool fails due to missing 'model' attribute in AgentRuntime. - The root cause is that agent runner classes do not have a direct model attribute. - A suggested fix is to modify the code to access `model_instance.model` or add a model property to the class. - Other users confirmed the issue and recommended downgrading the agent plugin to version 0.0.15 as a temporary workaround. - The issue has been resolved with these code adjustments and the downgrade workaround. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository. - If it is, feel free to keep the discussion open by commenting here; otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#378