From 9dfc8e9caa3cd92fc53423e8b943a9853758a273 Mon Sep 17 00:00:00 2001 From: M4n5ter Date: Sun, 1 Nov 2026 15:27:04 +0800 Subject: [PATCH] fix(ci): repair generated checks and obsolete recovery tests Generated-by: OpenAI Codex --- packages/plugin-sdk/src/generated/runtime.ts | 2 +- .../prepared_prompt/wire/production_tests.rs | 225 +++++++----------- plugins/agent/native/src/owner/tests.rs | 5 +- plugins/agent/tool-catalog/src/request.rs | 2 +- products/maka/cli/THIRD_PARTY_NOTICES.txt | 12 +- products/maka/cli/notices.json | 24 +- products/maka/cli/src/deployment/local.rs | 54 +++-- .../tests/real_host/desktop_new_session.rs | 112 --------- .../tests/real_host/resumable.rs | 21 +- .../terminal-shell/tests/real_host/support.rs | 13 - scripts/ci/run.mjs | 1 + 11 files changed, 145 insertions(+), 326 deletions(-) diff --git a/packages/plugin-sdk/src/generated/runtime.ts b/packages/plugin-sdk/src/generated/runtime.ts index db89d44dbaa..a1792173e5a 100644 --- a/packages/plugin-sdk/src/generated/runtime.ts +++ b/packages/plugin-sdk/src/generated/runtime.ts @@ -4610,7 +4610,7 @@ export interface ClientOperation { */ reference?: RecoveryRef | null; /** - * A known returned business outcome; absent is never proof that it did not run. + * A terminal business outcome; absent is never proof that it did not run. */ receipt?: Receipt | null; } diff --git a/plugins/agent/engine/src/prepared_prompt/wire/production_tests.rs b/plugins/agent/engine/src/prepared_prompt/wire/production_tests.rs index 7375534b545..f328aab37a6 100644 --- a/plugins/agent/engine/src/prepared_prompt/wire/production_tests.rs +++ b/plugins/agent/engine/src/prepared_prompt/wire/production_tests.rs @@ -126,31 +126,31 @@ async fn capture( #[tokio::test] async fn two_captured_requests_reach_send_ready_and_last_output_retains_full_charge() { - tokio::time::timeout(Duration::from_secs(10), async { - let directory = tempfile::tempdir().unwrap(); - let (root, log, execution, selection) = source(directory.path()).await; - let provider = provider(); - let options = serde_json::Value::Null; - let cancellation = CancellationToken::new(); - let probe_resources = ModelPreparationResources::new(PreparationPolicy::default()).unwrap(); - let probe = capture(&log, selection.clone(), probe_resources.clone()).await; - let encoding = WireEncoding::new(Language::En, &provider, &options, &[]).unwrap(); - let plan = encoding - .count_prompt(&probe.model(), probe_resources) - .await - .unwrap(); - let source_bytes = probe.resident_bytes(); - let full_bytes = source_bytes + plan.allocation(); - drop(plan); - probe.close().await.unwrap(); - drop(probe); - - let resources = ModelPreparationResources::new(PreparationPolicy { - staging_bytes: 2 * source_bytes, - resident_bytes: full_bytes, - ..Default::default() - }) + let directory = tempfile::tempdir().unwrap(); + let (root, log, execution, selection) = source(directory.path()).await; + let provider = provider(); + let options = serde_json::Value::Null; + let cancellation = CancellationToken::new(); + let probe_resources = ModelPreparationResources::new(PreparationPolicy::default()).unwrap(); + let probe = capture(&log, selection.clone(), probe_resources.clone()).await; + let encoding = WireEncoding::new(Language::En, &provider, &options, &[]).unwrap(); + let plan = encoding + .count_prompt(&probe.model(), probe_resources) + .await .unwrap(); + let source_bytes = probe.resident_bytes(); + let full_bytes = source_bytes + plan.allocation(); + drop(plan); + probe.close().await.unwrap(); + drop(probe); + + let resources = ModelPreparationResources::new(PreparationPolicy { + staging_bytes: 2 * source_bytes, + resident_bytes: full_bytes, + ..Default::default() + }) + .unwrap(); + tokio::time::timeout(Duration::from_secs(10), async { let mut first = capture(&log, selection.clone(), resources.clone()).await; let mut second = capture(&log, selection, resources.clone()).await; assert_eq!(first.resident_bytes(), source_bytes); @@ -203,134 +203,75 @@ async fn two_captured_requests_reach_send_ready_and_last_output_retains_full_cha drop(cursor); second.close().await.unwrap(); drop(second); - drop(log); - execution.finish(); - root.shutdown().await.unwrap(); }) .await .expect("source capture, admission and final output release must make progress"); + drop(log); + execution.finish(); + root.shutdown().await.unwrap(); } #[tokio::test] -async fn direct_catalog_definitions_release_after_cancelled_wire_admission() { - use maka_agent_facts::tools::{ToolExecutor, ToolFuture}; - use maka_tools::{ - CodeExecutor, RunTools, ToolCatalog, ToolHandler, ToolMode, ToolNesting, ToolRegistration, - ToolSemantics, availability::LoadedTools, - }; - - struct Handler; - impl ToolExecutor for Handler { - fn names(&self) -> Vec { - vec!["fixture".into()] - } - fn invoke(&self, _: String, input: serde_json::Value, _: CancellationToken) -> ToolFuture { - Box::pin(async move { Ok(input) }) - } - } +async fn blocked_wire_admission_releases_counting_work_and_observes_cancellation() { + let directory = tempfile::tempdir().unwrap(); + let (root, log, execution, selection) = source(directory.path()).await; + let definitions = [Arc::new(ToolDefinition { + name: "fixture".into(), + description: "fixture input".into(), + input_schema: serde_json::json!({"type":"object"}), + output_schema: None, + provider: None, + freeform: None, + })]; + let policy = PreparationPolicy::default(); + let resources = ModelPreparationResources::new(PreparationPolicy { + progress_bytes: policy.work_bytes, + ..policy + }) + .unwrap(); + let resident = resources + .reserve_staging(1) + .await + .unwrap() + .promote(policy.resident_bytes) + .await + .unwrap(); + let mut prompt = capture(&log, selection, resources.clone()).await; + let provider = provider(); + let options = serde_json::Value::Null; + let cancellation = CancellationToken::new(); tokio::time::timeout(Duration::from_secs(10), async { - let directory = tempfile::tempdir().unwrap(); - let (root, log, execution, selection) = source(directory.path()).await; - let catalog = ToolCatalog::new([ToolRegistration { - definition: ToolDefinition { - name: "fixture".into(), - description: "shared catalog definition".into(), - input_schema: serde_json::json!({"type":"object"}), - output_schema: None, - provider: None, - freeform: None, - }, - nesting: ToolNesting::DirectOnly, - semantics: ToolSemantics::Parallel, - handler: ToolHandler::Immediate(Arc::new(Handler)), - }]) - .unwrap(); - let definition = catalog.shared_definitions().next().unwrap(); - let weak = Arc::downgrade(&definition); - let tools = RunTools::new( + let work = resources.acquire_work().await.unwrap(); + let compilation = prompt.compile_wire( Language::En, - log.clone(), - Invocation { - session_id: "session".into(), - turn_id: "turn".into(), - run_id: "run".into(), - invocation_id: "invocation".into(), - }, - catalog, - ToolMode::Direct, - CodeExecutor::new(maka_code_runtime::CellLimits::default()).unwrap(), - LoadedTools::temporary().unwrap(), + &provider, + &options, + &definitions, + &cancellation, ); - let request = tools.capture(".", CancellationToken::new()).await.unwrap(); - let definitions = request.definitions(); - assert_eq!(definitions.len(), 1); - assert!(Arc::ptr_eq(&definition, &definitions[0])); - - let policy = PreparationPolicy::default(); - let resources = ModelPreparationResources::new(PreparationPolicy { - progress_bytes: policy.work_bytes, - ..policy - }) - .unwrap(); - let resident = resources - .reserve_staging(1) - .await - .unwrap() - .promote(policy.resident_bytes) - .await - .unwrap(); - let mut prompt = capture(&log, selection, resources.clone()).await; - let provider = provider(); - let options = serde_json::Value::Null; - let cancellation = CancellationToken::new(); - let owners = Arc::strong_count(&definition); - { - let work = resources.acquire_work().await.unwrap(); - let compilation = async { - let attempt_definitions = request.definitions(); - assert!(Arc::ptr_eq(&definition, &attempt_definitions[0])); - prompt - .compile_wire( - Language::En, - &provider, - &options, - &attempt_definitions, - &cancellation, - ) - .await - }; - tokio::pin!(compilation); - assert!(matches!(poll!(&mut compilation), Poll::Pending)); - let counted = resources.acquire_work(); - tokio::pin!(counted); - assert!(matches!(poll!(&mut counted), Poll::Pending)); - drop(work); - let counted = tokio::select! { - result = &mut compilation => panic!("resident admission must wait: {result:?}"), - result = &mut counted => result.unwrap(), - }; - // The sole work envelope is released only after counting, before promotion. - assert!(matches!(poll!(&mut compilation), Poll::Pending)); - assert!(Arc::strong_count(&definition) > owners); - cancellation.cancel(); - assert!(matches!(compilation.await, Err(RunError::Cancelled))); - drop(counted); - } - assert_eq!(Arc::strong_count(&definition), owners); - drop(resident); - prompt.close().await.unwrap(); - drop(prompt); - drop(definitions); - drop(request); - tools.shutdown().await.unwrap(); - drop(tools); - drop(definition); - assert!(weak.upgrade().is_none()); - drop(log); - execution.finish(); - root.shutdown().await.unwrap(); + tokio::pin!(compilation); + assert!(matches!(poll!(&mut compilation), Poll::Pending)); + let counted = resources.acquire_work(); + tokio::pin!(counted); + assert!(matches!(poll!(&mut counted), Poll::Pending)); + drop(work); + let counted = tokio::select! { + result = &mut compilation => panic!("resident admission must wait: {result:?}"), + result = &mut counted => result.unwrap(), + }; + assert!(matches!(poll!(&mut compilation), Poll::Pending)); + cancellation.cancel(); + assert!(matches!(compilation.await, Err(RunError::Cancelled))); + drop(counted); }) .await - .expect("blocked wire admission must release shared definitions on cancellation"); + .expect("wire admission must release counting work and observe cancellation"); + + drop(resident); + prompt.close().await.unwrap(); + drop(prompt); + drop(log); + execution.finish(); + root.shutdown().await.unwrap(); } diff --git a/plugins/agent/native/src/owner/tests.rs b/plugins/agent/native/src/owner/tests.rs index d2a2af6bb04..16b242287ed 100644 --- a/plugins/agent/native/src/owner/tests.rs +++ b/plugins/agent/native/src/owner/tests.rs @@ -1255,9 +1255,8 @@ async fn cleanup_case(panic: bool) { fixture.owner.runs.lock().await.retained_cleanup.len(), usize::from(panic) ); - assert_eq!( - fixture.owner.runs.lock().await.closing, - false, + assert!( + !fixture.owner.runs.lock().await.closing, "one failed invocation must not close the Agent owner" ); assert!(!fixture.owner.stop.is_cancelled()); diff --git a/plugins/agent/tool-catalog/src/request.rs b/plugins/agent/tool-catalog/src/request.rs index 4aada6d5f88..d2fba7b8193 100644 --- a/plugins/agent/tool-catalog/src/request.rs +++ b/plugins/agent/tool-catalog/src/request.rs @@ -270,7 +270,7 @@ mod tests { definition: ToolDefinition { provider: None, name: "fixture".into(), - description: "d".repeat(1024 * 1024 + 1), + description: "catalog definition".into(), input_schema: json!({"type":"string"}), freeform: None, output_schema: None, diff --git a/products/maka/cli/THIRD_PARTY_NOTICES.txt b/products/maka/cli/THIRD_PARTY_NOTICES.txt index a239d989586..c8d70a44893 100644 --- a/products/maka/cli/THIRD_PARTY_NOTICES.txt +++ b/products/maka/cli/THIRD_PARTY_NOTICES.txt @@ -9936,7 +9936,7 @@ Apache License clipboard-rs@0.3.5 (MIT); authors declared by package: ChurchTao -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 :: LICENSE +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac :: LICENSE https://crates.io/api/v1/crates/clipboard-rs/0.3.5/download :: LICENSE MIT License @@ -9977,7 +9977,7 @@ platform-windows@0.38.0 (MIT) zbus@5.19.0 (MIT); authors declared by package: Zeeshan Ali Khan git+https://github.com/maka-agent/cua?rev=23221967ce6044c1fed303701f43fa54564f0f53#23221967ce6044c1fed303701f43fa54564f0f53 -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac Cua Driver Rust SDK and its workspace crates Source: https://github.com/trycua/cua @@ -13312,7 +13312,7 @@ DEALINGS IN THE SOFTWARE. cua-cursor-motion@0.38.0 (MIT); authors declared by package: trycua -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 :: LICENSE +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac :: LICENSE MIT License @@ -13340,7 +13340,7 @@ SOFTWARE. cua-driver-core@0.38.0 (MIT AND Apache-2.0) -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 :: src/browser/extension_assets/maka-ui/LICENSE +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac :: src/browser/extension_assets/maka-ui/LICENSE Apache License Version 2.0, January 2004 @@ -13714,7 +13714,7 @@ third-party/gix-discover/{LICENSE-APACHE,LICENSE-MIT,upstream.json,SOURCE.md}. cua-driver-core@0.38.0 (MIT AND Apache-2.0) -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 :: src/browser/extension_assets/maka-ui/NOTICE +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac :: src/browser/extension_assets/maka-ui/NOTICE Apache Maka (incubating) Copyright 2026 The Apache Software Foundation @@ -49499,7 +49499,7 @@ zbus_xml@5.2.1 (MIT); authors declared by package: Zeeshan Ali Khan zvariant_derive@5.15.1 (MIT); authors declared by package: Zeeshan Ali Khan -git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451 :: LICENSE +git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac :: LICENSE https://crates.io/api/v1/crates/zbus_macros/5.19.0/download :: LICENSE https://crates.io/api/v1/crates/zbus_names/4.3.5/download :: LICENSE https://crates.io/api/v1/crates/zbus_xml/5.2.1/download :: LICENSE diff --git a/products/maka/cli/notices.json b/products/maka/cli/notices.json index cd8e2957488..c67095296f0 100644 --- a/products/maka/cli/notices.json +++ b/products/maka/cli/notices.json @@ -160,7 +160,7 @@ "cargo:clap_derive@4.6.7 registry+https://github.com/rust-lang/crates.io-index": "82bcc8e413b68e02feff24a3bfa933a3ec902056d5bec77c37a304403297a6cd", "cargo:clap_lex@1.1.1 registry+https://github.com/rust-lang/crates.io-index": "663bce254470eb5563d5b41d8a8b2eceb366748b2784728fe4135b7c0cd4a3dd", "cargo:clap@4.6.7 registry+https://github.com/rust-lang/crates.io-index": "059622eb0e6a6598829c284732c57f80f934f7c818105e7fbacc32306b915823", - "cargo:clipboard-rs@0.3.5 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "0777534e5c0a695c4f159dfcde2003cc6ad6a45c68e6f8e0953d6624030dc7ae", + "cargo:clipboard-rs@0.3.5 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "c5f02194c7eebfa888bc60d0adde4a73a7393655be146592aafa417791b8d421", "cargo:clipboard-rs@0.3.5 registry+https://github.com/rust-lang/crates.io-index": "98c2e0d060061cafbb39572bd6c34478ff6fb4c1551b1ac0e894af320ae15ba0", "cargo:clipboard-win@5.4.3 registry+https://github.com/rust-lang/crates.io-index": "47b2bab5712640068cfcbc6166657ecea1a372a43ba2babc660df276011f100d", "cargo:clru@0.6.3 registry+https://github.com/rust-lang/crates.io-index": "e4aa5a19a56dc2922d7bc263a313358f421d2bc5f6943c1cd71cf6cac27b828d", @@ -223,12 +223,12 @@ "cargo:ctor@1.0.13 registry+https://github.com/rust-lang/crates.io-index": "9e1b74aea82adde884c8ea2c566d026f29b166ea0285ac274c729748a674d9f4", "cargo:ctr@0.10.1 registry+https://github.com/rust-lang/crates.io-index": "868d4fbb66e312d0e963f53c6a41cae4a1a9c86592a5a8248875801fee021827", "cargo:ctutils@0.4.5 registry+https://github.com/rust-lang/crates.io-index": "c1fcb338b2eb8b06eb9ae94b40dfc6193cf1faad308c27684aa606e710ece89d", - "cargo:cua-cursor-motion@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "2cf24babd1edbd5ca5c436f3863b37792f6f81cd2d22bcca4789a52c870e2ce3", - "cargo:cua-driver-contract@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "909ef219884cc1d967f2017cb99a1c4b3edd50455bfb5598e4f98c62d942036f", - "cargo:cua-driver-core@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "496c94ec7dbf8ec1b9249ec51e03eea5dbfb03a27cd9b678df5ffd71de58ce01", - "cargo:cua-driver-sdk@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "8594c19123ab2a98debabfbd75e1ec0c9df6f9a264c1d007bf4c77bc02a95e74", + "cargo:cua-cursor-motion@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "be62a52112681290c925c7912d612317f0779e19bdd7a1e93477537051a63c80", + "cargo:cua-driver-contract@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "324f6fec658d7a1d17322360301d112a1718fce82b753f1c437ebe57c0b40948", + "cargo:cua-driver-core@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "eb3613d212880d6d73bd8d1797edf7aba68428320f865356b7b112b2e2f2a5ae", + "cargo:cua-driver-sdk@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "b761d9304b8ddc5e4f44924ca0a3ed325b1368b608cb4d753242a160f4ef5712", "cargo:cursor-icon@1.2.0 registry+https://github.com/rust-lang/crates.io-index": "3ef9b5fb0958ea9a4e1a2d5e9a9d2cb0b16453099e548cbe72ce61bcfd57d347", - "cargo:cursor-overlay@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "17aaf4f5c02da92f83b804e79e8bbb20c5d7224bc549808543ad7fd2cdb15eba", + "cargo:cursor-overlay@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "5a030d09fc67ea2126a4acdcf2c21937503b9d3ecb8facf3b31de3924547df97", "cargo:curve25519-dalek-derive@0.1.1 registry+https://github.com/rust-lang/crates.io-index": "774e4011c51c5d15fe2618dab4d757e8aa085a8e494565187ad3906ea1f13dbc", "cargo:curve25519-dalek@4.1.3 registry+https://github.com/rust-lang/crates.io-index": "b5988ec3ba7c3f3880c9f67772043cc4eacd9481933ac85ee5bfa59c6db53b4d", "cargo:curve25519-dalek@5.0.0 registry+https://github.com/rust-lang/crates.io-index": "587766614d5a2d7a3d8eeb449f8fe31f58f466817f058edfdf88395c973bba6e", @@ -797,16 +797,16 @@ "cargo:pin-project-internal@1.1.13 registry+https://github.com/rust-lang/crates.io-index": "b182cd7f5ade8cef38090afd2f1d854d3e6e22e08daa709b14a2c9897b03c0b9", "cargo:pin-project-lite@0.2.17 registry+https://github.com/rust-lang/crates.io-index": "189daaf976e3191a47e7177d12bd0c1bc3ae50958cdfdcc7ba0040f6927a887b", "cargo:pin-project@1.1.13 registry+https://github.com/rust-lang/crates.io-index": "3b1bda4e0e723ee3bfe073a4666802f83532afc1cc4c9221a8c41a4854bed4be", - "cargo:pip-preview@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "ca6e496dbb20080a532738b0d6ec21c1bdf46b0a6f7bf86cf96d7a255892db07", + "cargo:pip-preview@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "22b26f643005a6e0a1fa6ec6192ab0b045423b6267d0229908abe3280446e504", "cargo:piper@0.2.5 registry+https://github.com/rust-lang/crates.io-index": "50832f7de6299d6c286c168a2d9fcb74833905dbd7bd4ca598d0e8cd83d62af2", "cargo:pkcs1@0.8.0-rc.5 registry+https://github.com/rust-lang/crates.io-index": "449410f98f9b8d7fb4956a308c024c65eef67102502d4d22f6c7d552fc482a28", "cargo:pkcs8@0.10.2 registry+https://github.com/rust-lang/crates.io-index": "bd951867b4c1c4e09877bda17b94468d1fa88a2ebefd6fe6dabc9e02b759f6b1", "cargo:pkcs8@0.11.0 registry+https://github.com/rust-lang/crates.io-index": "8a22cc1f02b22922a8404686ed989afbfba22b1132cfb676c1913cda6717094c", "cargo:pkg-config@0.3.34 registry+https://github.com/rust-lang/crates.io-index": "bf627c9285d9e1d3e269fdb71b6281ff897f769a841a68ff4f10375c82dcc9ac", "cargo:plain@0.2.3 registry+https://github.com/rust-lang/crates.io-index": "bdfe6d39fcbd7d6d2b3c5ee35bd14bf87083a68af033bc8c9aa1f1b52c7b29e9", - "cargo:platform-linux@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "00dd07a00adb72e0ba3877fb5ba58f32636648debb5443e96edfb40e6e041ac0", - "cargo:platform-macos@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "3f4178bb5ab7c895273b1ea136d4c9ecf9e10bafd87346678cda812caa017f9d", - "cargo:platform-windows@0.38.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "9a7212adfe6203fe1a34af55a03d835eff6e0642773cacfd651bf646b9865ae4", + "cargo:platform-linux@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "bbcbd835cbc595dbc7c8de5eacbd30fe90c110bd5fc2fabc248f4ceba7440876", + "cargo:platform-macos@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "bcefa05d2beb8ec7c5eb5d51d63b80e6f2a00ff6ebd358e8bb33310004652c26", + "cargo:platform-windows@0.38.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "e06c0006a4575462d934b3a676f34d1a5fae85ee869d918ddc9ffcce42d121af", "cargo:png@0.17.16 registry+https://github.com/rust-lang/crates.io-index": "053e487749a89ba4c8017768d3ebd513b68040c46fb6c1666d000c5225fa40c0", "cargo:png@0.18.1 registry+https://github.com/rust-lang/crates.io-index": "75d96228a3f3ee3ec271b861d405d59782a9395d8cfe810cfd39d9354ad823a5", "cargo:pnp@0.12.12 registry+https://github.com/rust-lang/crates.io-index": "31a84e8c472f391cc7f39effec9b13e7c9f7ad7eb26c7036246a403872dbc70c", @@ -1330,7 +1330,7 @@ "cargo:zbus-lockstep-macros@0.5.2 registry+https://github.com/rust-lang/crates.io-index": "0461205f6fee51a73e7db5a62792447d5375b3e8b23559109eb5ab110ee6f958", "cargo:zbus-lockstep@0.5.2 registry+https://github.com/rust-lang/crates.io-index": "eb5aded81eca8aa9895b225e62c8643d1f3ddbc82d34b670ee92911e1bf70b87", "cargo:zbus-secret-service-keyring-store@1.0.1 registry+https://github.com/rust-lang/crates.io-index": "0166e6b70711931ce989999551870c7644b7db7283abffdbf76c85effa49aec6", - "cargo:zbus@5.19.0 git+https://github.com/maka-agent/cua?rev=7dfc429ba3db0568c46c49f633b724750f34f451#7dfc429ba3db0568c46c49f633b724750f34f451": "d22e9257f8983b2f1856f2b697062a179d06bf12a004468b8b3a762dfc9cd319", + "cargo:zbus@5.19.0 git+https://github.com/maka-agent/cua?rev=9e385e6671acb9b985bc88257e94357db39d21ac#9e385e6671acb9b985bc88257e94357db39d21ac": "8e80af92661908242d26c5d4f05d43a4164d866438cc98aff3c1502f21c818fc", "cargo:zcheapstr@1.1.0 registry+https://github.com/rust-lang/crates.io-index": "98fb51b15ba6b432e620ea35d68acb1450b4f9612c69bf686c6e9d1a951bba86", "cargo:zed-font-kit@0.14.1-zed registry+https://github.com/rust-lang/crates.io-index": "96b82424ebb4549bd327c5f4567dba58304c3a463c12edb928dfdc51d53e390f", "cargo:zed-scap@0.0.8-zed registry+https://github.com/rust-lang/crates.io-index": "e092fc2afc9b2f5bb74f6a756fa6fde426876fb7399d70234ec794139607efe0", @@ -1362,5 +1362,5 @@ "cargo:zvariant@5.15.1 registry+https://github.com/rust-lang/crates.io-index": "8606849c24d82d7d012980cba51a766abfe0307b48f936ec59e11b9a05b9c288", "npm:ajv@8.20.0 https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==": "e0b7c0627c7c460c99e8d7b8ac586e4c975ea2a2fae3859fdc94e67ec3aa69cc" }, - "sha256": "a635b5166e036313c0cb34f643087be075af213f047ed7b13487c60c63d0dbfe" + "sha256": "4a13f0f39dc43e85a22e970a07d05260068782b4d691faeafaf39b6845968ad6" } diff --git a/products/maka/cli/src/deployment/local.rs b/products/maka/cli/src/deployment/local.rs index 2ee8ba0b4d6..fff1c06f3d0 100644 --- a/products/maka/cli/src/deployment/local.rs +++ b/products/maka/cli/src/deployment/local.rs @@ -1198,27 +1198,27 @@ mod tests { #[tokio::test] async fn launcher_owned_updates_interrupt_the_old_host_and_wait_for_cleanup() { - tokio::time::timeout(Duration::from_secs(60), async { - for code_changed in [false, true] { - let temporary = tempfile::tempdir().unwrap(); - let root = temporary.path().join("host"); - let launcher = temporary.path().join("launcher"); - std::fs::write(&launcher, b"current executable").unwrap(); - let mut attempted = UpdateAttempt { - launcher: Some(launcher), - ..Default::default() - }; - let generation = if code_changed { - format!("cli-sha256:{}", "0".repeat(64)) - } else { - attempted.generation().await.unwrap().unwrap().to_owned() - }; - let (root_id, epoch, _stop, server) = - serve_product(&root, !code_changed, false, Some(generation)).await; - let discovery = discovery::read(&root).unwrap(); - let other = Client::connect(&discovery.endpoint, Some(epoch)) - .await - .unwrap(); + for code_changed in [false, true] { + let temporary = tempfile::tempdir().unwrap(); + let root = temporary.path().join("host"); + let launcher = temporary.path().join("launcher"); + std::fs::write(&launcher, b"current executable").unwrap(); + let mut attempted = UpdateAttempt { + launcher: Some(launcher), + ..Default::default() + }; + let generation = if code_changed { + format!("cli-sha256:{}", "0".repeat(64)) + } else { + attempted.generation().await.unwrap().unwrap().to_owned() + }; + let (root_id, epoch, _stop, server) = + serve_product(&root, !code_changed, false, Some(generation)).await; + let discovery = discovery::read(&root).unwrap(); + let other = Client::connect(&discovery.endpoint, Some(epoch)) + .await + .unwrap(); + tokio::time::timeout(Duration::from_secs(60), async { assert!( !Client::retire_with_options(&discovery.endpoint, epoch, false, false) .await @@ -1238,10 +1238,14 @@ mod tests { assert_eq!(owner.root_id(), root_id); drop((owner, other)); server.await.unwrap(); - } - }) - .await - .unwrap(); + }) + .await + .unwrap_or_else(|error| { + panic!( + "launcher update and cleanup timed out (code_changed={code_changed}): {error}" + ) + }); + } } #[tokio::test] diff --git a/products/maka/terminal-shell/tests/real_host/desktop_new_session.rs b/products/maka/terminal-shell/tests/real_host/desktop_new_session.rs index 03f5da7f6e8..a223620a9a4 100644 --- a/products/maka/terminal-shell/tests/real_host/desktop_new_session.rs +++ b/products/maka/terminal-shell/tests/real_host/desktop_new_session.rs @@ -1034,118 +1034,6 @@ async fn desktop_connection_failure_has_one_status_below_the_workspace() { disconnected_desktop(theme, appearance, layout, width, height).await; } -#[tokio::test(flavor = "multi_thread", worker_threads = 4)] -async fn desktop_unknown_control_can_be_dismissed_and_feedback_expires() { - let fixture = images_fixture().await; - let (path, _) = image_file(&fixture); - let client = fixture.client().await; - let before = client - .query("agent", "observe", json!({"sessionId":fixture.session})) - .await - .unwrap(); - let id = Uuid::new_v4(); - let mutation = client - .control( - id, - "metadata", - json!({ - "sessionId":fixture.session, "expectedRevision":before["session"]["revision"], - "title":"THIS_RENAME_MUST_NOT_RUN", "labels":[] - }), - ) - .await - .unwrap(); - let original = mutation.prepare().await.unwrap(); - let create = ReplyGate::create(fixture.directory.path(), fixture.address.clone()); - let (theme, appearance, layout, width, height) = visual_case(); - let desktop = Desktop::open_at( - &fixture, - &create.address, - size(gpui::DevicePixels(width), gpui::DevicePixels(height)), - appearance, - ) - .await; - desktop.type_text("DRAFT_KEPT_AFTER_DISMISSAL").await; - desktop.press("Check action status (1)").await; - let dismiss = format!("Dismiss action notice {}", &id.to_string()[..8]); - desktop.control(&dismiss).await; - assert!( - desktop.controls("Dismiss action feedback").is_empty(), - "an unknown result must not show success feedback" - ); - if let Some(directory) = std::env::var_os("MAKA_UI_ARTIFACT_DIR") { - let directory = std::path::PathBuf::from(directory); - std::fs::create_dir_all(&directory).unwrap(); - let guard = desktop.frame.lock().unwrap(); - let frame = guard.as_ref().unwrap(); - assert_eq!( - frame.size(), - size(gpui::DevicePixels(width), gpui::DevicePixels(height)) - ); - let mut ppm = format!("P6\n{} {}\n255\n", width, height).into_bytes(); - for pixel in frame.pixels().chunks_exact(4) { - ppm.extend_from_slice(&pixel[..3]); - } - std::fs::write( - directory.join(format!("unconfirmed-action-{theme}-{layout}.ppm")), - ppm, - ) - .unwrap(); - } - desktop.press(&dismiss).await; - desktop.control("Dismiss action feedback").await; - assert!(desktop.controls("Check action status (1)").is_empty()); - desktop - .until("completed action feedback did not expire", || { - desktop - .controls("Dismiss action feedback") - .is_empty() - .then_some(()) - }) - .await; - let retained = client.operation_for_control(id).await.unwrap(); - assert_eq!(retained.reference, original.reference); - assert!(retained.receipt.is_none()); - assert!(!retained.abandoned); - let after = client - .query("agent", "observe", json!({"sessionId":fixture.session})) - .await - .unwrap(); - assert_eq!(after["session"]["title"], before["session"]["title"]); - desktop.expect_text("DRAFT_KEPT_AFTER_DISMISSAL").await; - mutation.close().await.unwrap(); - desktop.new_draft().await; - desktop.attach(&path).await; - desktop - .type_text("NEW_SESSION_DRAFT_KEPT_AFTER_DISMISSAL") - .await; - create.arm(); - desktop.key("enter", false); - desktop.held(&create).await; - create.discard_reply(); - desktop.control("Check action status (1)").await; - let controls = desktop.client.pending_controls().await.unwrap(); - assert_eq!(controls.len(), 1); - assert_eq!(controls[0].method, "create"); - let dismiss = format!("Dismiss action notice {}", &controls[0].id.to_string()[..8]); - desktop.press(&dismiss).await; - desktop.control("Send message").await; - desktop - .expect_text("NEW_SESSION_DRAFT_KEPT_AFTER_DISMISSAL") - .await; - assert!(desktop.controls("Check action status (1)").is_empty()); - desktop.control("Remove attachment selected.png").await; - assert_eq!( - fixture.request_count.load(Ordering::SeqCst), - 0, - "neither checking nor dismissing may send the preserved draft" - ); - client.close().await.unwrap(); - desktop.close().await; - drop(create); - fixture.finish().await; -} - #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn desktop_model_settings_keeps_successful_sign_in_and_retries_models() { let fixture = Fixture::open().await; diff --git a/products/maka/terminal-shell/tests/real_host/resumable.rs b/products/maka/terminal-shell/tests/real_host/resumable.rs index 0a18373361f..6e971a058fd 100644 --- a/products/maka/terminal-shell/tests/real_host/resumable.rs +++ b/products/maka/terminal-shell/tests/real_host/resumable.rs @@ -146,7 +146,7 @@ async fn composer_continues_an_interrupted_run_and_preserves_draft_send_priority } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] -async fn lost_continuation_receipt_blocks_a_new_send_and_recovers_the_original_turn() { +async fn lost_continuation_receipt_recovers_automatically_without_replaying_the_turn() { tokio::time::timeout(Duration::from_secs(90), async { let mut fixture = Fixture::open().await; let gate = ReplyGate::resume(fixture.directory.path(), fixture.address.clone()); @@ -173,7 +173,7 @@ async fn lost_continuation_receipt_blocks_a_new_send_and_recovers_the_original_t () = gate.held.notified() => {}, } drop(confirmation); - mutation.disconnect().await; + mutation.disconnect().await.unwrap(); gate.release(); let mut continuation = fixture.next_request().await; continuation.delta("RECOVERED_CONTINUATION_ANSWER").await; @@ -182,23 +182,22 @@ async fn lost_continuation_receipt_blocks_a_new_send_and_recovers_the_original_t client.close().await.unwrap(); let restarted = fixture.client().await; assert!(restarted.operation(id).await.unwrap().receipt.is_none()); + restarted.save_draft( + "agent", &fixture.session, support::EDITOR, None, + "LATER_DRAFT_SURVIVES_CONTINUATION_RECOVERY".into(), + ).await.unwrap(); let (mut view, bindings) = fixture.view(restarted.clone(), Some(fixture.session.clone())); wait_editable_composer(&mut view).await; - wait_view(&mut view, |screen| screen.contains("Check action status (1)")).await; - replace_input(&mut view, "Message composer", "LATER_DRAFT_SURVIVES_CONTINUATION_RECOVERY").await; - wait_view_state(&mut view, |view, _| view.accessibility_snapshot().iter().any(|node| node.label == "Send message" && node.state.disabled)).await; - view.handle_event(Event::Key(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE))); - let recover = view.accessibility_snapshot().into_iter() - .find(|node| node.label == "Check action status (1)").unwrap(); - support::click_node(&mut view, recover); + wait_view(&mut view, |screen| { + screen.contains("LATER_DRAFT_SURVIVES_CONTINUATION_RECOVERY") + && screen.contains("RECOVERED_CONTINUATION_ANSWER") + }).await; support::wait_enabled_button(&mut view, "Send message").await; let settled = restarted.operation(id).await.unwrap(); assert_eq!(settled.reference, original.reference); assert!(matches!(settled.receipt, Some(Receipt::Recorded {outcome:OperationOutcome::Returned {ref value},..}) if value["kind"] == "started" && value["execution"]["turnId"] != ready["source"]["turnId"])); support::wait_draft(&restarted, &fixture.session, "LATER_DRAFT_SURVIVES_CONTINUATION_RECOVERY").await; assert!(restarted.pending_controls().await.unwrap().is_empty()); - support::wait_enabled_button(&mut view, "Dismiss action feedback").await; - wait_view(&mut view, |screen| !screen.contains("Original actions checked.")).await; assert_eq!(fixture.request_count.load(Ordering::SeqCst), 2); support::evidence("composer-recovered-continuation", &view.snapshot()); drop(view); diff --git a/products/maka/terminal-shell/tests/real_host/support.rs b/products/maka/terminal-shell/tests/real_host/support.rs index 752b53100ee..55e727f304e 100644 --- a/products/maka/terminal-shell/tests/real_host/support.rs +++ b/products/maka/terminal-shell/tests/real_host/support.rs @@ -733,8 +733,6 @@ pub struct ReplyGate { armed: Arc, pub held: Arc, release: Arc, - #[cfg(feature = "desktop-tests")] - discard: Arc, worker: JoinHandle<()>, } impl ReplyGate { @@ -764,12 +762,10 @@ impl ReplyGate { let armed = Arc::new(AtomicBool::new(false)); let held = Arc::new(Notify::new()); let release = Arc::new(Notify::new()); - let discard = Arc::new(AtomicBool::new(false)); let worker = tokio::spawn({ let armed = armed.clone(); let held = held.clone(); let release = release.clone(); - let discard = discard.clone(); async move { let mut connections = JoinSet::new(); loop { @@ -777,7 +773,6 @@ impl ReplyGate { accepted=listener.accept()=> { let downstream=accepted.unwrap(); let upstream=ipc::connect(&target).await.unwrap(); let armed=armed.clone(); let held=held.clone(); let release=release.clone(); - let discard=discard.clone(); connections.spawn(async move { let (down_read,mut down_write)=tokio::io::split(downstream); let (up_read,mut up_write)=tokio::io::split(upstream); @@ -803,7 +798,6 @@ impl ReplyGate { && armed.swap(false,Ordering::SeqCst) { held.notify_one(); release.notified().await; - if discard.swap(false,Ordering::SeqCst) { break; } } if gate_write(&mut down_write,&frame).await.is_err(){break;} } @@ -822,8 +816,6 @@ impl ReplyGate { armed, held, release, - #[cfg(feature = "desktop-tests")] - discard, worker, } } @@ -833,11 +825,6 @@ impl ReplyGate { pub fn release(&self) { self.release.notify_one(); } - #[cfg(feature = "desktop-tests")] - pub fn discard_reply(&self) { - self.discard.store(true, Ordering::SeqCst); - self.release(); - } } impl Drop for ReplyGate { fn drop(&mut self) { diff --git a/scripts/ci/run.mjs b/scripts/ci/run.mjs index 1c410c38a30..5d8a5f10db1 100644 --- a/scripts/ci/run.mjs +++ b/scripts/ci/run.mjs @@ -233,6 +233,7 @@ export function executor(root, worker = {}) { const count = selected .flatMap((suite) => Object.values(suite.testcases)) .filter((entry) => !entry.ignored && entry['filter-match'].status === 'matches').length; + console.log(`Selected ${count} root tests for archive replay`); if (!count && plan.suites.root.filter === 'all()') throw new Error('The full root test selection was unexpectedly empty'); if (!count) return [];