Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(docker): harden agent compose configuration (#41065)
盐粒 Yanli45cb385d778e
diff --git a/api/.env.example b/api/.env.exampleindex 0896ee87c89..fbbbc59a305 100644--- a/api/.env.example+++ b/api/.env.example@@ -100,9 +100,9 @@ CELERY_BACKEND=redis# Ops trace configurationOPS_TRACE_UNIFIED_ENABLED=false-OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES=300+OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES=780OPS_TRACE_RETRYABLE_DISPATCH_DELAY_SECONDS=5-OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS=1800+OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS=3900# Database configurationDB_TYPE=postgresql@@ -587,7 +587,7 @@ INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000# Workflow runtime configurationWORKFLOW_MAX_EXECUTION_STEPS=500-WORKFLOW_MAX_EXECUTION_TIME=1200+WORKFLOW_MAX_EXECUTION_TIME=3600WORKFLOW_CALL_MAX_DEPTH=5MAX_VARIABLE_SIZE=204800# Maximum concurrent node-builder LLM calls per workflow generation request@@ -632,7 +632,7 @@ WORKFLOW_LOG_CLEANUP_BATCH_SIZE=100WORKFLOW_LOG_CLEANUP_SPECIFIC_WORKFLOW_IDS=# App configuration-APP_MAX_EXECUTION_TIME=1200+APP_MAX_EXECUTION_TIME=3600APP_DEFAULT_ACTIVE_REQUESTS=0APP_MAX_ACTIVE_REQUESTS=0diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex c3f1be5d045..88ed67acce9 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -84,7 +84,7 @@ class AppExecutionConfig(BaseSettings):APP_MAX_EXECUTION_TIME: PositiveInt = Field(description="Maximum allowed execution time for the application in seconds",- default=1200,+ default=3600,)APP_DEFAULT_ACTIVE_REQUESTS: NonNegativeInt = Field(description="Default number of concurrent active requests per app (0 for unlimited)",@@ -890,7 +890,7 @@ class WorkflowConfig(BaseSettings):WORKFLOW_MAX_EXECUTION_TIME: PositiveInt = Field(description="Maximum execution time in seconds for a single workflow",- default=1200,+ default=3600,)WORKFLOW_CALL_MAX_DEPTH: PositiveInt = Field(@@ -1346,7 +1346,7 @@ class OpsTraceConfig(BaseSettings):# Recommended: max_retries >= ceil((WORKFLOW_MAX_EXECUTION_TIME + grace_seconds) / delay_seconds).OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES: PositiveInt = Field(description="Maximum retry attempts for transient ops trace provider dispatch failures.",- default=300,+ default=780,)OPS_TRACE_RETRYABLE_DISPATCH_DELAY_SECONDS: PositiveInt = Field(@@ -1356,7 +1356,7 @@ class OpsTraceConfig(BaseSettings):OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS: PositiveInt = Field(description="Retention in seconds for unified tracing parent contexts.",- default=1800,+ default=3900,)@model_validator(mode="after")diff --git a/api/tests/unit_tests/configs/test_dify_config.py b/api/tests/unit_tests/configs/test_dify_config.pyindex c4aa23ced0f..8e9547ad68f 100644--- a/api/tests/unit_tests/configs/test_dify_config.py+++ b/api/tests/unit_tests/configs/test_dify_config.py@@ -98,6 +98,10 @@ def test_dify_config():assert config.SENTRY_TRACES_SAMPLE_RATE == 1.0assert config.TEMPLATE_TRANSFORM_MAX_LENGTH == 400_000assert config.GRAPH_ENGINE_SCALE_UP_THRESHOLD == 0+ assert config.APP_MAX_EXECUTION_TIME == 3600+ assert config.WORKFLOW_MAX_EXECUTION_TIME == 3600+ assert config.OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES == 780+ assert config.OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS == 3900# annotated field with custom configured valueassert config.HTTP_REQUEST_MAX_READ_TIMEOUT == 300diff --git a/dify-agent/docs/dify-agent/guide/index.md b/dify-agent/docs/dify-agent/guide/index.mdindex 99e2cc8e2b1..de72c0ba286 100644--- a/dify-agent/docs/dify-agent/guide/index.md+++ b/dify-agent/docs/dify-agent/guide/index.md@@ -226,11 +226,13 @@ Agent run deadline owns the terminal `agent_run_limit_exceeded` failure.Run the disposable Local contract from the `dify-agent` directory. The scriptstarts one local-sandbox container on an unused port and removes that exact-container on exit:+container on exit. It intentionally has no image fallback: provide a Local+Sandbox image built from the same commit as the code under test so an older+shellctl implementation cannot make the lifecycle contract pass incorrectly:```bashcd dify-agent-DIFY_AGENT_TEST_LOCAL_SANDBOX_IMAGE=langgenius/dify-agent-local-sandbox:1.16.0 \+DIFY_AGENT_TEST_LOCAL_SANDBOX_IMAGE=<same-commit-local-sandbox-image> \tests/integration/dify_agent/runtime_backend/run_local_integration.sh```diff --git a/dify-agent/tests/integration/dify_agent/runtime_backend/run_local_integration.sh b/dify-agent/tests/integration/dify_agent/runtime_backend/run_local_integration.shindex 1247636b058..f5780157ac9 100755--- a/dify-agent/tests/integration/dify_agent/runtime_backend/run_local_integration.sh+++ b/dify-agent/tests/integration/dify_agent/runtime_backend/run_local_integration.sh@@ -1,10 +1,10 @@#!/usr/bin/env shset -eu-script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)-project_dir=$(CDPATH= cd -- "$script_dir/../../../.." && pwd)+script_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)+project_dir=$(CDPATH='' cd -- "$script_dir/../../../.." && pwd)container_name="dify-agent-runtime-backend-integration-$$"-image="${DIFY_AGENT_TEST_LOCAL_SANDBOX_IMAGE:-langgenius/dify-agent-local-sandbox:1.16.0}"+image="${DIFY_AGENT_TEST_LOCAL_SANDBOX_IMAGE:?set DIFY_AGENT_TEST_LOCAL_SANDBOX_IMAGE to a Local Sandbox image built from the same commit}"token="${DIFY_AGENT_TEST_LOCAL_SHELLCTL_AUTH_TOKEN:-runtime-backend-integration}"cleanup() {diff --git a/docker/.env.example b/docker/.env.exampleindex f59b913c1da..2020a70017e 100644--- a/docker/.env.example+++ b/docker/.env.example@@ -258,18 +258,8 @@ AGENT_BACKEND_BASE_URL=http://agent_backend:5050# Replace this development default in production.# Generate one with: python -c 'import secrets; print(secrets.token_urlsafe(32))'DIFY_AGENT_API_TOKEN=dify-agent-run-token-for-dev-only-AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS=30-AGENT_BACKEND_STREAM_MAX_RECONNECTS=3-# Client timeout for Agent backend calls that may carry a Home Snapshot transfer.-# Must stay above DIFY_AGENT_ENTERPRISE_SANDBOX_SNAPSHOT_TIMEOUT on the Agent backend.-AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS=45# Leave empty to derive from REDIS_PASSWORD.DIFY_AGENT_REDIS_URL=-DIFY_AGENT_REDIS_PREFIX=dify-agent-DIFY_AGENT_SHUTDOWN_GRACE_SECONDS=30-DIFY_AGENT_RUN_RETENTION_SECONDS=259200-# Pydantic AI run deadline; its default matches the independently configurable E2B active timeout.-DIFY_AGENT_RUN_TIMEOUT_SECONDS=3600# Leave empty to derive from PLUGIN_DAEMON_URL and PLUGIN_DAEMON_KEY.DIFY_AGENT_PLUGIN_DAEMON_URL=DIFY_AGENT_PLUGIN_DAEMON_API_KEY=@@ -281,12 +271,6 @@ DIFY_AGENT_INNER_API_KEY=DIFY_AGENT_RUNTIME_BACKEND=localDIFY_AGENT_LOCAL_SANDBOX_ENDPOINT=http://local_sandbox:5004DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN=-# E2B_API_KEY and E2B_API_TOKEN remain accepted as deployment-level fallbacks.-DIFY_AGENT_E2B_API_KEY=-DIFY_AGENT_E2B_TEMPLATE=difys-default-team/dify-agent-local-sandbox-# RuntimeLease active limit; its default matches the independently configurable Agent run deadline.-DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS=3600-DIFY_AGENT_E2B_SHELLCTL_PORT=5004# Sandbox-reachable Dify API base for dify-agent CLI /files/* transfers.# Remote Sandboxes should use the public Dify ingress; local Compose uses api via agent_ssrf_proxy.DIFY_AGENT_SANDBOX_FILES_BASE_URL=http://api:5001diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yamlindex a0fb52b6ab2..29f2b095922 100644--- a/docker/docker-compose-template.yaml+++ b/docker/docker-compose-template.yaml@@ -233,9 +233,6 @@ services:INNER_API_KEY_FOR_PLUGIN: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}AGENT_BACKEND_BASE_URL: ${AGENT_BACKEND_BASE_URL:-http://agent_backend:5050}AGENT_BACKEND_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS: ${AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS:-30}- AGENT_BACKEND_STREAM_MAX_RECONNECTS: ${AGENT_BACKEND_STREAM_MAX_RECONNECTS:-3}- AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS: ${AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS:-45}depends_on:init_permissions:condition: service_completed_successfully@@ -312,9 +309,6 @@ services:INNER_API_KEY_FOR_PLUGIN: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}AGENT_BACKEND_BASE_URL: ${AGENT_BACKEND_BASE_URL:-http://agent_backend:5050}AGENT_BACKEND_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS: ${AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS:-30}- AGENT_BACKEND_STREAM_MAX_RECONNECTS: ${AGENT_BACKEND_STREAM_MAX_RECONNECTS:-3}- AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS: ${AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS:-45}depends_on:init_permissions:condition: service_completed_successfully@@ -556,6 +550,9 @@ services:- HTTP_PROXY=http://agent_ssrf_proxy:3128- HTTPS_PROXY=http://agent_ssrf_proxy:3128- NO_PROXY=localhost,127.0.0.1+ volumes:+ - dify_agent_local_sandbox_home:/home/dify+ - dify_agent_local_sandbox_workspace:/workspacehealthcheck:test: ["CMD", "curl", "-f", "http://localhost:5004/healthz"]interval: 30s@@ -667,7 +664,6 @@ services:- ./.envenvironment:DIFY_AGENT_REDIS_URL: ${DIFY_AGENT_REDIS_URL:-redis://:${REDIS_PASSWORD:-difyai123456}@redis:6379/2}- DIFY_AGENT_REDIS_PREFIX: ${DIFY_AGENT_REDIS_PREFIX:-dify-agent}DIFY_AGENT_PLUGIN_DAEMON_URL: ${DIFY_AGENT_PLUGIN_DAEMON_URL:-${PLUGIN_DAEMON_URL:-http://plugin_daemon:5002}}DIFY_AGENT_PLUGIN_DAEMON_API_KEY: ${DIFY_AGENT_PLUGIN_DAEMON_API_KEY:-${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi}}DIFY_AGENT_INNER_API_URL: ${DIFY_AGENT_INNER_API_URL:-${PLUGIN_DIFY_INNER_API_URL:-http://api:5001}}@@ -675,11 +671,6 @@ services:DIFY_AGENT_RUNTIME_BACKEND: ${DIFY_AGENT_RUNTIME_BACKEND:-local}DIFY_AGENT_LOCAL_SANDBOX_ENDPOINT: ${DIFY_AGENT_LOCAL_SANDBOX_ENDPOINT:-${DIFY_AGENT_SHELLCTL_ENTRYPOINT:-http://local_sandbox:5004}}DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN: ${DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN:-${DIFY_AGENT_SHELLCTL_AUTH_TOKEN:-}}- DIFY_AGENT_E2B_API_KEY: ${DIFY_AGENT_E2B_API_KEY:-${E2B_API_KEY:-${E2B_API_TOKEN:-}}}- DIFY_AGENT_E2B_TEMPLATE: ${DIFY_AGENT_E2B_TEMPLATE:-difys-default-team/dify-agent-local-sandbox}- # RuntimeLease active limit; its default matches the independently configurable Agent run deadline.- DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS: ${DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS:-3600}- DIFY_AGENT_E2B_SHELLCTL_PORT: ${DIFY_AGENT_E2B_SHELLCTL_PORT:-5004}DIFY_AGENT_STUB_API_BASE_URL: ${DIFY_AGENT_STUB_API_BASE_URL:-http://agent_backend:5050/agent-stub}DIFY_AGENT_SANDBOX_FILES_BASE_URL: ${DIFY_AGENT_SANDBOX_FILES_BASE_URL:-http://api:5001}# This is security-sensitive: it derives the JWE encryption key for Agent Stub bearer tokens.@@ -687,10 +678,6 @@ services:# Generate one with: python -c 'import secrets; print(secrets.token_urlsafe(32))'DIFY_AGENT_SERVER_SECRET_KEY: ${DIFY_AGENT_SERVER_SECRET_KEY:-MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY}DIFY_AGENT_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- DIFY_AGENT_SHUTDOWN_GRACE_SECONDS: ${DIFY_AGENT_SHUTDOWN_GRACE_SECONDS:-30}- DIFY_AGENT_RUN_RETENTION_SECONDS: ${DIFY_AGENT_RUN_RETENTION_SECONDS:-259200}- # Pydantic AI run deadline; its default matches the independently configurable E2B active timeout.- DIFY_AGENT_RUN_TIMEOUT_SECONDS: ${DIFY_AGENT_RUN_TIMEOUT_SECONDS:-3600}depends_on:redis:condition: service_started@@ -1329,3 +1316,5 @@ networks:volumes:oradata:dify_es01_data:+ dify_agent_local_sandbox_home:+ dify_agent_local_sandbox_workspace:diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yamlindex 49582227d95..e34dd05bbbb 100644--- a/docker/docker-compose.yaml+++ b/docker/docker-compose.yaml@@ -239,9 +239,6 @@ services:INNER_API_KEY_FOR_PLUGIN: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}AGENT_BACKEND_BASE_URL: ${AGENT_BACKEND_BASE_URL:-http://agent_backend:5050}AGENT_BACKEND_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS: ${AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS:-30}- AGENT_BACKEND_STREAM_MAX_RECONNECTS: ${AGENT_BACKEND_STREAM_MAX_RECONNECTS:-3}- AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS: ${AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS:-45}depends_on:init_permissions:condition: service_completed_successfully@@ -318,9 +315,6 @@ services:INNER_API_KEY_FOR_PLUGIN: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}AGENT_BACKEND_BASE_URL: ${AGENT_BACKEND_BASE_URL:-http://agent_backend:5050}AGENT_BACKEND_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS: ${AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS:-30}- AGENT_BACKEND_STREAM_MAX_RECONNECTS: ${AGENT_BACKEND_STREAM_MAX_RECONNECTS:-3}- AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS: ${AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS:-45}depends_on:init_permissions:condition: service_completed_successfully@@ -562,6 +556,9 @@ services:- HTTP_PROXY=http://agent_ssrf_proxy:3128- HTTPS_PROXY=http://agent_ssrf_proxy:3128- NO_PROXY=localhost,127.0.0.1+ volumes:+ - dify_agent_local_sandbox_home:/home/dify+ - dify_agent_local_sandbox_workspace:/workspacehealthcheck:test: ["CMD", "curl", "-f", "http://localhost:5004/healthz"]interval: 30s@@ -673,7 +670,6 @@ services:- ./.envenvironment:DIFY_AGENT_REDIS_URL: ${DIFY_AGENT_REDIS_URL:-redis://:${REDIS_PASSWORD:-difyai123456}@redis:6379/2}- DIFY_AGENT_REDIS_PREFIX: ${DIFY_AGENT_REDIS_PREFIX:-dify-agent}DIFY_AGENT_PLUGIN_DAEMON_URL: ${DIFY_AGENT_PLUGIN_DAEMON_URL:-${PLUGIN_DAEMON_URL:-http://plugin_daemon:5002}}DIFY_AGENT_PLUGIN_DAEMON_API_KEY: ${DIFY_AGENT_PLUGIN_DAEMON_API_KEY:-${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi}}DIFY_AGENT_INNER_API_URL: ${DIFY_AGENT_INNER_API_URL:-${PLUGIN_DIFY_INNER_API_URL:-http://api:5001}}@@ -681,11 +677,6 @@ services:DIFY_AGENT_RUNTIME_BACKEND: ${DIFY_AGENT_RUNTIME_BACKEND:-local}DIFY_AGENT_LOCAL_SANDBOX_ENDPOINT: ${DIFY_AGENT_LOCAL_SANDBOX_ENDPOINT:-${DIFY_AGENT_SHELLCTL_ENTRYPOINT:-http://local_sandbox:5004}}DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN: ${DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN:-${DIFY_AGENT_SHELLCTL_AUTH_TOKEN:-}}- DIFY_AGENT_E2B_API_KEY: ${DIFY_AGENT_E2B_API_KEY:-${E2B_API_KEY:-${E2B_API_TOKEN:-}}}- DIFY_AGENT_E2B_TEMPLATE: ${DIFY_AGENT_E2B_TEMPLATE:-difys-default-team/dify-agent-local-sandbox}- # RuntimeLease active limit; its default matches the independently configurable Agent run deadline.- DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS: ${DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS:-3600}- DIFY_AGENT_E2B_SHELLCTL_PORT: ${DIFY_AGENT_E2B_SHELLCTL_PORT:-5004}DIFY_AGENT_STUB_API_BASE_URL: ${DIFY_AGENT_STUB_API_BASE_URL:-http://agent_backend:5050/agent-stub}DIFY_AGENT_SANDBOX_FILES_BASE_URL: ${DIFY_AGENT_SANDBOX_FILES_BASE_URL:-http://api:5001}# This is security-sensitive: it derives the JWE encryption key for Agent Stub bearer tokens.@@ -693,10 +684,6 @@ services:# Generate one with: python -c 'import secrets; print(secrets.token_urlsafe(32))'DIFY_AGENT_SERVER_SECRET_KEY: ${DIFY_AGENT_SERVER_SECRET_KEY:-MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY}DIFY_AGENT_API_TOKEN: ${DIFY_AGENT_API_TOKEN:-dify-agent-run-token-for-dev-only}- DIFY_AGENT_SHUTDOWN_GRACE_SECONDS: ${DIFY_AGENT_SHUTDOWN_GRACE_SECONDS:-30}- DIFY_AGENT_RUN_RETENTION_SECONDS: ${DIFY_AGENT_RUN_RETENTION_SECONDS:-259200}- # Pydantic AI run deadline; its default matches the independently configurable E2B active timeout.- DIFY_AGENT_RUN_TIMEOUT_SECONDS: ${DIFY_AGENT_RUN_TIMEOUT_SECONDS:-3600}depends_on:redis:condition: service_started@@ -1335,3 +1322,5 @@ networks:volumes:oradata:dify_es01_data:+ dify_agent_local_sandbox_home:+ dify_agent_local_sandbox_workspace:diff --git a/docker/envs/core-services/dify-agent.env.example b/docker/envs/core-services/dify-agent.env.exampleindex ade21650e2a..e4ab19342a3 100644--- a/docker/envs/core-services/dify-agent.env.example+++ b/docker/envs/core-services/dify-agent.env.example@@ -3,18 +3,28 @@# ------------------------------AGENT_BACKEND_BASE_URL=http://agent_backend:5050-AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS=30-AGENT_BACKEND_STREAM_MAX_RECONNECTS=3# Leave empty to derive from REDIS_PASSWORD in Docker Compose.DIFY_AGENT_REDIS_URL=DIFY_AGENT_REDIS_PREFIX=dify-agentDIFY_AGENT_SHUTDOWN_GRACE_SECONDS=30DIFY_AGENT_RUN_RETENTION_SECONDS=259200-# Pydantic AI run deadline; its default matches the independently configurable E2B active timeout.+# Internal deadline for the Agent Backend model/tool loop. The effective run+# limit is whichever expires first: this value or the relevant API/Workflow+# outer execution limit. To allow every path to run for one hour, also set+# APP_MAX_EXECUTION_TIME and WORKFLOW_MAX_EXECUTION_TIME to at least 3600.DIFY_AGENT_RUN_TIMEOUT_SECONDS=3600DIFY_AGENT_BINDING_FILE_DOWNLOAD_COMMAND_TIMEOUT_SECONDS=210+# Shared outbound HTTP client timeouts and connection limits.+DIFY_AGENT_OUTBOUND_HTTP_CONNECT_TIMEOUT=10+DIFY_AGENT_OUTBOUND_HTTP_READ_TIMEOUT=600+DIFY_AGENT_OUTBOUND_HTTP_WRITE_TIMEOUT=30+DIFY_AGENT_OUTBOUND_HTTP_POOL_TIMEOUT=10+DIFY_AGENT_OUTBOUND_HTTP_MAX_CONNECTIONS=100+DIFY_AGENT_OUTBOUND_HTTP_MAX_KEEPALIVE_CONNECTIONS=20+DIFY_AGENT_OUTBOUND_HTTP_KEEPALIVE_EXPIRY=30+# Leave empty to derive from PLUGIN_DAEMON_URL and PLUGIN_DAEMON_KEY in Docker Compose.DIFY_AGENT_PLUGIN_DAEMON_URL=DIFY_AGENT_PLUGIN_DAEMON_API_KEY=@@ -29,7 +39,7 @@ DIFY_AGENT_RUNTIME_BACKEND=localDIFY_AGENT_LOCAL_SANDBOX_ENDPOINT=http://local_sandbox:5004DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN=# E2B_API_KEY and E2B_API_TOKEN remain accepted as deployment-level fallbacks.-DIFY_AGENT_E2B_API_KEY=+DIFY_AGENT_E2B_API_KEY=${DIFY_AGENT_E2B_API_KEY:-${E2B_API_KEY:-${E2B_API_TOKEN:-}}}DIFY_AGENT_E2B_TEMPLATE=difys-default-team/dify-agent-local-sandbox# RuntimeLease active limit; its default matches the independently configurable Agent run deadline.DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS=3600diff --git a/docker/envs/core-services/shared.env.example b/docker/envs/core-services/shared.env.exampleindex dead019db72..d2322a4e94e 100644--- a/docker/envs/core-services/shared.env.example+++ b/docker/envs/core-services/shared.env.example@@ -98,11 +98,11 @@ DEBUG=falseFLASK_DEBUG=falseENABLE_REQUEST_LOGGING=FalseOPS_TRACE_UNIFIED_ENABLED=false-OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES=60+OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES=780OPS_TRACE_RETRYABLE_DISPATCH_DELAY_SECONDS=5# OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS should cover the retry window# (OPS_TRACE_RETRYABLE_DISPATCH_MAX_RETRIES * OPS_TRACE_RETRYABLE_DISPATCH_DELAY_SECONDS).-OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS=3600+OPS_TRACE_PARENT_CONTEXT_TTL_SECONDS=3900WORKFLOW_LOG_CLEANUP_ENABLED=falseWORKFLOW_LOG_RETENTION_DAYS=30WORKFLOW_LOG_CLEANUP_BATCH_SIZE=100@@ -115,7 +115,15 @@ ACCESS_TOKEN_EXPIRE_MINUTES=60REFRESH_TOKEN_EXPIRE_DAYS=30APP_DEFAULT_ACTIVE_REQUESTS=0APP_MAX_ACTIVE_REQUESTS=0-APP_MAX_EXECUTION_TIME=1200+# Agent backend client settings shared by API and worker processes.+AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS=30+AGENT_BACKEND_STREAM_MAX_RECONNECTS=3+# Client timeout for Agent backend calls that may carry a Home Snapshot transfer.+# Must stay above DIFY_AGENT_ENTERPRISE_SANDBOX_SNAPSHOT_TIMEOUT on the Agent backend.+AGENT_BACKEND_HOME_SNAPSHOT_TIMEOUT_SECONDS=45+# Outer execution limit for Agent Apps. Agent Backend may stop the internal+# model/tool loop sooner when DIFY_AGENT_RUN_TIMEOUT_SECONDS is lower.+APP_MAX_EXECUTION_TIME=3600DIFY_BIND_ADDRESS=0.0.0.0DIFY_PORT=5001SERVER_WORKER_AMOUNT=1@@ -205,7 +213,11 @@ CODE_EXECUTION_READ_TIMEOUT=60CODE_EXECUTION_WRITE_TIMEOUT=10TEMPLATE_TRANSFORM_MAX_LENGTH=400000WORKFLOW_MAX_EXECUTION_STEPS=500-WORKFLOW_MAX_EXECUTION_TIME=1200+# Outer execution limit for Workflow and Chatflow callers. Agent Backend may+# stop the internal model/tool loop sooner when its run timeout is lower.+# To allow all Agent call paths to run for one hour, set this value,+# APP_MAX_EXECUTION_TIME, and DIFY_AGENT_RUN_TIMEOUT_SECONDS to at least 3600.+WORKFLOW_MAX_EXECUTION_TIME=3600WORKFLOW_CALL_MAX_DEPTH=5MAX_VARIABLE_SIZE=204800WORKFLOW_GENERATOR_NODE_BUILDER_MAX_WORKERS=6