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(telemetry): Cua Cloud-ended creates report cloud_ended, not unsupported (CUA-1957) (#5644)

Francesco Bonacci1516be78c69c
diff --git a/docs/content/docs/cua-sdk/concepts/telemetry-error-kinds.mdx b/docs/content/docs/cua-sdk/concepts/telemetry-error-kinds.mdx
index f8f28806f5..e45c9d472a 100644
--- a/docs/content/docs/cua-sdk/concepts/telemetry-error-kinds.mdx
+++ b/docs/content/docs/cua-sdk/concepts/telemetry-error-kinds.mdx
@@ -27,6 +27,7 @@ error text.
| `file_access` | A file or folder could not be written (access denied, in use, path too long). |
| `network` | The machine could not reach the network (DNS, proxy, certificate) outside the image download. |
| `quota_exceeded` | The account's quota, plan limit or credits ran out. |
+| `cloud_ended` | The create asked for Cua Cloud, which has ended. The create is refused up front; it is not a failure to fix. |
| `cancelled` | You cancelled the create. |
Otherwise it is the error's type (for example `unauthenticated`, `timeout`,
diff --git a/libs/cua/crates/cua-create-failure/src/lib.rs b/libs/cua/crates/cua-create-failure/src/lib.rs
index 9d06088b8c..7eea2b922c 100644
--- a/libs/cua/crates/cua-create-failure/src/lib.rs
+++ b/libs/cua/crates/cua-create-failure/src/lib.rs
@@ -38,6 +38,12 @@ pub fn create_failure_kind<'v>(
let phase = phase.trim();
let variant = variant.trim();
let flat = flatten(variant);
+ // Cua Cloud has ended: every cloud create is refused, whatever the error
+ // case that carries it (`Unsupported`, `CloudEnded`). Its own word keeps a
+ // known refusal out of the failures that need a fix.
+ if flat == "cloudended" || message.to_ascii_lowercase().contains("cua cloud has ended") {
+ return "cloud_ended";
+ }
match flat.as_str() {
"cloudcreditexhausted" | "creditexhausted" | "limitexceeded" => return "quota_exceeded",
// A specific case from the caller stays; a timeout is refined by
@@ -404,7 +410,10 @@ mod tests {
#[test]
fn every_cause_word_is_in_the_telemetry_schema() {
- for k in TEXT_KINDS.iter().chain(&["quota_exceeded", "other"]) {
+ for k in TEXT_KINDS
+ .iter()
+ .chain(&["quota_exceeded", "cloud_ended", "other"])
+ {
assert!(
cua_telemetry::schema::ERROR_KINDS.contains(k),
"{k} missing from ERROR_KINDS"
@@ -538,6 +547,28 @@ mod tests {
assert_eq!(kind("", "", "cloud_credit_exhausted"), "quota_exceeded");
}
+ /// Cua Cloud ended: a cloud create is refused with its own word, not the
+ /// generic `unsupported` that hid a known refusal among real failures.
+ #[test]
+ fn a_cloud_create_after_the_end_of_cua_cloud_is_cloud_ended() {
+ let msg = "unsupported: Cua Cloud has ended; use a local sandbox or your own computer. \
+ See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended";
+ assert_eq!(
+ create_failure_kind(msg, "", "Unsupported", false),
+ "cloud_ended"
+ );
+ assert_eq!(create_failure_kind(msg, "", "", false), "cloud_ended");
+ assert_eq!(
+ create_failure_kind("", "", "CloudEnded", false),
+ "cloud_ended"
+ );
+ // Other unsupported errors keep their case.
+ assert_eq!(
+ create_failure_kind("no such feature", "", "Unsupported", true),
+ "Unsupported"
+ );
+ }
+
#[test]
fn runtime_causes() {
assert_eq!(
diff --git a/libs/cua/crates/cua-telemetry/src/schema.rs b/libs/cua/crates/cua-telemetry/src/schema.rs
index 3ae1be1ece..d3f1b1034e 100644
--- a/libs/cua/crates/cua-telemetry/src/schema.rs
+++ b/libs/cua/crates/cua-telemetry/src/schema.rs
@@ -159,6 +159,9 @@ pub const ERROR_KINDS: &[&str] = &[
"virtualization_unavailable",
// The account's sandbox quota, plan limit or credits ran out.
"quota_exceeded",
+ // Cua Cloud has ended: a cloud create is refused up front. Expected, so
+ // reports can leave it out of the failures that need a fix.
+ "cloud_ended",
"env",
"http",
"unauthenticated",