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(dify-agent): use E2B traffic access header (#40891)
盐粒 Yanlic267e73ca660
diff --git a/dify-agent/src/dify_agent/runtime_backend/e2b.py b/dify-agent/src/dify_agent/runtime_backend/e2b.pyindex 376a43a54b7..3140391eb13 100644--- a/dify-agent/src/dify_agent/runtime_backend/e2b.py+++ b/dify-agent/src/dify_agent/runtime_backend/e2b.py@@ -312,13 +312,13 @@ class E2BExecutionBindingBackend:raise BindingAcquireError("E2B sandbox did not provide a traffic access token")http_client = httpx.AsyncClient(base_url=entrypoint,- headers={"X-Access-Token": traffic_token},+ headers={"e2b-traffic-access-token": traffic_token},follow_redirects=True,timeout=httpx.Timeout(60.0),)# Explicit token="" prevents process-level SHELLCTL_AUTH_TOKEN fallback;- # E2B port access is authenticated only by X-Access-Token above.+ # E2B port access is authenticated only by e2b-traffic-access-token above.def client_factory() -> ShellctlClientProtocol:from shellctl.client import ShellctlClientdiff --git a/dify-agent/tests/local/dify_agent/runtime_backend/test_e2b.py b/dify-agent/tests/local/dify_agent/runtime_backend/test_e2b.pyindex 60b09224344..9dcddff2b8c 100644--- a/dify-agent/tests/local/dify_agent/runtime_backend/test_e2b.py+++ b/dify-agent/tests/local/dify_agent/runtime_backend/test_e2b.py@@ -336,7 +336,8 @@ async def test_e2b_acquire_retries_transient_shellctl_failures_until_ready(def handler(request: httpx.Request) -> httpx.Response:nonlocal attemptsattempts += 1- assert request.headers["X-Access-Token"] == "traffic-token"+ assert request.headers["e2b-traffic-access-token"] == "traffic-token"+ assert "X-Access-Token" not in request.headersassert "Authorization" not in request.headersif attempts == 1:raise httpx.ReadTimeout("shellctl starting", request=request)