diff --git a/crates/manifest/src/profile.rs b/crates/manifest/src/profile.rs index 60809859..63605b0d 100644 --- a/crates/manifest/src/profile.rs +++ b/crates/manifest/src/profile.rs @@ -904,7 +904,9 @@ fn apply_role_profile( "enabled": matches!(slug, "companion" | "orchestrator"), "direct_spawn": slug != "orchestrator" }); - value["feature"]["manage_workdir"] = serde_json::json!({ "enabled": slug == "orchestrator" }); + value["feature"]["manage_workdir"] = serde_json::json!({ + "enabled": matches!(slug, "companion" | "orchestrator") + }); value["feature"]["orchestration"] = serde_json::json!({ "enabled": slug == "orchestrator" }); let ticket = match slug { "companion" => serde_json::json!({ "enabled": true, "authoring": true, "thread": true }), @@ -1332,6 +1334,20 @@ mod tests { } } + #[test] + fn builtin_companion_can_manage_workdirs() { + let tmp = TempDir::new().unwrap(); + let resolved = ProfileResolver::new() + .with_workspace_base(tmp.path()) + .resolve( + &ProfileSelector::source_named(ProfileRegistrySource::Builtin, "companion"), + ProfileResolveOptions::with_worker_name("companion-worker"), + ) + .unwrap(); + + assert!(resolved.manifest.feature.manage_workdir.enabled); + } + #[test] fn profile_resolution_requires_runtime_worker_name() { let tmp = TempDir::new().unwrap(); diff --git a/crates/workspace-server/src/hosts.rs b/crates/workspace-server/src/hosts.rs index f587c3de..ab94b0b7 100644 --- a/crates/workspace-server/src/hosts.rs +++ b/crates/workspace-server/src/hosts.rs @@ -4251,6 +4251,10 @@ mod tests { .unwrap(); assert_eq!(manifest.worker.name, "embedded-test-worker"); } + let companion = archive + .resolve_profile("builtin:companion", root.path(), "embedded-test-companion") + .unwrap(); + assert!(companion.feature.manage_workdir.enabled); } #[test] diff --git a/resources/profiles/companion.dcdl b/resources/profiles/companion.dcdl index e17d7b6a..3a6732b6 100644 --- a/resources/profiles/companion.dcdl +++ b/resources/profiles/companion.dcdl @@ -9,6 +9,7 @@ import "./base.dcdl" // { web = { enabled = true; }; sub_worker = { enabled = true; }; worker = { enabled = true; }; + manage_workdir = { enabled = true; }; ticket = { enabled = true; authoring = true; thread = true; }; }; }