refactor: rename new runtime as sandbox feature

This commit is contained in:
Harry
2026-01-12 01:53:26 +08:00
parent 3d2840edb6
commit 9dd0361d0e
13 changed files with 47 additions and 18 deletions

View File

@ -41,6 +41,7 @@ from factories import file_factory
from libs.flask_utils import preserve_flask_contexts
from models import Account, App, Conversation, EndUser, Message, Workflow, WorkflowNodeExecutionTriggeredFrom
from models.enums import WorkflowRunTriggeredFrom
from models.workflow_features import WorkflowFeatures
from services.conversation_service import ConversationService
from services.workflow_draft_variable_service import (
DraftVarLoader,
@ -513,10 +514,8 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
if workflow is None:
raise ValueError("Workflow not found")
# FIXME:(sandbox) Consolidate runtime config checking into a unified location.
runtime = workflow.features_dict.get("runtime")
graph_engine_layers: tuple = ()
if isinstance(runtime, dict) and runtime.get("enabled"):
if workflow.get_feature(WorkflowFeatures.SANDBOX).enabled:
graph_engine_layers = (SandboxLayer(tenant_id=application_generate_entity.app_config.tenant_id),)
# Determine system_user_id based on invocation source

View File

@ -38,6 +38,7 @@ from factories import file_factory
from libs.flask_utils import preserve_flask_contexts
from models import Account, App, EndUser, Workflow, WorkflowNodeExecutionTriggeredFrom
from models.enums import WorkflowRunTriggeredFrom
from models.workflow_features import WorkflowFeatures
from services.workflow_draft_variable_service import DraftVarLoader, WorkflowDraftVariableService
SKIP_PREPARE_USER_INPUTS_KEY = "_skip_prepare_user_inputs"
@ -488,9 +489,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
if workflow is None:
raise ValueError("Workflow not found")
# FIXME:(sandbox) Consolidate runtime config checking into a unified location.
runtime = workflow.features_dict.get("runtime")
if isinstance(runtime, dict) and runtime.get("enabled"):
if workflow.get_feature(WorkflowFeatures.SANDBOX).enabled:
graph_engine_layers = (
*graph_engine_layers,
SandboxLayer(tenant_id=application_generate_entity.app_config.tenant_id),