feat(dify-builder): add DIFY_BUILDER_SKILL_LEARNING_POLICY config + FeatureService surface (C-2)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Charles YaoandClaude Opus 4.8 committed 2026-08-23 12:38:04 -07:00
1 parent 6f02649374
commit 893ffedbf0
4 files changed
+23

No files matched your search

+5
View File
@@ -942,6 +942,11 @@ class WorkflowConfig(BaseSettings):
default=False,
)
DIFY_BUILDER_SKILL_LEARNING_POLICY: str = Field(
description="Dify Builder governance tail policy: ask | automatic | disabled.",
default="ask",
)
class WorkflowNodeExecutionConfig(BaseSettings):
"""
@@ -163,6 +163,7 @@ class FeatureModel(FeatureResponseModel):
dataset_operator_enabled: bool = False
webapp_copyright_enabled: bool = False
dify_builder_enabled: bool = False
skill_learning_policy: str = "ask"
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
@@ -197,6 +197,7 @@ class FeatureService:
features.dataset_operator_enabled = dify_config.DATASET_OPERATOR_ENABLED
features.education.enabled = dify_config.EDUCATION_ENABLED
features.dify_builder_enabled = dify_config.DIFY_BUILDER_ENABLED
features.skill_learning_policy = dify_config.DIFY_BUILDER_SKILL_LEARNING_POLICY
@classmethod
def _fulfill_params_from_workspace_info(cls, features: feature_entities.FeatureModel, tenant_id: str):
@@ -18,3 +18,19 @@ def test_dify_builder_flag_defaults_false(monkeypatch: pytest.MonkeyPatch):
features = FeatureService.get_features("tenant-1")
assert features.dify_builder_enabled is False
def test_feature_service_surfaces_skill_learning_policy(monkeypatch: pytest.MonkeyPatch):
monkeypatch.setattr(feature_service_module.dify_config, "DIFY_BUILDER_SKILL_LEARNING_POLICY", "automatic")
features = FeatureService.get_features("tenant-1")
assert features.skill_learning_policy == "automatic"
def test_skill_learning_policy_defaults_ask(monkeypatch: pytest.MonkeyPatch):
monkeypatch.setattr(feature_service_module.dify_config, "DIFY_BUILDER_SKILL_LEARNING_POLICY", "ask")
features = FeatureService.get_features("tenant-1")
assert features.skill_learning_policy == "ask"