狀態列舉值
以下字串值取自 src/schemas/enums.py(除另註明)。前端渲染或條件判斷時,以這些精確字面值為準。
執行 SandboxRunState
queued、starting、running、cancel_requested、completed、customer_failed、platform_failed、cancelled
建置嘗試 SandboxBuildAttemptState
validation_queued、validating、build_queued、building、verifying、completed、customer_failed、platform_failed、cancel_requested、cancelling、cancelled
環境版本 SandboxEnvironmentVersionState
draft、build_queued、building、quarantined、verifying、verified、regional_provisioning、ready、retryable_failed、rejected、abandoned、blocked、superseded、archived、provisioning_blocked
任務版本 SandboxTaskVersionState
draft、published、archived
任務版本 content_state(非正式 enum;存成字串)
active、scrubbed — 選單/執行要求 published 且 active。
環境父層 state/binding state/分享 state
- 環境:
active、archived - Binding(活著的選單):
enabled/revoked(外加authority_applicable) - Share grant:
active/revoked(retirement 篩選用revoked) - env/version/task 的
security_state:clear(預設)/blocked(root digest-block) - Secret binding:
pending/active/revoking/revoked - Shared-secret approval:
active/revoked
SandboxOwnerScope(儲存/歷史)是 chatroom/department/company — 沒有 user scope。建立用 SandboxTaskCreateOwnerScope:只有 department/company。POST /tasks 送 chatroom 是 422。不能擁有的 department/company 建立是 403 owner_scope_forbidden。
Run submission_source(SandboxRunDetailResponse 上的字串)
rest、agent、quick_run、custom_table_trigger(未設時為空字串)
聊天室 job ChatroomJobType.SANDBOX
"sandbox" — 在房間載入五個 agent 工具。每個任務的 Agent 曝光是 已授予 + 房間啟用,不是 task.agent_enabled。
通知中心型別
sandbox_event(NotificationCenterType.SANDBOX_EVENT)
終態類別 SandboxTerminalClass / SandboxBuildTerminalClass
completed、customer_failed、platform_failed、cancelled
資源規格 SandboxResourceProfile
standard、performance、large、xlarge — 租戶建立版本只能送前三個(TENANT_SELECTABLE_PROFILES)。確認集合:GET /public/info/sandbox/profiles。
區域 SandboxRegionCode
asia-east1、asia-northeast1、asia-northeast2、asia-south1、asia-southeast3、asia-east2、asia-northeast3、asia-southeast1、asia-southeast2、asia-south2、onprem(v5.10.11)。onprem 是地端部署唯一的區域:託管雲端的目錄永遠不列它,拿它當 build_region 會被拒絕(422 build_region_unavailable);地端目錄則只列它。確認集合:GET /public/info/sandbox/regions(公開 tier 1..3)。
Context 封存 SandboxContextArchiveFormat
zip、tar、tar.gz
執行歷史篩選
SandboxRunExecutorKind:internal_user、external_user。
SandboxRunSourceKind:chatroom、department、external_platform。
SandboxRunHistoryMethod:agent、manual(rest/quick_run/custom_table_trigger 都對到 manual)。
建置規格 SandboxBuildProfile
standard、fast、large
Scope 類 SandboxOwnerScope / SandboxShareTargetKind / SandboxConsumerScope
chatroom、department、company
環境擁有者 SandboxEnvironmentOwnerKind
system_curated、company
Principal SandboxPrincipalType / 認證 SandboxAuthMethod
user、social_media_client / jwt、api_key
生命週期篩選 SandboxLifecycleFilter
active、retired、all(列表查詢參數;多數預設 active,list_task_shares 預設 all)
Agent 提案 SandboxProposalState
prepared、committing、committed、superseded、cancelled、expired、failed
Secret 操作 SandboxSecretOperationState
prepared、applying、reconciling、applied、revoking、terminal
共享 secret slot 政策(share grant 的 secret_slot_policies 值)
borrower(slot 不在 map 裡時的預設)、owner、owner_overridable。見 Secret 與授權。
Secret slot 履行狀態 effective_source(選單/granted-jobs 的 secret_slots[])
borrower、owner、missing
Secret slot 溯源 resolved_via(run 詳情的 secret_slot_provenance)
borrower、owner
公開連結 object kind(POST/DELETE .../{kind}/public-link)
log、output——沒有 artifact。見 內容、Digest 與下載。
通知事件 SandboxNotificationEvent
build_ready、build_failed、build_cancelled、curated_environment_published、run_terminal、security_finding_discovered、security_finding_resolved、security_finding_reappeared、security_finding_blocked、security_exception_granted、security_exception_revoked、security_exception_expired、security_remediation_deadline、runner_replacement_available、runner_handoff_completed、runner_handoff_expired、runner_handoff_failed、image_storage_renewal_blocked、image_storage_cleanup_completed、run_content_expiring、run_content_expired
這些事件經 TeamSync 通知中心以 type=sandbox_event 送達;不取代輪詢。前端仍以 GET 狀態為準。完整收件人/deep-link 表:通知。
內部物件狀態(間接出現在回應)
取自 src/components/sandbox/storage.py。前端最常見的是產出物 deletion_state 與 run content state。
- object_kind:
context、input、output、log、artifact_bundle、report - Owned Object
deletion_state:active、delete_pending、deleted、tombstoned(非active的產出物 download → 404) - 上傳模式:租戶 context 上傳只有
single_part。multipart仍在控制面。 - Session 狀態(租戶 context 上傳):共宣告六個 —
initiating、uploading、completing、completed、abort_pending、aborted。租戶單段 context 上傳實際只會出現後五個;completing是非終態(complete 已嘗試但驗證失敗,可重試 complete 或 abort),輪詢GET .../context-uploads/{sid}的判斷不要漏掉。initiating只在控制面/multipart 路徑寫入,租戶輪詢不會看到。 - Lease 狀態:
uploading、queued、active_transferred、release_pending、released(控制面;佔槽狀態uploading/queued)
數值上限(src/components/sandbox/constants.py)
MAX_PAGE_SIZE=100、DEFAULT_PAGE_SIZE=20;輸入/腳本 JSON ≤1 MiB;MAX_JSON_DEPTH=64、MAX_JSON_NODES=100000;env ≤100 名稱、每項 ≤64 KiB;DEFAULT_WORK_TIMEOUT_SECONDS=1800、MAX_CUSTOMER_WORK_TIMEOUT_SECONDS=604680;MAX_STATUS_WAIT_SECONDS=60(僅 agent 工具);MAX_ARTIFACT_FILES=1000;PROPOSAL_TTL_SECONDS=1800;TURN_RECEIPT_TTL_SECONDS=600;_DOWNLOAD_CAPABILITY_TTL=5min;上傳 capability 15min;context 封存 ≤1 GiB;20 staging slots/20 GiB/每分鐘 5 次 init;內容保留 1..365 天、映像保留 1..90 天。欄位表:請求與回應欄位。