feat: allow companion to manage workdirs

This commit is contained in:
2026-08-18 10:47:31 +09:00
parent a10507c54f
commit bb742e253d
3 changed files with 22 additions and 1 deletions
+17 -1
View File
@@ -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();
+4
View File
@@ -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]