Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
7951d78
feat(api): implement BYOA external agent backend
zyssyz123 Nov 9, 2026
92318c9
fix(api): complete BYOA contracts and backend end-to-end validation
zyssyz123 Nov 10, 2026
c3e3e48
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 10, 2026
a3ab8a4
test(api): align BYOA export and worker coverage with CI gates
zyssyz123 Nov 10, 2026
ec0edcc
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 10, 2026
a163160
test: cover BYOA runtime and transport edge cases
zyssyz123 Nov 10, 2026
3aaed77
feat(api): complete BYOA frontend integration contracts
zyssyz123 Nov 12, 2026
dbfac81
fix(api): isolate BYOA control queue and preserve legacy binding writes
zyssyz123 Nov 12, 2026
f812886
docs: record BYOA frontend contracts and incremental dev acceptance
zyssyz123 Nov 12, 2026
52dbfe0
Merge main into BYOA backend implementation
zyssyz123 Nov 12, 2026
6befef8
Merge latest main into BYOA backend implementation
zyssyz123 Nov 12, 2026
f1181a3
fix: skip KnowledgeFS publish sync when integration is disabled
zyssyz123 Nov 15, 2026
4534013
Merge main for BYOA interface assistance (DIFY-3046)
zyssyz123 Nov 15, 2026
e0ea5a9
fix(external-agent): expose effective input file extensions
zyssyz123 Nov 15, 2026
6fd634f
Merge current main for DIFY-3046 API fixes
zyssyz123 Nov 15, 2026
da65116
chore(contracts): regenerate external-agent file capabilities
zyssyz123 Nov 15, 2026
bc57e8c
Merge latest main test coverage into BYOA backend
zyssyz123 Nov 15, 2026
6432715
test: preserve SSE errors across product acceptance projections
zyssyz123 Nov 15, 2026
c73cfa3
Merge latest main strict test coverage into BYOA backend
zyssyz123 Nov 15, 2026
9dd06e1
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 15, 2026
dabf5eb
test(external-agents): track merged file-scanning migration head
zyssyz123 Nov 15, 2026
fd5db27
fix(a2a): resolve task variables in single-node runs (DIFY-3051)
zyssyz123 Nov 17, 2026
4a1e5d2
Merge latest main into BYOA backend
zyssyz123 Nov 17, 2026
a951a7c
test(docker): cover external worker shared URL overrides
zyssyz123 Nov 17, 2026
ffddaea
fix(a2a): record reported final call usage (DIFY-3047)
zyssyz123 Nov 18, 2026
c347ac0
Merge latest main into BYOA usage reporting
zyssyz123 Nov 18, 2026
bfdf7f1
fix(a2a): expose immutable connection save attribution (DIFY-3054)
zyssyz123 Nov 19, 2026
e66e4ef
Merge latest main into BYOA connection audit
zyssyz123 Nov 19, 2026
4df30d1
Merge main evaluation and permission fixes into BYOA
zyssyz123 Nov 19, 2026
f762887
refactor(a2a): preserve closed wire profiles with string enums
zyssyz123 Nov 19, 2026
74897fa
fix: retain external workflow inputs and reported usage
zyssyz123 Nov 19, 2026
5c05f68
Merge commit '6937e798cf32d80d57b44935c6cc840356c9032d' into codex/di…
zyssyz123 Nov 19, 2026
334370c
Merge latest main and align CI workflow test fixtures
zyssyz123 Nov 19, 2026
6f70a74
fix: include authorized external trace content
zyssyz123 Nov 19, 2026
3349644
Merge latest main for external trace content validation
zyssyz123 Nov 19, 2026
d39e5e3
fix: expose App capture consent and frozen export outcomes
zyssyz123 Nov 20, 2026
5915199
Merge latest main for App capture consent validation
zyssyz123 Nov 20, 2026
2d2382a
Merge latest main for App capture consent validation
zyssyz123 Nov 20, 2026
680a788
Merge commit '3f0ae21bb60dbad233c9f01cae28c4e5be705a23' into codex/di…
zyssyz123 Nov 20, 2026
2c3af2d
docs: clarify External Agent Verify conflict recovery
zyssyz123 Nov 20, 2026
9c17c20
fix(external-agents): return live app icons in references
zyssyz123 Nov 23, 2026
59fe70f
Merge latest main into BYOA backend implementation
zyssyz123 Nov 23, 2026
b69e897
Merge commit '56f65f960ec1fd09d5a2cec2263daa87e0319c03' into codex/di…
zyssyz123 Nov 23, 2026
8d23e9c
feat(external-agents): share Agent tags and effective ACLs
zyssyz123 Nov 23, 2026
74d01f4
test(external-agents): distinguish persisted state from ACL projection
zyssyz123 Nov 23, 2026
a7e4224
chore(api): generate External Agent tag contracts
zyssyz123 Nov 23, 2026
61bdedc
Merge commit 'c971b4c17d7c034b9b871359cecce49a7c86d1ae' into codex/di…
zyssyz123 Nov 23, 2026
810d6f3
test(tracing): serve capture cases through the contract fake API
zyssyz123 Nov 23, 2026
ec26576
test(external-agents): include shared tags in archive fixture
zyssyz123 Nov 23, 2026
21be2f9
refactor(migrations): consolidate unreleased BYOA schema
zyssyz123 Nov 24, 2026
d056499
Merge commit '55b4bd7d793e58d69accd82c166f9b197178be00' into codex/di…
zyssyz123 Nov 25, 2026
10c60b7
fix(byoa): refine safe external Agent verification failures
zyssyz123 Nov 25, 2026
cbce7a9
chore(api): regenerate External Agent verification contracts
zyssyz123 Nov 25, 2026
6d723f4
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 25, 2026
9cf0ade
test(api): supply scoped file access in avatar harness
zyssyz123 Nov 25, 2026
0eafee5
test(knowledge): isolate summary retry clock from background workers
zyssyz123 Nov 25, 2026
71df55b
test(knowledge): use isolated stdlib retry clock module
zyssyz123 Nov 25, 2026
6ebca1e
fix: normalize editor default workflow edge handles
zyssyz123 Nov 26, 2026
8a3b8b1
Merge latest main into BYOA backend feature
zyssyz123 Nov 26, 2026
aff2544
fix: preserve inline external capture errors with query meta
zyssyz123 Nov 26, 2026
2628fcb
fix(a2a): diagnose invalid direct message reply fields
zyssyz123 Nov 26, 2026
21cf44f
Merge branch 'main' of https://github.com/langgenius/dify into codex/…
zyssyz123 Nov 26, 2026
94d695f
test(a2a): narrow reply fixture values under strict typing
zyssyz123 Nov 26, 2026
7243d0d
Merge branch 'main' of https://github.com/langgenius/dify into codex/…
zyssyz123 Nov 26, 2026
ff7a9f4
Merge branches 'main' and 'codex/dify-3025-byoa-backend-20261109' of …
zyssyz123 Nov 27, 2026
575e15d
fix(api): consume Graphon from its upstream repository
zyssyz123 Nov 27, 2026
b3a1586
Merge main into BYOA backend and preserve file lifecycle contracts
zyssyz123 Dec 1, 2026
386097f
refactor(api): move External Agent adapters out of providers
zyssyz123 Dec 1, 2026
485d353
fix(api): integrate BYOA file adapters with explicit upload ownership
zyssyz123 Dec 1, 2026
301896f
fix(api): gate External Agent periodic tasks by deployment mode
zyssyz123 Dec 1, 2026
c2aa771
test(api): inject knowledge ports in External Agent factory tests
zyssyz123 Dec 1, 2026
15b4f93
fix(api): connect BYOA resume and tests to main application ports
zyssyz123 Dec 1, 2026
22df2ea
fix(api): keep the shared upload contract stable for reserved files
zyssyz123 Dec 1, 2026
fa09f6b
fix(web): cover External Agent test mutations
zyssyz123 Dec 1, 2026
04adabd
test(api): fix workflow cleanup and parser CI regressions
zyssyz123 Dec 1, 2026
89a6beb
test(api): cover External Agent Beat in the Celery gate
zyssyz123 Dec 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,28 @@ CELERY_BROKER_URL=redis://:difyai123456@localhost:${REDIS_PORT}/1
CELERY_BACKEND=redis

