fix backend job execution fencing and delivery

This commit is contained in:
2026-10-01 11:18:14 +09:00
parent ca838e4acf
commit 213ed76061
7 changed files with 703 additions and 109 deletions
+33
View File
@@ -837,6 +837,39 @@ async fn feature_flags_default_to_core_tool_surface_only() {
assert!(!names.iter().any(|name| name == "SubWorkerSpawn"));
}
#[tokio::test]
async fn backend_job_profile_exposes_only_structured_result_capability() {
let workspace = tempfile::tempdir().unwrap();
let resolved = ProfileResolver::new()
.with_workspace_base(workspace.path())
.resolve(
&ProfileSelector::source_named(ProfileRegistrySource::Builtin, "backend-job"),
ProfileResolveOptions::with_worker_name("backend-job-worker"),
)
.unwrap();
let client = MockClient::new(simple_text_events());
let client_for_assert = client.clone();
let (worker, _pwd) = make_worker_with_manifest_and_workspace_context(
client,
resolved.manifest,
WorkerWorkspaceContext::with_client(None, Arc::new(AvailableWorkspaceClient)),
)
.await;
let handle = spawn_controller(worker).await;
handle
.send(Method::submit_text(
protocol::new_submission_request_id(),
"Run the bounded Backend Job.",
))
.await
.unwrap();
wait_for_status(&handle, WorkerStatus::Idle).await;
let request = wait_for_captured_request(&client_for_assert).await;
assert_eq!(request_tool_names(&request), vec!["SubmitBackendJobResult"]);
}
#[tokio::test]
async fn enabled_task_and_web_features_register_their_tools() {
let manifest = r#"