refactor(sandbox): update sandbox service to use sandbox_id instead of workflow_execution_id

- Modified the SandboxService and related app generators to replace workflow_execution_id with sandbox_id for improved clarity and consistency in sandbox handling.
- Adjusted the AdvancedChatAppGenerator and WorkflowAppGenerator to align with the new parameter naming convention.
This commit is contained in:
Harry
2026-01-30 22:44:41 +08:00
parent bb4dd85ae3
commit b67d0d8c45
3 changed files with 4 additions and 8 deletions

View File

@ -536,13 +536,11 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
sandbox_provider=sandbox_provider,
)
else:
if application_generate_entity.workflow_run_id is None:
raise ValueError("workflow_run_id is required when sandbox is enabled")
sandbox = SandboxService.create(
tenant_id=application_generate_entity.app_config.tenant_id,
app_id=application_generate_entity.app_config.app_id,
user_id=application_generate_entity.user_id,
workflow_execution_id=application_generate_entity.workflow_run_id,
sandbox_id=conversation_id,
sandbox_provider=sandbox_provider,
)
graph_engine_layers = (SandboxLayer(sandbox=sandbox),)

View File

@ -515,7 +515,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
tenant_id=application_generate_entity.app_config.tenant_id,
app_id=application_generate_entity.app_config.app_id,
user_id=application_generate_entity.user_id,
workflow_execution_id=application_generate_entity.workflow_execution_id,
sandbox_id=application_generate_entity.workflow_execution_id,
sandbox_provider=sandbox_provider,
)
graph_engine_layers = (