# Ops trace configuration
# External Agent A2A 1.0 HTTP+JSON profile. Run a dedicated external_agents
# worker and beat before enabling. Production uses the frozen defaults.
EXTERNAL_AGENTS_ENABLED=false
EXTERNAL_AGENTS_QUEUE=external_agents
EXTERNAL_AGENTS_HTTP_CONNECT_SECONDS=5
EXTERNAL_AGENTS_HTTP_TIMEOUT_SECONDS=30
EXTERNAL_AGENTS_LOGICAL_BUDGET_SECONDS=3600
EXTERNAL_AGENTS_SSE_WINDOW_SECONDS=30
EXTERNAL_AGENTS_POLL_SECONDS=5
EXTERNAL_AGENTS_CANCEL_WINDOW_SECONDS=30
EXTERNAL_AGENTS_TRACKING_SECONDS=86400
EXTERNAL_AGENTS_BACKGROUND_INITIAL_SECONDS=60
EXTERNAL_AGENTS_BACKGROUND_MAX_SECONDS=300
EXTERNAL_AGENTS_BACKGROUND_MAX_QUERIES=300
EXTERNAL_AGENTS_WORKSPACE_QUERY_CONCURRENCY=20
EXTERNAL_AGENTS_ENDPOINT_QUERY_CONCURRENCY=5
EXTERNAL_AGENTS_IO_CONCURRENCY=32
EXTERNAL_AGENTS_MAX_FILES=5
EXTERNAL_AGENTS_DOCUMENT_BYTES=15728640
EXTERNAL_AGENTS_IMAGE_BYTES=10485760
EXTERNAL_AGENTS_TOTAL_FILE_BYTES=31457280

