runtime: canonicalize Worker aggregates

This commit is contained in:
2026-08-11 22:38:29 +09:00
parent 33d3d1a43f
commit 34f8949e85
16 changed files with 2013 additions and 201 deletions
+18
View File
@@ -269,6 +269,7 @@ impl WorkspaceApi {
let resource_broker = BackendResourceBroker::default();
let execution_backend = WorkerRuntimeExecutionBackend::new(
ProfileRuntimeWorkerFactory::new(config.workspace_root.clone())
.with_runtime_store_dir(config.embedded_runtime_store_root.clone())
.with_resource_client(Arc::new(resource_broker.clone())),
)
.map_err(|err| {
@@ -318,6 +319,23 @@ impl WorkspaceApi {
.await?;
import_configured_repositories(store.as_ref(), &config)?;
config.repositories = load_configured_repositories_from_store(store.as_ref(), &config)?;
let default_embedded_root =
ServerConfig::default_embedded_runtime_store_root(&config.workspace_id);
if config.embedded_runtime_store_root == default_embedded_root
&& let (Some(legacy_sessions), Some(data_dir)) =
(manifest::paths::sessions_dir(), manifest::paths::data_dir())
{
worker_runtime::fs_store::FsRuntimeStore::migrate_legacy_worker_aggregates(
&config.embedded_runtime_store_root,
legacy_sessions,
data_dir.join("workers"),
)
.map_err(|error| {
crate::Error::Store(format!(
"failed to migrate embedded Runtime Worker aggregates: {error}"
))
})?;
}
let embedded_runtime = EmbeddedWorkerRuntime::new_fs_store_with_execution_backend(
config.workspace_id.clone(),
config.embedded_runtime_store_root.clone(),