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(api): raise Socket.IO max_http_buffer_size for large workflows (#41347)
lei_lei8c251907139d
diff --git a/api/.env.example b/api/.env.exampleindex 389fc5afa8d..15829262e8b 100644--- a/api/.env.example+++ b/api/.env.example@@ -222,6 +222,7 @@ SUPABASE_URL=your-server-url# CORS configurationWEB_API_CORS_ALLOW_ORIGINS=http://localhost:3000,*CONSOLE_CORS_ALLOW_ORIGINS=http://localhost:3000,*+WEBSOCKET_MAX_HTTP_BUFFER_SIZE=10485760# When the frontend and backend run on different subdomains, set COOKIE_DOMAIN to the site’s top-level domain (e.g., `example.com`). Leading dots are optional.COOKIE_DOMAIN=diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex 8098f3cbf2c..3fd5cfaac6e 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -593,6 +593,16 @@ class HttpConfig(BaseSettings):def CONSOLE_CORS_ALLOW_ORIGINS(self) -> list[str]:return self.inner_CONSOLE_CORS_ALLOW_ORIGINS.split(",")+ WEBSOCKET_MAX_HTTP_BUFFER_SIZE: PositiveInt = Field(+ description=(+ "Maximum Socket.IO / Engine.IO HTTP buffer size in bytes. "+ "Large workflow collaboration payloads (sync_request graph snapshots) "+ "exceed the Engine.IO default of 1 MiB and get rejected, which "+ "disconnects the editor WebSocket. Default is 10 MiB."+ ),+ default=10 * 1024 * 1024,+ )+inner_WEB_API_CORS_ALLOW_ORIGINS: str = Field(description="",validation_alias=AliasChoices("WEB_API_CORS_ALLOW_ORIGINS"),diff --git a/api/extensions/ext_socketio.py b/api/extensions/ext_socketio.pyindex 78ff7576287..056bcf7b616 100644--- a/api/extensions/ext_socketio.py+++ b/api/extensions/ext_socketio.py@@ -73,5 +73,6 @@ sio = cast(async_mode="gevent",client_manager=create_socketio_client_manager(),cors_allowed_origins=dify_config.CONSOLE_CORS_ALLOW_ORIGINS,+ max_http_buffer_size=dify_config.WEBSOCKET_MAX_HTTP_BUFFER_SIZE,),)diff --git a/api/tests/integration_tests/.env.example b/api/tests/integration_tests/.env.exampleindex 98186d59e83..76ad277101d 100644--- a/api/tests/integration_tests/.env.example+++ b/api/tests/integration_tests/.env.example@@ -55,6 +55,7 @@ OPENDAL_FS_ROOT=storage# CORS configurationWEB_API_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*CONSOLE_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*+WEBSOCKET_MAX_HTTP_BUFFER_SIZE=10485760# Vector database configuration# support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, couchbase, vikingdb, upstash, lindorm, oceanbase, irisdiff --git a/api/tests/unit_tests/extensions/test_ext_socketio.py b/api/tests/unit_tests/extensions/test_ext_socketio.pyindex 27be8c72971..a5851b80932 100644--- a/api/tests/unit_tests/extensions/test_ext_socketio.py+++ b/api/tests/unit_tests/extensions/test_ext_socketio.py@@ -3,6 +3,7 @@ import sslimport pytestimport socketio+from configs import dify_configfrom extensions import ext_socketio@@ -44,3 +45,7 @@ def test_build_redis_options_omits_socket_timeout(monkeypatch: pytest.MonkeyPatcassert "socket_timeout" not in optionsassert "socket_connect_timeout" in options+++def test_socketio_server_uses_configured_max_http_buffer_size() -> None:+ assert ext_socketio.sio.eio.max_http_buffer_size == dify_config.WEBSOCKET_MAX_HTTP_BUFFER_SIZEdiff --git a/docker/envs/core-services/shared.env.example b/docker/envs/core-services/shared.env.exampleindex 784682d426b..f5ae7604d0c 100644--- a/docker/envs/core-services/shared.env.example+++ b/docker/envs/core-services/shared.env.example@@ -319,6 +319,7 @@ CELERY_SENTINEL_MASTER_NAME=CELERY_SENTINEL_SOCKET_TIMEOUT=0.1WEB_API_CORS_ALLOW_ORIGINS=*CONSOLE_CORS_ALLOW_ORIGINS=*+WEBSOCKET_MAX_HTTP_BUFFER_SIZE=10485760COOKIE_DOMAIN=OPENDAL_SCHEME=fsOPENDAL_FS_ROOT=storage