Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cua-driver): report screenshot_frame_valid on successful Linux window captures (#3814)

Will Bogusz9fe9520ef357
diff --git a/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
index 3de25dacd9..71ac9ac94b 100644
--- a/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
@@ -397,6 +397,12 @@ fn default_returns_tree_and_screenshot() {
has_image(&resp),
"default response is missing its screenshot"
);
+ #[cfg(target_os = "linux")]
+ assert_eq!(
+ resp.structured()["screenshot_frame_valid"],
+ true,
+ "a delivered Linux window screenshot must identify its frame as valid"
+ );
},
);
}
diff --git a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
index fc199ce043..77ba76f86e 100644
--- a/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
+++ b/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs
@@ -1642,6 +1642,7 @@ impl Tool for GetWindowStateTool {
}
structured["screenshot_width"] = json!(w);
structured["screenshot_height"] = json!(h);
+ structured["screenshot_frame_valid"] = json!(true);
if let Some(ow) = orig_w {
if ow > 0 {
structured["frame_scale"] = json!(w as f64 / ow as f64);