agent node error #14949

Closed
opened 2026-02-21 19:19:29 -05:00 by yindo · 3 comments
Owner

Originally created by @jepsonhu on GitHub (Jun 27, 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.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When i use the agent node, expect to use tool, it has error: Failed to transform agent message: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"AttributeError","message":"'AgentRuntime' object has no attribute 'model'"}

Image

DSL
app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: workflow name: agenttest use_icon_as_answer_icon: false dependencies: [] kind: app version: 0.3.0 workflow: conversation_variables: [] environment_variables: [] features: file_upload: allowed_file_extensions: - .JPG - .JPEG - .PNG - .GIF - .WEBP - .SVG allowed_file_types: - image allowed_file_upload_methods: - local_file - remote_url enabled: false fileUploadConfig: audio_file_size_limit: 50 batch_count_limit: 5 file_size_limit: 15 image_file_size_limit: 10 video_file_size_limit: 100 workflow_file_upload_limit: 10 image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url number_limits: 3 opening_statement: '' retriever_resource: enabled: true sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: isInIteration: false isInLoop: false sourceType: start targetType: agent id: 1751004638138-source-1751004934996-target source: '1751004638138' sourceHandle: source target: '1751004934996' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: agent targetType: end id: 1751004934996-source-1751004998309-target source: '1751004934996' sourceHandle: source target: '1751004998309' targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: 开始 type: start variables: - label: query max_length: 48 options: [] required: true type: text-input variable: query height: 90 id: '1751004638138' position: x: 80 y: 282 positionAbsolute: x: 80 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: agent_parameters: instruction: type: constant value: 你是一个发票助手,通过mcpserver查询发票信息 model: type: constant value: completion_params: {} mode: chat model: anthropic/claude-3.7-sonnet model_type: llm provider: langgenius/openrouter/openrouter type: model-selector query: type: constant value: '{{#1751004638138.query#}}' tools: type: constant value: - enabled: true extra: description: 调用 MCP 服务端工具。 parameters: arguments: auto: 1 value: null servers_config: auto: 1 value: null tool_name: auto: 1 value: null provider_name: junjiem/mcp_sse/mcp_sse schemas: - auto_generate: null default: null form: llm human_description: en_US: Name of the tool to execute. ja_JP: Name of the tool to execute. pt_BR: Name of the tool to execute. zh_Hans: 要执行的工具的名称。 label: en_US: Tool Name ja_JP: Tool Name pt_BR: Tool Name zh_Hans: 工具名称 llm_description: Name of the MCP tool to execute. max: null min: null name: tool_name options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: null form: llm human_description: en_US: Tool arguments (JSON string in the python dict[str, Any] format). ja_JP: Tool arguments (JSON string in the python dict[str, Any] format). pt_BR: Tool arguments (JSON string in the python dict[str, Any] format). zh_Hans: 工具的参数。 label: en_US: Arguments ja_JP: Arguments pt_BR: Arguments zh_Hans: 参数 llm_description: MCP Tool arguments (JSON string in the python dict[str, Any] format). max: null min: null name: arguments options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Resources as Tools. ja_JP: Fetch and call the preset MCP Resources as Tools. pt_BR: Fetch and call the preset MCP Resources as Tools. zh_Hans: 将预设的 MCP Resources 作为 Tools 返回和调用。 label: en_US: MCP Resources as Tools ja_JP: MCP Resources as Tools pt_BR: MCP Resources as Tools zh_Hans: MCP 资源作为工具 llm_description: '' max: null min: null name: resources_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Prompts as Tools. ja_JP: Fetch and call the preset MCP Prompts as Tools. pt_BR: Fetch and call the preset MCP Prompts as Tools. zh_Hans: 将预设的 MCP Prompts 作为 Tools 返回和调用。 label: en_US: MCP Prompts as Tools ja_JP: MCP Prompts as Tools pt_BR: MCP Prompts as Tools zh_Hans: MCP 提示词作为工具 llm_description: '' max: null min: null name: prompts_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: null form: llm human_description: en_US: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) ja_JP: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) pt_BR: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) zh_Hans: MCP服务配置,支持多个MCP服务。 (选填,填写后将覆盖授权时填写的MCP服务配置。) label: en_US: MCP Servers config ja_JP: MCP Servers config pt_BR: MCP Servers config zh_Hans: MCP 服务配置 llm_description: '' max: null min: null name: servers_config options: [] placeholder: null precision: null required: false scope: null template: null type: string settings: prompts_as_tools: value: 1 resources_as_tools: value: 1 tool_description: 调用 MCP 服务端工具。 tool_label: 调用 MCP 工具 tool_name: mcp_sse_call_tool type: builtin agent_strategy_label: ReAct agent_strategy_name: ReAct agent_strategy_provider_name: langgenius/agent/agent desc: '' output_schema: null plugin_unique_identifier: langgenius/agent:0.0.16@3fd5abb87c9ebad7c9ad5abac32dbe396673285258ae2dac696b20143fb5e477 selected: false title: Agent type: agent height: 198 id: '1751004934996' position: x: 384 y: 282 positionAbsolute: x: 384 y: 282 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: desc: '' outputs: - value_selector: - '1751004934996' - text variable: result selected: false title: 结束 type: end height: 90 id: '1751004998309' position: x: 688 y: 282 positionAbsolute: x: 688 y: 282 sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: 226 y: 65.5 zoom: 1

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @jepsonhu on GitHub (Jun 27, 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.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When i use the agent node, expect to use tool, it has error: Failed to transform agent message: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"AttributeError","message":"'AgentRuntime' object has no attribute 'model'"} ![Image](https://github.com/user-attachments/assets/899f959d-a974-4d5c-b0dc-04a8bdd0de0b) DSL `app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: workflow name: agenttest use_icon_as_answer_icon: false dependencies: [] kind: app version: 0.3.0 workflow: conversation_variables: [] environment_variables: [] features: file_upload: allowed_file_extensions: - .JPG - .JPEG - .PNG - .GIF - .WEBP - .SVG allowed_file_types: - image allowed_file_upload_methods: - local_file - remote_url enabled: false fileUploadConfig: audio_file_size_limit: 50 batch_count_limit: 5 file_size_limit: 15 image_file_size_limit: 10 video_file_size_limit: 100 workflow_file_upload_limit: 10 image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url number_limits: 3 opening_statement: '' retriever_resource: enabled: true sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: isInIteration: false isInLoop: false sourceType: start targetType: agent id: 1751004638138-source-1751004934996-target source: '1751004638138' sourceHandle: source target: '1751004934996' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: agent targetType: end id: 1751004934996-source-1751004998309-target source: '1751004934996' sourceHandle: source target: '1751004998309' targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: 开始 type: start variables: - label: query max_length: 48 options: [] required: true type: text-input variable: query height: 90 id: '1751004638138' position: x: 80 y: 282 positionAbsolute: x: 80 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: agent_parameters: instruction: type: constant value: 你是一个发票助手,通过mcpserver查询发票信息 model: type: constant value: completion_params: {} mode: chat model: anthropic/claude-3.7-sonnet model_type: llm provider: langgenius/openrouter/openrouter type: model-selector query: type: constant value: '{{#1751004638138.query#}}' tools: type: constant value: - enabled: true extra: description: 调用 MCP 服务端工具。 parameters: arguments: auto: 1 value: null servers_config: auto: 1 value: null tool_name: auto: 1 value: null provider_name: junjiem/mcp_sse/mcp_sse schemas: - auto_generate: null default: null form: llm human_description: en_US: Name of the tool to execute. ja_JP: Name of the tool to execute. pt_BR: Name of the tool to execute. zh_Hans: 要执行的工具的名称。 label: en_US: Tool Name ja_JP: Tool Name pt_BR: Tool Name zh_Hans: 工具名称 llm_description: Name of the MCP tool to execute. max: null min: null name: tool_name options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: null form: llm human_description: en_US: Tool arguments (JSON string in the python dict[str, Any] format). ja_JP: Tool arguments (JSON string in the python dict[str, Any] format). pt_BR: Tool arguments (JSON string in the python dict[str, Any] format). zh_Hans: 工具的参数。 label: en_US: Arguments ja_JP: Arguments pt_BR: Arguments zh_Hans: 参数 llm_description: MCP Tool arguments (JSON string in the python dict[str, Any] format). max: null min: null name: arguments options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Resources as Tools. ja_JP: Fetch and call the preset MCP Resources as Tools. pt_BR: Fetch and call the preset MCP Resources as Tools. zh_Hans: 将预设的 MCP Resources 作为 Tools 返回和调用。 label: en_US: MCP Resources as Tools ja_JP: MCP Resources as Tools pt_BR: MCP Resources as Tools zh_Hans: MCP 资源作为工具 llm_description: '' max: null min: null name: resources_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Prompts as Tools. ja_JP: Fetch and call the preset MCP Prompts as Tools. pt_BR: Fetch and call the preset MCP Prompts as Tools. zh_Hans: 将预设的 MCP Prompts 作为 Tools 返回和调用。 label: en_US: MCP Prompts as Tools ja_JP: MCP Prompts as Tools pt_BR: MCP Prompts as Tools zh_Hans: MCP 提示词作为工具 llm_description: '' max: null min: null name: prompts_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: null form: llm human_description: en_US: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) ja_JP: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) pt_BR: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) zh_Hans: MCP服务配置,支持多个MCP服务。 (选填,填写后将覆盖授权时填写的MCP服务配置。) label: en_US: MCP Servers config ja_JP: MCP Servers config pt_BR: MCP Servers config zh_Hans: MCP 服务配置 llm_description: '' max: null min: null name: servers_config options: [] placeholder: null precision: null required: false scope: null template: null type: string settings: prompts_as_tools: value: 1 resources_as_tools: value: 1 tool_description: 调用 MCP 服务端工具。 tool_label: 调用 MCP 工具 tool_name: mcp_sse_call_tool type: builtin agent_strategy_label: ReAct agent_strategy_name: ReAct agent_strategy_provider_name: langgenius/agent/agent desc: '' output_schema: null plugin_unique_identifier: langgenius/agent:0.0.16@3fd5abb87c9ebad7c9ad5abac32dbe396673285258ae2dac696b20143fb5e477 selected: false title: Agent type: agent height: 198 id: '1751004934996' position: x: 384 y: 282 positionAbsolute: x: 384 y: 282 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: desc: '' outputs: - value_selector: - '1751004934996' - text variable: result selected: false title: 结束 type: end height: 90 id: '1751004998309' position: x: 688 y: 282 positionAbsolute: x: 688 y: 282 sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: 226 y: 65.5 zoom: 1 ` ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:19:29 -05:00
yindo closed this issue 2026-02-21 19:19:29 -05:00
Author
Owner

@jepsonhu commented on GitHub (Jun 27, 2025):

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: agenttest
  use_icon_as_answer_icon: false
dependencies: []
kind: app
version: 0.3.0
workflow:
  conversation_variables: []
  environment_variables: []
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        image_file_size_limit: 10
        video_file_size_limit: 100
        workflow_file_upload_limit: 10
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
      number_limits: 3
    opening_statement: ''
    retriever_resource:
      enabled: true
    sensitive_word_avoidance:
      enabled: false
    speech_to_text:
      enabled: false
    suggested_questions: []
    suggested_questions_after_answer:
      enabled: false
    text_to_speech:
      enabled: false
      language: ''
      voice: ''
  graph:
    edges:
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: start
        targetType: agent
      id: 1751004638138-source-1751004934996-target
      source: '1751004638138'
      sourceHandle: source
      target: '1751004934996'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: agent
        targetType: end
      id: 1751004934996-source-1751004998309-target
      source: '1751004934996'
      sourceHandle: source
      target: '1751004998309'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables:
        - label: query
          max_length: 48
          options: []
          required: true
          type: text-input
          variable: query
      height: 90
      id: '1751004638138'
      position:
        x: 80
        y: 282
      positionAbsolute:
        x: 80
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        agent_parameters:
          instruction:
            type: constant
            value: 你是一个发票助手,通过mcpserver查询发票信息
          model:
            type: constant
            value:
              completion_params: {}
              mode: chat
              model: anthropic/claude-3.7-sonnet
              model_type: llm
              provider: langgenius/openrouter/openrouter
              type: model-selector
          query:
            type: constant
            value: '{{#1751004638138.query#}}'
          tools:
            type: constant
            value:
            - enabled: true
              extra:
                description: 调用 MCP 服务端工具。
              parameters:
                arguments:
                  auto: 1
                  value: null
                servers_config:
                  auto: 1
                  value: null
                tool_name:
                  auto: 1
                  value: null
              provider_name: junjiem/mcp_sse/mcp_sse
              schemas:
              - auto_generate: null
                default: null
                form: llm
                human_description:
                  en_US: Name of the tool to execute.
                  ja_JP: Name of the tool to execute.
                  pt_BR: Name of the tool to execute.
                  zh_Hans: 要执行的工具的名称。
                label:
                  en_US: Tool Name
                  ja_JP: Tool Name
                  pt_BR: Tool Name
                  zh_Hans: 工具名称
                llm_description: Name of the MCP tool to execute.
                max: null
                min: null
                name: tool_name
                options: []
                placeholder: null
                precision: null
                required: true
                scope: null
                template: null
                type: string
              - auto_generate: null
                default: null
                form: llm
                human_description:
                  en_US: Tool arguments (JSON string in the python dict[str, Any]
                    format).
                  ja_JP: Tool arguments (JSON string in the python dict[str, Any]
                    format).
                  pt_BR: Tool arguments (JSON string in the python dict[str, Any]
                    format).
                  zh_Hans: 工具的参数。
                label:
                  en_US: Arguments
                  ja_JP: Arguments
                  pt_BR: Arguments
                  zh_Hans: 参数
                llm_description: MCP Tool arguments (JSON string in the python dict[str,
                  Any] format).
                max: null
                min: null
                name: arguments
                options: []
                placeholder: null
                precision: null
                required: true
                scope: null
                template: null
                type: string
              - auto_generate: null
                default: 1
                form: form
                human_description:
                  en_US: Fetch and call the preset MCP Resources as Tools.
                  ja_JP: Fetch and call the preset MCP Resources as Tools.
                  pt_BR: Fetch and call the preset MCP Resources as Tools.
                  zh_Hans: 将预设的 MCP Resources 作为 Tools 返回和调用。
                label:
                  en_US: MCP Resources as Tools
                  ja_JP: MCP Resources as Tools
                  pt_BR: MCP Resources as Tools
                  zh_Hans: MCP 资源作为工具
                llm_description: ''
                max: null
                min: null
                name: resources_as_tools
                options: []
                placeholder: null
                precision: null
                required: true
                scope: null
                template: null
                type: boolean
              - auto_generate: null
                default: 1
                form: form
                human_description:
                  en_US: Fetch and call the preset MCP Prompts as Tools.
                  ja_JP: Fetch and call the preset MCP Prompts as Tools.
                  pt_BR: Fetch and call the preset MCP Prompts as Tools.
                  zh_Hans: 将预设的 MCP Prompts 作为 Tools 返回和调用。
                label:
                  en_US: MCP Prompts as Tools
                  ja_JP: MCP Prompts as Tools
                  pt_BR: MCP Prompts as Tools
                  zh_Hans: MCP 提示词作为工具
                llm_description: ''
                max: null
                min: null
                name: prompts_as_tools
                options: []
                placeholder: null
                precision: null
                required: true
                scope: null
                template: null
                type: boolean
              - auto_generate: null
                default: null
                form: llm
                human_description:
                  en_US: MCP Servers config, support multiple MCP services. (Optional,
                    Filling in this field will overwrite the MCP Servers config entered
                    during authorization.)
                  ja_JP: MCP Servers config, support multiple MCP services. (Optional,
                    Filling in this field will overwrite the MCP Servers config entered
                    during authorization.)
                  pt_BR: MCP Servers config, support multiple MCP services. (Optional,
                    Filling in this field will overwrite the MCP Servers config entered
                    during authorization.)
                  zh_Hans: MCP服务配置,支持多个MCP服务。 (选填,填写后将覆盖授权时填写的MCP服务配置。)
                label:
                  en_US: MCP Servers config
                  ja_JP: MCP Servers config
                  pt_BR: MCP Servers config
                  zh_Hans: MCP 服务配置
                llm_description: ''
                max: null
                min: null
                name: servers_config
                options: []
                placeholder: null
                precision: null
                required: false
                scope: null
                template: null
                type: string
              settings:
                prompts_as_tools:
                  value: 1
                resources_as_tools:
                  value: 1
              tool_description: 调用 MCP 服务端工具。
              tool_label: 调用 MCP 工具
              tool_name: mcp_sse_call_tool
              type: builtin
        agent_strategy_label: ReAct
        agent_strategy_name: ReAct
        agent_strategy_provider_name: langgenius/agent/agent
        desc: ''
        output_schema: null
        plugin_unique_identifier: langgenius/agent:0.0.16@3fd5abb87c9ebad7c9ad5abac32dbe396673285258ae2dac696b20143fb5e477
        selected: false
        title: Agent
        type: agent
      height: 198
      id: '1751004934996'
      position:
        x: 384
        y: 282
      positionAbsolute:
        x: 384
        y: 282
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1751004934996'
          - text
          variable: result
        selected: false
        title: 结束
        type: end
      height: 90
      id: '1751004998309'
      position:
        x: 688
        y: 282
      positionAbsolute:
        x: 688
        y: 282
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    viewport:
      x: 226
      y: 65.5
      zoom: 1

@jepsonhu commented on GitHub (Jun 27, 2025): ``` app: description: '' icon: 🤖 icon_background: '#FFEAD5' mode: workflow name: agenttest use_icon_as_answer_icon: false dependencies: [] kind: app version: 0.3.0 workflow: conversation_variables: [] environment_variables: [] features: file_upload: allowed_file_extensions: - .JPG - .JPEG - .PNG - .GIF - .WEBP - .SVG allowed_file_types: - image allowed_file_upload_methods: - local_file - remote_url enabled: false fileUploadConfig: audio_file_size_limit: 50 batch_count_limit: 5 file_size_limit: 15 image_file_size_limit: 10 video_file_size_limit: 100 workflow_file_upload_limit: 10 image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url number_limits: 3 opening_statement: '' retriever_resource: enabled: true sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: isInIteration: false isInLoop: false sourceType: start targetType: agent id: 1751004638138-source-1751004934996-target source: '1751004638138' sourceHandle: source target: '1751004934996' targetHandle: target type: custom zIndex: 0 - data: isInIteration: false isInLoop: false sourceType: agent targetType: end id: 1751004934996-source-1751004998309-target source: '1751004934996' sourceHandle: source target: '1751004998309' targetHandle: target type: custom zIndex: 0 nodes: - data: desc: '' selected: false title: 开始 type: start variables: - label: query max_length: 48 options: [] required: true type: text-input variable: query height: 90 id: '1751004638138' position: x: 80 y: 282 positionAbsolute: x: 80 y: 282 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: agent_parameters: instruction: type: constant value: 你是一个发票助手,通过mcpserver查询发票信息 model: type: constant value: completion_params: {} mode: chat model: anthropic/claude-3.7-sonnet model_type: llm provider: langgenius/openrouter/openrouter type: model-selector query: type: constant value: '{{#1751004638138.query#}}' tools: type: constant value: - enabled: true extra: description: 调用 MCP 服务端工具。 parameters: arguments: auto: 1 value: null servers_config: auto: 1 value: null tool_name: auto: 1 value: null provider_name: junjiem/mcp_sse/mcp_sse schemas: - auto_generate: null default: null form: llm human_description: en_US: Name of the tool to execute. ja_JP: Name of the tool to execute. pt_BR: Name of the tool to execute. zh_Hans: 要执行的工具的名称。 label: en_US: Tool Name ja_JP: Tool Name pt_BR: Tool Name zh_Hans: 工具名称 llm_description: Name of the MCP tool to execute. max: null min: null name: tool_name options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: null form: llm human_description: en_US: Tool arguments (JSON string in the python dict[str, Any] format). ja_JP: Tool arguments (JSON string in the python dict[str, Any] format). pt_BR: Tool arguments (JSON string in the python dict[str, Any] format). zh_Hans: 工具的参数。 label: en_US: Arguments ja_JP: Arguments pt_BR: Arguments zh_Hans: 参数 llm_description: MCP Tool arguments (JSON string in the python dict[str, Any] format). max: null min: null name: arguments options: [] placeholder: null precision: null required: true scope: null template: null type: string - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Resources as Tools. ja_JP: Fetch and call the preset MCP Resources as Tools. pt_BR: Fetch and call the preset MCP Resources as Tools. zh_Hans: 将预设的 MCP Resources 作为 Tools 返回和调用。 label: en_US: MCP Resources as Tools ja_JP: MCP Resources as Tools pt_BR: MCP Resources as Tools zh_Hans: MCP 资源作为工具 llm_description: '' max: null min: null name: resources_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: 1 form: form human_description: en_US: Fetch and call the preset MCP Prompts as Tools. ja_JP: Fetch and call the preset MCP Prompts as Tools. pt_BR: Fetch and call the preset MCP Prompts as Tools. zh_Hans: 将预设的 MCP Prompts 作为 Tools 返回和调用。 label: en_US: MCP Prompts as Tools ja_JP: MCP Prompts as Tools pt_BR: MCP Prompts as Tools zh_Hans: MCP 提示词作为工具 llm_description: '' max: null min: null name: prompts_as_tools options: [] placeholder: null precision: null required: true scope: null template: null type: boolean - auto_generate: null default: null form: llm human_description: en_US: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) ja_JP: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) pt_BR: MCP Servers config, support multiple MCP services. (Optional, Filling in this field will overwrite the MCP Servers config entered during authorization.) zh_Hans: MCP服务配置,支持多个MCP服务。 (选填,填写后将覆盖授权时填写的MCP服务配置。) label: en_US: MCP Servers config ja_JP: MCP Servers config pt_BR: MCP Servers config zh_Hans: MCP 服务配置 llm_description: '' max: null min: null name: servers_config options: [] placeholder: null precision: null required: false scope: null template: null type: string settings: prompts_as_tools: value: 1 resources_as_tools: value: 1 tool_description: 调用 MCP 服务端工具。 tool_label: 调用 MCP 工具 tool_name: mcp_sse_call_tool type: builtin agent_strategy_label: ReAct agent_strategy_name: ReAct agent_strategy_provider_name: langgenius/agent/agent desc: '' output_schema: null plugin_unique_identifier: langgenius/agent:0.0.16@3fd5abb87c9ebad7c9ad5abac32dbe396673285258ae2dac696b20143fb5e477 selected: false title: Agent type: agent height: 198 id: '1751004934996' position: x: 384 y: 282 positionAbsolute: x: 384 y: 282 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: desc: '' outputs: - value_selector: - '1751004934996' - text variable: result selected: false title: 结束 type: end height: 90 id: '1751004998309' position: x: 688 y: 282 positionAbsolute: x: 688 y: 282 sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: 226 y: 65.5 zoom: 1 ```
Author
Owner

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

Hi @jepsonhu! I'm Dosu and I’m helping the dify team.

The error 'AgentRuntime' object has no attribute 'model' is caused by a contract mismatch between Dify and the agent plugin. The plugin (or strategy) expects a .model attribute on the runtime object, but the data passed from Dify is likely a dict or structured differently—often due to changes in how the model-selector parameter is handled in the DSL and code. This usually happens if the plugin expects something like params['model'].model but receives a dict (possibly with an entity key) instead, leading to the AttributeError [source].

To resolve this, check that your plugin version (langgenius/agent:0.0.16) is compatible with Dify v1.5.0 and that both sides expect the same structure for the model parameter. If you maintain the plugin, ensure it can handle the structure Dify now provides (likely a dict with model info, not a flat object). If not, you may need to update the plugin or reach out to the plugin author for a fix.

If you can modify the plugin, make sure it accesses the model info correctly (e.g., if params['model'] is a dict, use params['model']['model'] or similar, depending on the structure). This should prevent the AttributeError and allow the agent node to function as expected.

Let me know if you need help inspecting the plugin code or want to share more details about the plugin implementation for further troubleshooting.

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 27, 2025): <!-- Greeting --> Hi @jepsonhu! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The error `'AgentRuntime' object has no attribute 'model'` is caused by a contract mismatch between Dify and the agent plugin. The plugin (or strategy) expects a `.model` attribute on the runtime object, but the data passed from Dify is likely a dict or structured differently—often due to changes in how the `model-selector` parameter is handled in the DSL and code. This usually happens if the plugin expects something like `params['model'].model` but receives a dict (possibly with an `entity` key) instead, leading to the AttributeError [[source]](https://github.com/langgenius/dify/blob/cdb9eecbafdb98c8311ac925b652d077eb91ce4c/api/core/workflow/nodes/agent/agent_node.py). To resolve this, check that your plugin version (`langgenius/agent:0.0.16`) is compatible with Dify v1.5.0 and that both sides expect the same structure for the `model` parameter. If you maintain the plugin, ensure it can handle the structure Dify now provides (likely a dict with model info, not a flat object). If not, you may need to update the plugin or reach out to the plugin author for a fix. If you can modify the plugin, make sure it accesses the model info correctly (e.g., if `params['model']` is a dict, use `params['model']['model']` or similar, depending on the structure). This should prevent the AttributeError and allow the agent node to function as expected. Let me know if you need help inspecting the plugin code or want to share more details about the plugin implementation for further troubleshooting. <!-- 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/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0a40ace3-d840-49cf-9614-f7bafb7c6fb3?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/21615)
Author
Owner

@Egoistsoul commented on GitHub (Jul 9, 2025):

Agent node mismatch with the plugin. Update your agent plugin to the latest version.

@Egoistsoul commented on GitHub (Jul 9, 2025): Agent node mismatch with the plugin. Update your agent plugin to the latest version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14949