# Keep new workers separate from legacy ops_trace workers during upgrades.
OPS_TRACE_QUEUE=ops_trace_v2
OPS_TRACE_EXPORT_MAX_ATTEMPTS=6
Expand Down
30 changes: 30 additions & 0 deletions api/.importlinter
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,33 @@ root_packages =
libs
machinery
models
providers
repositories
tasks
services
include_external_packages = True

[importlinter:contract:external-agents-application]
name = External Agent application services use consumer ports and plain records
type = forbidden
source_modules =
services.external_agents
forbidden_modules =
celery
configs
controllers
core
enterprise
extensions
flask
models
providers
repositories
sqlalchemy
tasks
werkzeug
allow_indirect_imports = True

[importlinter:contract:domain-boundary]
name = Domain code depends on no application, persistence, framework, configuration, queue, transport, or legacy kernel code
type = forbidden
Expand Down Expand Up @@ -80,6 +102,14 @@ layers =
# error makes this list shrink whenever a legacy dependency is removed.
unmatched_ignore_imports_alerting = error
ignore_imports =
# Legacy workflow composition selects the External adapter; application
# policy/state stays in the framework-neutral external_agents slice.
core.workflow.node_factory -> extensions.ext_application_services
core.workflow.node_factory -> providers.a2a.workflow_node
core.workflow.workflow_entry -> extensions.ext_application_services
core.workflow.workflow_entry -> providers.a2a.workflow_budget
core.workflow.nodes.agent_v2.validators -> services.external_agents.workflow_runtime
core.workflow.nodes.agent_v2.validators -> providers.a2a.workflow_node
# The Dify node factory composes the Human Input runtime for workflow execution.
core.workflow.node_factory -> services.human_input_v2.composition
# Legacy generators delegate configured file defaults to the application owner during core migration.
Expand Down
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN apt-get update \
# Install Python dependencies (workspace members under providers/vdb/)
COPY api/pyproject.toml api/uv.lock ./
COPY api/providers ./providers
COPY packages/graphon /app/packages/graphon
COPY dify-agent/pyproject.toml dify-agent/README.md /app/dify-agent/
COPY dify-agent/src /app/dify-agent/src
# Trust the checked-in lock during image builds; local path sources are copied from the repository context.
Expand Down
3 changes: 3 additions & 0 deletions api/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
!dify-agent/README.md
!dify-agent/src/
!dify-agent/src/**
!packages/
!packages/graphon/
!packages/graphon/**
**/node_modules/
**/dist/
**/.turbo/
Expand Down
2 changes: 2 additions & 0 deletions api/configs/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from pydantic_settings import BaseSettings

from .external_agents import ExternalAgentsConfig
from .hosted_service import HostedServiceConfig

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -1862,6 +1863,7 @@ def validate_heartbeat_lease(self) -> "EvaluationConfig":


