Skip to content

The Agent node is stuck in the Running state #22896

Closed

Description

@Uynaity

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In Workflow, under an Agent node, configuring any Tool but failing to call it correctly during runtime and producing no output.

Image

However, in Agent, it can correctly call the Tool and return content.

Image

My Dify Agent Plugin version: 0.0.22

Image

✔️ Expected Behavior

It can correctly call Tools within Workflow and return values.

❌ Actual Behavior

In the Workflow, the Agent node has been unresponsive until timeout.

Activity

  1. added
    🤖 feat:agent
    on Jul 24, 2025
  2. Uynaity commented on Jul 24, 2025

    @Uynaity
    Author

    The agent node will continue in this state, producing no output, until timeout.
    Image

  3. dosubot commented on Jul 24, 2025

    @dosubot

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

    This issue is likely caused by how tool parameters are mapped or initialized in the workflow context. If any required tool parameters are missing or malformed in the workflow's variable pool, the Agent node can hang until timeout without producing output—even if the tool works in direct Agent mode.

    A recent fix (PR #22462, merged 2025-07-21) addresses tool node version judgment in workflows, which could resolve this problem if you upgrade to the latest Dify version.

    If you can't upgrade right away, double-check your workflow tool node configuration: make sure all required tool parameters are explicitly set and match what works in Agent mode. Avoid relying on defaults or legacy parameter mapping.

    Enabling debug logging and checking for errors or stack traces when the node times out may also help pinpoint the issue. If you can share relevant logs or more details about your workflow/tool configuration, I can help dig deeper.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  4. added
    🐞 bug
    and removed
    🤖 feat:agent
    on Jul 24, 2025
  5. yanyiup commented on Jul 24, 2025

    @yanyiup

    I also encountered the same problem

    Image
  6. Uynaity commented on Jul 24, 2025

    @Uynaity
    Author

    @dosu These are some potentially relevant logs retrieve from docker image docker-api-1:

    2025-07-24 07:56:02.148 ERROR [Thread-284 (_generate_worker)] [graph_engine.py:851] - Node Agent run failed
    Traceback (most recent call last):
      File "/app/api/core/workflow/graph_engine/graph_engine.py", line 648, in _run_node
        for event in event_stream:
                     ^^^^^^^^^^^^
      File "/app/api/core/workflow/nodes/base/node.py", line 78, in run
        yield from result
      File "/app/api/core/workflow/nodes/agent/agent_node.py", line 150, in _run
        yield from self._transform_message(
      File "/app/api/core/workflow/nodes/agent/agent_node.py", line 496, in _transform_message
        for message in message_stream:
                       ^^^^^^^^^^^^^^
      File "/app/api/core/tools/utils/message_transformer.py", line 25, in transform_tool_invoke_messages
        for message in messages:
                       ^^^^^^^^
      File "/app/api/core/agent/strategy/base.py", line 27, in invoke
        yield from self._invoke(params, user_id, conversation_id, app_id, message_id, credentials)
      File "/app/api/core/agent/strategy/plugin.py", line 54, in _invoke
        yield from manager.invoke(
      File "/app/api/core/plugin/impl/base.py", line 211, in _request_with_plugin_daemon_response_stream
        self._handle_plugin_daemon_error(error.error_type, error.message)
      File "/app/api/core/plugin/impl/base.py", line 247, in _handle_plugin_daemon_error
        raise PluginDaemonInternalServerError(description=message)
    core.plugin.impl.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout
  7. dosubot commented on Jul 24, 2025

    @dosubot

    The error trace shows that the Agent node in your workflow is timing out due to a PluginDaemonInternalServerError, which means the plugin daemon didn't respond in time. This often happens if required tool parameters are missing or not mapped correctly from the workflow's variable pool—so the tool call hangs until the timeout, even if it works in direct Agent mode.

    A recent fix improved how tool node versions are handled in workflows, which may resolve this issue if you upgrade to the latest Dify version. If you can't upgrade yet, double-check that all required tool parameters are explicitly set in your workflow and match what works in Agent mode. Also, make sure your plugin daemon container has enough resources and is running healthily.

    Enabling debug logging and monitoring resource usage on your plugin daemon container can help pinpoint if resource constraints are contributing to the timeout. If the problem persists, sharing your exact Agent node/tool configuration and resource stats would help with deeper troubleshooting.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

  8. Uynaity commented on Jul 24, 2025

    @Uynaity
    Author

    I found the cause of the problem.

    After I check the logs of docker image docker-plugin_daemon-1, I found the Dify Agent Plugin version 0.0.22 had the following error frequently #(almost every second.):

    2025/07/24 08:14:49 run.go:135: [ERROR]plugin langgenius/agent:0.0.22 exited with error: exit status 1
    fy_plugin/core/utils/class_loader.py", line 34, in import_module_from_source
    
        raise e
    
      File "/app/storage/cwd/langgenius/agent-0.0.22@93bb2520bf578b9b369441db235f9bc8abdfd7a9936f9b86d7c97ef99a7ed4b2/.venv/lib/python3.12/site-packages/dify_plugin/core/utils/class_loader.py", line 31, in import_module_from_source
    
        spec.loader.exec_module(module)
    
      File "<frozen importlib._bootstrap_external>", line 995, in exec_module
      File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
      File "/app/storage/cwd/langgenius/agent-0.0.22@93bb2520bf578b9b369441db235f9bc8abdfd7a9936f9b86d7c97ef99a7ed4b2/strategies/function_calling.py", line 23, in <module>
    
        from dify_plugin.entities.tool import LogMetadata, ToolInvokeMessage, ToolProviderType
    
    ImportError: cannot import name 'LogMetadata' from 'dify_plugin.entities.tool' (/app/storage/cwd/langgenius/agent-0.0.22@93bb2520bf578b9b369441db235f9bc8abdfd7a9936f9b86d7c97ef99a7ed4b2/.venv/lib/python3.12/site-packages/dify_plugin/entities/tool.py)

    After downgrading the plugin to version 0.0.19, everything is fine.

    Image
  9. yanyiup commented on Jul 24, 2025

    @yanyiup
    Image
  10. Uynaity commented on Jul 25, 2025

    @Uynaity
    Author

    version 0.0.23 works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions