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

@ -24,14 +24,14 @@ class SandboxService:
tenant_id: str,
app_id: str,
user_id: str,
workflow_execution_id: str,
sandbox_id: str,
sandbox_provider: SandboxProviderEntity,
) -> Sandbox:
assets = AppAssetService.get_assets(tenant_id, app_id, user_id, is_draft=False)
if not assets:
raise ValueError(f"No assets found for tid={tenant_id}, app_id={app_id}")
archive_storage = ArchiveSandboxStorage(tenant_id, app_id, workflow_execution_id, storage.storage_runner)
archive_storage = ArchiveSandboxStorage(tenant_id, app_id, sandbox_id, storage.storage_runner)
sandbox = (
SandboxBuilder(tenant_id, SandboxType(sandbox_provider.provider_type))
.options(sandbox_provider.config)
@ -67,8 +67,6 @@ class SandboxService:
if not assets:
raise ValueError(f"No assets found for tid={tenant_id}, app_id={app_id}")
SandboxService.delete_draft_storage(tenant_id, app_id, user_id)
AppAssetPackageService.build_assets(tenant_id, app_id, assets)
sandbox_id = SandboxBuilder.draft_id(user_id)
archive_storage = ArchiveSandboxStorage(