class FeatureConfig(
ExternalAgentsConfig,
# place the configs in alphabet order
AppExecutionConfig,
AuthConfig, # Changed from OAuthConfig to AuthConfig
Expand Down
28 changes: 28 additions & 0 deletions api/configs/feature/external_agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Deployment controls for the frozen External Agent HTTP+JSON profile."""

from pydantic import Field
from pydantic_settings import BaseSettings


class ExternalAgentsConfig(BaseSettings):
EXTERNAL_AGENTS_ENABLED: bool = False
EXTERNAL_AGENTS_QUEUE: str = "external_agents"
EXTERNAL_AGENTS_POLL_SECONDS: int = Field(default=5, ge=1, le=60)
EXTERNAL_AGENTS_LOGICAL_BUDGET_SECONDS: int = Field(default=3600, ge=60)
EXTERNAL_AGENTS_HTTP_CONNECT_SECONDS: int = Field(default=5, ge=1, le=30)
EXTERNAL_AGENTS_HTTP_TIMEOUT_SECONDS: int = Field(default=30, ge=1, le=30)
EXTERNAL_AGENTS_SSE_WINDOW_SECONDS: int = Field(default=30, ge=1, le=30)
EXTERNAL_AGENTS_CANCEL_WINDOW_SECONDS: int = Field(default=30, ge=1, le=60)
EXTERNAL_AGENTS_TRACKING_SECONDS: int = Field(default=86400, ge=60, le=86400)
EXTERNAL_AGENTS_BACKGROUND_INITIAL_SECONDS: int = Field(default=60, ge=1, le=300)
EXTERNAL_AGENTS_BACKGROUND_MAX_SECONDS: int = Field(default=300, ge=1, le=300)
EXTERNAL_AGENTS_BACKGROUND_MAX_QUERIES: int = Field(default=300, ge=1, le=300)
EXTERNAL_AGENTS_WORKSPACE_QUERY_CONCURRENCY: int = Field(default=20, ge=1)
EXTERNAL_AGENTS_ENDPOINT_QUERY_CONCURRENCY: int = Field(default=5, ge=1)
EXTERNAL_AGENTS_IO_CONCURRENCY: int = Field(default=32, ge=1)
EXTERNAL_AGENTS_MAX_FILES: int = Field(default=5, ge=1, le=5)
EXTERNAL_AGENTS_DOCUMENT_BYTES: int = Field(default=15 * 1024 * 1024, ge=0, le=15 * 1024 * 1024)
EXTERNAL_AGENTS_IMAGE_BYTES: int = Field(default=10 * 1024 * 1024, ge=0, le=10 * 1024 * 1024)
EXTERNAL_AGENTS_TOTAL_FILE_BYTES: int = Field(default=30 * 1024 * 1024, ge=0, le=30 * 1024 * 1024)
EXTERNAL_AGENTS_WORKER_BATCH: int = Field(default=100, ge=1, le=1000)
EXTERNAL_AGENTS_SWEEP_SECONDS: int = Field(default=60, ge=1, le=300)
5 changes: 5 additions & 0 deletions api/controllers/common/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ class SchemaNameCollisionError(ValueError):
# names depending on which model pulled it in. Types that share a class name with
# another documented type get a fixed, unique component name here instead.
SCHEMA_NAME_OVERRIDES: Mapping[str, str] = {
"services.external_agents.io_contracts.JsonValue": "ExternalAgentJsonValue",
"services.external_agents.io_contracts.JsonObject": "ExternalAgentJsonObject",
"services.external_agents.io_contracts.OutputField": "ExternalAgentOutputField",
"services.external_agents.runtime_contracts.WaitPolicy": "ExternalAgentWaitPolicy",
"services.external_agents.runtime_contracts.TimeoutPolicy": "ExternalAgentTimeoutPolicy",
"services.agent_config_contracts.AgentConfigVersionKind": "AgentConfigTargetVersionKind",
"graphon.model_runtime.entities.common_entities.I18nObject": "ModelRuntimeI18nObject",
"services.knowledge.entities.knowledge_entities.FileInfo": "KnowledgeFileInfo",
Expand Down
14 changes: 14 additions & 0 deletions api/controllers/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def _register_controllers() -> tuple[ModuleType, ...]:
)
from .agent import api_access as agent_api_access
from .agent import composer as agent_composer
from .agent import external as external_agents
from .agent import external_observability, external_tests, external_workflow_bindings
from .agent import roster as agent_roster
from .agent import tracing as agent_tracing
from .agent import tracing_runs as agent_tracing_runs
Expand Down Expand Up @@ -291,6 +293,10 @@ def _register_controllers() -> tuple[ModuleType, ...]:
workflow_run_archive,
agent_api_access,
agent_composer,
external_agents,
external_observability,
external_tests,
external_workflow_bindings,
agent_roster,
agent_tracing,
agent_tracing_runs,
Expand Down Expand Up @@ -398,6 +404,10 @@ def _register_controllers() -> tuple[ModuleType, ...]:
workflow_run_archive,
agent_api_access,
agent_composer,
external_agents,
external_observability,
external_tests,
external_workflow_bindings,
agent_roster,
agent_tracing,
agent_tracing_runs,
Expand Down Expand Up @@ -527,6 +537,10 @@ def _register_controllers() -> tuple[ModuleType, ...]:
"evaluation",
"extension",
"external",
"external_agents",
"external_observability",
"external_tests",
"external_workflow_bindings",
"feature",
"file_scan",
"forgot_password",
Expand Down
Loading
Loading