feat: materialize execution workspaces

This commit is contained in:
2026-07-07 03:56:32 +09:00
parent 50c80e7747
commit 8b7a5da031
11 changed files with 1063 additions and 48 deletions
+12 -1
View File
@@ -1,5 +1,6 @@
use crate::catalog::CreateWorkerRequest;
use crate::catalog::{CreateWorkerRequest, ExecutionWorkspaceStatus};
use crate::error::RuntimeError;
use crate::execution_workspace::ExecutionWorkspaceBinding;
use crate::identity::WorkerRef;
use crate::interaction::WorkerInput;
#[cfg(feature = "ws-server")]
@@ -153,6 +154,8 @@ pub struct WorkerExecutionStatus {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub binding: Option<WorkerExecutionBindingIdentity>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub execution_workspace: Option<ExecutionWorkspaceStatus>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_result: Option<WorkerExecutionResult>,
}
@@ -166,6 +169,7 @@ impl WorkerExecutionStatus {
backend: WorkerExecutionBackendKind::Connected,
run_state,
binding: None,
execution_workspace: None,
last_result: None,
}
}
@@ -181,6 +185,11 @@ impl WorkerExecutionStatus {
self
}
pub fn with_execution_workspace(mut self, status: ExecutionWorkspaceStatus) -> Self {
self.execution_workspace = Some(status);
self
}
pub fn with_result(mut self, result: WorkerExecutionResult) -> Self {
self.run_state = result.run_state;
self.last_result = Some(result);
@@ -277,6 +286,7 @@ pub struct WorkerExecutionSpawnRequest {
pub worker_ref: WorkerRef,
pub request: CreateWorkerRequest,
pub context: WorkerExecutionContext,
pub execution_workspace: Option<ExecutionWorkspaceBinding>,
}
/// Result of backend Worker spawn/initialization.
@@ -285,6 +295,7 @@ pub enum WorkerExecutionSpawnResult {
Connected {
handle: WorkerExecutionHandle,
run_state: WorkerExecutionRunState,
execution_workspace: Option<ExecutionWorkspaceStatus>,
},
Rejected(WorkerExecutionResult),
Errored(WorkerExecutionResult),