Agent strategy run cut by PLUGIN_MAX_EXECUTION_TIMEOUT is reported only as "Internal Server Error"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
Research direction
Start at the <-timer.C branch in internal/service/base_sse.go, where the timeout currently calls exception.InternalServerError, then read internal/types/exception/factory.go to see how error types and messages are built. Reproduce by setting a short PLUGIN_MAX_EXECUTION_TIMEOUT and running a long agent strategy dispatch. Done means a timeout returns its own error type and message naming the configured limit, while client disconnects and real internal errors keep their existing types.
Written by the indexing model from the issue text.
Description
Self Checks
To make sure we get to you in time, please check the following :)
- 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."
Versions
- dify-plugin-daemon Version: 0.6.14-local
- dify-api Version: 1.19.0 (self-hosted docker-compose). The same defaults and code path are present in 1.20.0 and in current
mainof this repo.
Agent strategy plugin: langgenius/agent 0.0.51 (Function Calling). Model plugin: langgenius/openai_api_compatible 0.0.84.
Describe the bug
PLUGIN_MAX_EXECUTION_TIMEOUT (default 600) caps the whole dispatch/agent_strategy/invoke stream, so it is effectively the maximum total runtime of an Agent node in a workflow, not just a single model or tool call. That limit by itself is reasonable and configurable. The problem is how it is reported.
When the timer fires, baseSSEService writes exception.InternalServerError(errors.New("killed by timeout")) (internal/service/base_sse.go, the <-timer.C branch). InternalServerError logs the real reason and returns the fixed message "Internal Server Error" (internal/types/exception/factory.go). The workflow therefore fails with only:
req_id: <id> PluginDaemonInternalServerError: Internal Server Error
Nothing in the run tells the user that a time limit was reached, or which setting controls it. The reason is visible only in the daemon's own log:
ERROR dify-plugin-daemon factory.go:28 PluginDaemonInternalServerError error="killed by timeout"
Many people hit this generic message and it gets mixed up with other causes, for example #760 (a stream that never closes) and #371 / #290. A run that really is long and a run that hangs look identical from the Dify side.
To Reproduce
- Self-hosted docker-compose with default plugin daemon settings (
PLUGIN_MAX_EXECUTION_TIMEOUT=600). - Create a workflow
Start → Agent (Function Calling, Maximum Iterations 30) → End. Give the Agent one API tool that takes 50 s per call, and a model that keeps calling the tool, about 22 calls (~18 minutes in total). Every individual model and tool call is well under its own per-call timeout. - Run the workflow through the API in streaming mode.
- The Agent node fails at 600.2 s with
PluginDaemonInternalServerError: Internal Server Error. The daemon log showskilled by timeout. - Set
PLUGIN_MAX_EXECUTION_TIMEOUT=2400on the plugin daemon, restart it and run the same workflow again: it succeeds in 1101 s.
Expected behavior
- When the execution timer fires, return a timeout-specific error type and message that the API can pass on to the user. For example:
plugin execution exceeded PLUGIN_MAX_EXECUTION_TIMEOUT (600s). A client disconnect or a real internal error would keep its own type. - Document, next to
PLUGIN_MAX_EXECUTION_TIMEOUTin the env examples, that it also limits the total runtime of an Agent node (the whole agent strategy run), so long-running agents need it raised.
Screenshots
N/A
Additional context
The test used a mock OpenAI-compatible model endpoint and a mock HTTP tool, so model latency was not a factor. Raising only this one setting moved the cut-off, which confirms it is the limit that applies.
- Dominant language
- Go
- Stars
- 462
- Forks
- 326
- Avg merge
- 22h 15m
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from langgenius/dify-plugin-daemon
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
langgenius/dify-plugin-daemon#862 ·
Maintainers usually reply within 1 day
-
fix(install): prevent mirror settings from changing dependency resolution inputsPossibly taken @WH-2099 claimed this 5 days ago. Openproject#dify-plugin-daemon
langgenius/dify-plugin-daemon#860 · 1 assignee ·
Maintainers usually reply within 1 day
-
READONLY error when using Redis 6.2.2 Sentinel cluster on Kubernetes with dify-plugin-daemon 0.6.10-localPossibly taken @Souravrajvi0 claimed this 60 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
langgenius/dify-plugin-daemon#826 · 2 comments ·
Maintainers usually reply within 1 day
-
uninstall the plugin, but the plugin package is not removedPossibly taken @fatelei claimed this 111 days ago. Openbug plugin-daemon
Difficulty 3/5 1-2 days Newbie friendliness 38/100
langgenius/dify-plugin-daemon#797 · 2 comments ·
Maintainers usually reply within 1 day
-
bug plugin-daemon project#dify-plugin-daemon
Difficulty 4/5 3-5 days Newbie friendliness 45/100
langgenius/dify-plugin-daemon#771 · 2 comments ·
Maintainers usually reply within 1 day
All issues in langgenius/dify-plugin-daemon
Similar issues
-
Area/Agent Lifecycle Aspect/Build & Deploy Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
wso2/agent-manager#2603 ·
Maintainers usually reply within 1 day
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outPossibly taken @anoop2811 claimed this today. Openneeds-triage type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Area/Policies Aspect/API Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
wso2/api-platform#4468 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
dsx-ai-factory/health-validation#368 ·
Maintainers usually reply within 2 days