feat(copilot): workflow_copilot_enabled feature flag

This commit is contained in:
Charles Yao committed 2026-08-18 21:45:07 -07:00
1 parent 38cf016ee3
commit 0cfea5cea4
4 files changed
+27

No files matched your search

+5
View File
@@ -937,6 +937,11 @@ class WorkflowConfig(BaseSettings):
default=600,
)
WORKFLOW_COPILOT_ENABLED: bool = Field(
description="Expose the workflow copilot feature (console routes + UI flag).",
default=False,
)
class WorkflowNodeExecutionConfig(BaseSettings):
"""
@@ -162,6 +162,7 @@ class FeatureModel(FeatureResponseModel):
model_load_balancing_enabled: bool = False
dataset_operator_enabled: bool = False
webapp_copyright_enabled: bool = False
workflow_copilot_enabled: bool = False
workspace_members: LicenseLimitationModel = LicenseLimitationModel(enabled=False, size=0, limit=0)
is_allow_transfer_workspace: bool = True
trigger_event: Quota = Quota(usage=0, limit=3000, reset_date=0)
+1
View File
@@ -196,6 +196,7 @@ class FeatureService:
features.model_load_balancing_enabled = dify_config.MODEL_LB_ENABLED
features.dataset_operator_enabled = dify_config.DATASET_OPERATOR_ENABLED
features.education.enabled = dify_config.EDUCATION_ENABLED
features.workflow_copilot_enabled = dify_config.WORKFLOW_COPILOT_ENABLED
@classmethod
def _fulfill_params_from_workspace_info(cls, features: feature_entities.FeatureModel, tenant_id: str):
@@ -0,0 +1,20 @@
import pytest
from services import feature_service as feature_service_module
from services.feature_service import FeatureService
def test_workflow_copilot_flag_follows_config_true(monkeypatch: pytest.MonkeyPatch):
monkeypatch.setattr(feature_service_module.dify_config, "WORKFLOW_COPILOT_ENABLED", True)
features = FeatureService.get_features("tenant-1")
assert features.workflow_copilot_enabled is True
def test_workflow_copilot_flag_defaults_false(monkeypatch: pytest.MonkeyPatch):
monkeypatch.setattr(feature_service_module.dify_config, "WORKFLOW_COPILOT_ENABLED", False)
features = FeatureService.get_features("tenant-1")
assert features.workflow_copilot_enabled is False