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: stop Cua Cloud (on="cloud") with a clear "Cua Cloud has ended" error (CUA-1854) (#5415)

Francesco Bonacci5d78ec8b7705
diff --git a/apps/cua-spaces-desktop/src/bridge/settings.ts b/apps/cua-spaces-desktop/src/bridge/settings.ts
index 51d54d2df3..e070c3f81a 100644
--- a/apps/cua-spaces-desktop/src/bridge/settings.ts
+++ b/apps/cua-spaces-desktop/src/bridge/settings.ts
@@ -147,7 +147,7 @@ export function settingsMethods(ctx: BridgeContext): Handlers {
model.changed("settings");
return;
case "default-location":
- save({ defaultLocation: option === "cloud" ? model.native.AppLocation.Cloud : model.native.AppLocation.Local });
+ save({ defaultLocation: model.native.AppLocation.Local }); // Cua Cloud has ended
return;
case "auto-connect":
save({ autoConnect: option === "on" });
diff --git a/apps/cua-spaces-desktop/src/bridge/spaces.ts b/apps/cua-spaces-desktop/src/bridge/spaces.ts
index e8c824bbd2..86056b2755 100644
--- a/apps/cua-spaces-desktop/src/bridge/spaces.ts
+++ b/apps/cua-spaces-desktop/src/bridge/spaces.ts
@@ -131,7 +131,7 @@ export function spacesMethods(ctx: BridgeContext): Handlers {
if (!native.appCreatesIsPending(pendingId)) throw Failure.badArgs("pendingId: pending:<id>");
const config = args.config;
if (!config || typeof config !== "object" || Array.isArray(config)) throw Failure.badArgs("config: object");
- const defaultOn = model.settings.defaultLocation === native.AppLocation.Cloud ? "cloud" : "local";
+ const defaultOn = "local"; // Cua Cloud has ended
const a = createArgs(native, config as BridgeArgs, defaultOn);
// The page sends the plan's OS (the pending row's icon).
const os = (typeof args.os === "string" ? osOf(native, args.os) : undefined) ?? native.AppSpaceOs.Unknown;
diff --git a/apps/cua-spaces-desktop/test/host-bridge.test.ts b/apps/cua-spaces-desktop/test/host-bridge.test.ts
index 01d8380506..8f5f652329 100644
--- a/apps/cua-spaces-desktop/test/host-bridge.test.ts
+++ b/apps/cua-spaces-desktop/test/host-bridge.test.ts
@@ -511,7 +511,8 @@ describe.skipIf(!built)("This machine, Devices and Settings on the app core", ()
await call("settings.choose", { row: "team-current", option: "org-2" });
expect(model.settings.currentTeamId).toBe("org-2");
await call("settings.choose", { row: "default-location", option: "cloud" });
- expect(model.settings.defaultLocation).toBe(native.AppLocation.Cloud);
+ // Cua Cloud has ended: the default stays on this machine.
+ expect(model.settings.defaultLocation).toBe(native.AppLocation.Local);
await call("settings.choose", { row: "telemetry", option: "off" });
expect(model.telemetry?.status().enabled).toBe(false);
await call("settings.choose", { row: "launch-at-login", option: "on" });
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
index 616d4dc9cd..7ac87eaa3b 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
@@ -1457,7 +1457,7 @@ public final class AppModel {
show(error: LiveSpacesBackend.words(error))
}
case "default-location":
- settings.defaultLocation = option == "cloud" ? .cloud : .local
+ settings.defaultLocation = .local // Cua Cloud has ended: only This Mac is a default
saveSettings()
case "auto-connect":
settings.autoConnect = option == "on"
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
index e65c7b5b09..bbf6651c5a 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
@@ -556,7 +556,7 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {
let pendingId = try string(args, "pendingId")
guard appCreatesIsPending(id: pendingId) else { throw Failure.badArgs("pendingId: pending:<id>") }
guard let config = args["config"] as? [String: Any] else { throw Failure.badArgs("config: object") }
- let createArgs = try Self.createArgs(config, defaultOn: model.settings.defaultLocation == .cloud ? "cloud" : "local")
+ let createArgs = try Self.createArgs(config, defaultOn: "local")
// The page sends the plan's OS (the pending row's icon).
let os = (args["os"] as? String).flatMap(AppSpaceOs.init(word:)) ?? .unknown
let id: String
diff --git a/apps/cua-spaces-web/src/bridge/adapters/demo/new-space.ts b/apps/cua-spaces-web/src/bridge/adapters/demo/new-space.ts
index 77c254d169..cb9bdd5b15 100644
--- a/apps/cua-spaces-web/src/bridge/adapters/demo/new-space.ts
+++ b/apps/cua-spaces-web/src/bridge/adapters/demo/new-space.ts
@@ -64,11 +64,11 @@ export interface DemoNewSpaceState {
export const demoNewSpaceState = (macHost: boolean): DemoNewSpaceState => ({ macHost: macHost ? { vmsRunning: 2 } : null });
/** The SwiftUI host's answer (`WebUIBridge.createOptions`) for this demo Mac. */
-export function demoMacHostOptions(defaultLocation: string, vmsRunning: number, pending: boolean): NewSpaceOptions {
+export function demoMacHostOptions(_defaultLocation: string, vmsRunning: number, pending: boolean): NewSpaceOptions {
const d = DEMO_NEW_SPACE_OPTIONS;
const hd = { availableBytes: 212 * GB, totalBytes: 494 * GB, name: "Macintosh HD" };
const env: WizardEnv & { localDetails: Record<string, string> | null; lumeSource: string | null; linuxSource: string | null } = {
- defaultLocation: defaultLocation === "cloud" ? "cloud" : "local",
+ defaultLocation: "local",
cloudAvailable: !pending,
localAvailable: true,
localReason: null,
diff --git a/apps/cua-spaces-web/src/bridge/adapters/webkit.ts b/apps/cua-spaces-web/src/bridge/adapters/webkit.ts
index a3fa0d9313..b4237f58bf 100644
--- a/apps/cua-spaces-web/src/bridge/adapters/webkit.ts
+++ b/apps/cua-spaces-web/src/bridge/adapters/webkit.ts
@@ -560,7 +560,7 @@ export function createWebkitAdapter(
await choose("telemetry", value ? "on" : "off");
break;
case "defaultLocation":
- if (value !== "local" && value !== "cloud") throw new HostError("New Spaces can start on This Mac or Cua Cloud here", "unsupported");
+ if (value !== "local") throw new HostError("New Spaces can start on This Mac here", "unsupported");
await choose("default-location", value);
break;
case "launchAtLogin":
diff --git a/apps/cua-spaces-web/src/bridge/derive.ts b/apps/cua-spaces-web/src/bridge/derive.ts
index 0a3027e5f0..561cea81b6 100644
--- a/apps/cua-spaces-web/src/bridge/derive.ts
+++ b/apps/cua-spaces-web/src/bridge/derive.ts
@@ -597,7 +597,7 @@ export function settingsPage(
signIn: signIn ?? { kind: "idle" },
canSignOut: session?.fleet.authMode === "user",
menuBar: settings.values.menuBar,
- defaultLocation: loc === "cloud" ? "cloud" : loc === "local" ? "local" : loc.startsWith("host:") ? "host" : "yours",
+ defaultLocation: loc === "cloud" || loc === "local" ? "local" : loc.startsWith("host:") ? "host" : "yours",
locationLockedBy: settings.defaultLocation?.source === "env" ? (settings.defaultLocation.env ?? null) : null,
telemetry: settings.telemetry
? {
diff --git a/apps/cua-spaces-web/src/bridge/new-space.ts b/apps/cua-spaces-web/src/bridge/new-space.ts
index 742c7f88c0..736172ae4d 100644
--- a/apps/cua-spaces-web/src/bridge/new-space.ts
+++ b/apps/cua-spaces-web/src/bridge/new-space.ts
@@ -108,7 +108,7 @@ export interface EnvInput {
function location(core: CoreClient, on: string | undefined): WizardLocation {
if (!on || on === "local") return "local";
- if (on === "cloud") return "cloud";
+ if (on === "cloud") return "local"; // Cua Cloud has ended
if (on.startsWith("host:")) return "host";
return isCloudWord(core, on) ? "yours" : "local";
}
diff --git a/apps/cua-spaces-web/src/routes/settings/index.tsx b/apps/cua-spaces-web/src/routes/settings/index.tsx
index 36f5711d9a..2159404738 100644
--- a/apps/cua-spaces-web/src/routes/settings/index.tsx
+++ b/apps/cua-spaces-web/src/routes/settings/index.tsx
@@ -232,7 +232,6 @@ function FallbackSettingsPage() {
const values = settings?.values;
const locationOptions = [
{ value: "local", label: thisComputerLabel() },
- { value: "cloud", label: "Cua Cloud" },
...machines.filter((m) => !m.current).map((m) => ({ value: `host:${m.id}`, label: m.name })),
];
const location = values?.defaultLocation ?? "local";
diff --git a/apps/cua-spaces-web/src/routes/spaces/index.tsx b/apps/cua-spaces-web/src/routes/spaces/index.tsx
index a28ddf910c..2ae18b986f 100644
--- a/apps/cua-spaces-web/src/routes/spaces/index.tsx
+++ b/apps/cua-spaces-web/src/routes/spaces/index.tsx
@@ -102,7 +102,7 @@ function SpacesPage() {
</Button>
}
>
- Create one on {thisComputerText()} or on Cua Cloud.
+ Create one on {thisComputerText()}.
</EmptyState>
) : shown.length === 0 && query.trim() ? (
<EmptyState icon={<SearchIcon />} title="No matches">
diff --git a/apps/cua-spaces/src-tauri/tests/commands.rs b/apps/cua-spaces/src-tauri/tests/commands.rs
index afe62850cd..c1e6ab95e0 100644
--- a/apps/cua-spaces/src-tauri/tests/commands.rs
+++ b/apps/cua-spaces/src-tauri/tests/commands.rs
@@ -11,7 +11,7 @@ use async_trait::async_trait;
use cua_fleet::testing::FakeFleet;
use cua_sandbox_core::{
InstanceStatus, LocalEndpoints, LocalInstance, LocalRuntime, LocalStartSpec, LocalSummary,
- RuntimeError,
+ RuntimeError, CLOUD_ENDED,
};
use cua_spaces::Provider;
use cua_spaces_lib::core::{AppCore, CoreConfig, SpaceCreateConfig, StreamOpts, StreamTargetArg};
@@ -273,6 +273,7 @@ async fn an_unreachable_space_is_listed_within_the_probe_bound() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn cloud_spaces_bind_through_the_gateway_and_delete_removes_the_sandbox() {
let home = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -345,40 +346,21 @@ async fn runtime_image_pairing_errors_come_from_the_sdk() {
let mut c = CoreConfig::hermetic(home.path());
c.fleet_client = Some(fake.client());
let app = AppCore::new(c);
- // gVisor cannot run a containerDisk: the SDK's one check, from the
- // image's manifest (here a fixture), not its tag.
- cua_fleet::testing::set_image_variant(IMAGE, cua_fleet::ImageVariant::ContainerDisk);
- let e = app
- .create_space(SpaceCreateConfig {
- on: Some("cloud".into()),
- image: Some(IMAGE.into()),
- runtime: Some("gvisor".into()),
- name: None,
- ..Default::default()
- })
- .await
- .unwrap_err();
- assert!(e.contains("containerDisk"), "{e}");
+ // Cua Cloud has ended: a cloud create fails with the one message, before
+ // any pairing check and before any Fleet request, whatever the runtime.
+ for runtime in [Some("gvisor"), Some("firecracker"), Some("qemu"), None] {
+ let e = app
+ .create_space(SpaceCreateConfig {
+ on: Some("cloud".into()),
+ image: Some(IMAGE.into()),
+ runtime: runtime.map(Into::into),
+ ..Default::default()
+ })
+ .await
+ .unwrap_err();
+ assert_eq!(e, CLOUD_ENDED, "{runtime:?}: {e}");
+ }
assert!(fake.requests().is_empty(), "refused before any request");
- let e = app
- .create_space(SpaceCreateConfig {
- on: Some("cloud".into()),
- runtime: Some("firecracker".into()),
- ..Default::default()
- })
- .await
- .unwrap_err();
- assert!(e.contains("firecracker"), "{e}");
- // A runtime the cloud does not offer lists the ones it does.
- let e = app
- .create_space(SpaceCreateConfig {
- on: Some("cloud".into()),
- runtime: Some("qemu".into()),
- ..Default::default()
- })
- .await
- .unwrap_err();
- assert!(e.contains("kubevirt") || e.contains("gvisor"), "{e}");
// A kind that contradicts the runtime is refused locally too.
let e = app
.create_space(SpaceCreateConfig {
@@ -394,11 +376,13 @@ async fn runtime_image_pairing_errors_come_from_the_sdk() {
}
#[tokio::test]
-async fn without_cloud_auth_creates_say_how_to_sign_in() {
+async fn cloud_creates_fail_because_cua_cloud_has_ended() {
let home = tempfile::tempdir().unwrap();
let app = core(home.path());
let status = app.fleet_status(false).await;
assert!(!status.configured);
+ // Signed in or not, a cloud create says the same thing: Cua Cloud has
+ // ended, with no "sign in" way out.
let e = app
.create_space(SpaceCreateConfig {
on: Some("cloud".into()),
@@ -406,7 +390,11 @@ async fn without_cloud_auth_creates_say_how_to_sign_in() {
})
.await
.unwrap_err();
- assert!(e.contains("sign in") || e.contains("CUA_CLIENT_ID"), "{e}");
+ assert_eq!(e, CLOUD_ENDED, "{e}");
+ assert!(
+ !e.contains("sign in") && !e.contains("CUA_CLIENT_ID"),
+ "{e}"
+ );
assert!(!e.to_lowercase().contains("claim"), "{e}");
}
@@ -429,24 +417,30 @@ async fn default_location_is_stored_in_the_cua_home_config() {
assert_eq!(before.env, None);
}
- let after = app.set_default_location("cloud").unwrap();
- let toml = std::fs::read_to_string(home.path().join("config.toml")).unwrap();
- assert!(
- toml.contains("[default]") && toml.contains("on = \"cloud\""),
- "{toml}"
- );
+ // Cua Cloud has ended: it cannot be saved as the default location, and
+ // nothing is written.
+ let e = app.set_default_location("cloud").unwrap_err();
+ assert_eq!(e, CLOUD_ENDED, "{e}");
+ assert!(!home.path().join("config.toml").exists());
if !env_override {
+ assert_eq!(app.default_location().unwrap().value, "local");
+ // A cloud default saved before it ended never creates there: with no
+ // location given, the create fails with the same message.
+ std::fs::write(
+ home.path().join("config.toml"),
+ "[default]\non = \"cloud\"\n",
+ )
+ .unwrap();
+ let after = app.default_location().unwrap();
assert_eq!(
(after.value.as_str(), after.source.as_str()),
("cloud", "config")
);
- // No location given: the create goes to the default (the cloud,
- // which is not signed in here).
let e = app
.create_space(SpaceCreateConfig::default())
.await
.unwrap_err();
- assert!(e.contains("sign in") || e.contains("CUA_CLIENT_ID"), "{e}");
+ assert_eq!(e, CLOUD_ENDED, "{e}");
}
// An existing machine or an engine word is not a location.
diff --git a/apps/cua-spaces/src/components/SettingsPanel.tsx b/apps/cua-spaces/src/components/SettingsPanel.tsx
index 92acc660e4..e77aa3d1d2 100644
--- a/apps/cua-spaces/src/components/SettingsPanel.tsx
+++ b/apps/cua-spaces/src/components/SettingsPanel.tsx
@@ -384,7 +384,7 @@ export function SettingsPanel({
signIn: phase,
canSignOut: Boolean(auth) && Boolean(identity),
menuBar,
- defaultLocation: defaultLocation?.value === "cloud" ? "cloud" : "local",
+ defaultLocation: "local",
locationLockedBy: defaultLocation?.source === "env" ? (defaultLocation.env ?? "CUA_DEFAULT_ON") : null,
telemetry: telemetryView
? {
diff --git a/apps/cua-spaces/src/components/desktop/MainWindow.tsx b/apps/cua-spaces/src/components/desktop/MainWindow.tsx
index e4926206af..bc21979b28 100644
--- a/apps/cua-spaces/src/components/desktop/MainWindow.tsx
+++ b/apps/cua-spaces/src/components/desktop/MainWindow.tsx
@@ -247,7 +247,7 @@ export function MainWindow({
const q = new URLSearchParams(window.location.search);
const actions: ({ type: string } & Record<string, unknown>)[] = [];
if (q.get('image')) actions.push({ type: 'choose-image', ref: q.get('image') });
- actions.push({ type: 'set-placement', placement: q.get('on') === 'cloud' ? 'cloud' : 'local' });
+ actions.push({ type: 'set-placement', placement: 'local' });
actions.push({ type: 'next' });
if (Number(q.get('disk'))) actions.push({ type: 'set-disk', diskGb: Number(q.get('disk')) });
if (Number(q.get('cpus'))) actions.push({ type: 'set-cpus', cpus: Number(q.get('cpus')) });
@@ -941,11 +941,7 @@ export function MainWindow({
>
<NewSpaceWizard
defaultLocation={
- sync.defaultLocation.value === 'cloud'
- ? 'cloud'
- : isCloudWord(sync.defaultLocation.value)
- ? 'yours'
- : 'local'
+ isCloudWord(sync.defaultLocation.value) ? 'yours' : 'local'
}
clouds={clouds}
hosts={hosts}
diff --git a/docs/content/docs/cua-bench/guides/adapter-benchmarks.mdx b/docs/content/docs/cua-bench/guides/adapter-benchmarks.mdx
index 39df7f59b8..801532cd2b 100644
--- a/docs/content/docs/cua-bench/guides/adapter-benchmarks.mdx
+++ b/docs/content/docs/cua-bench/guides/adapter-benchmarks.mdx
@@ -90,9 +90,8 @@ uv run samples/python/3_osworld_fleet.py # OSWORLD_LOCAL=1 boot
- Downscale the 1920x1080 screenshot to about 1280 px for the model and scale
clicks back.
- Local VM guests have outbound network by default (`network="none"` turns it off).
-- A cloud sandbox that never becomes ready: the probe is TCP on `5000`, so the
- image is still pulling or the guest has no DHCP lease. `cua fleet pools ls`
- shows its capacity.
+- A sandbox that never becomes ready: the probe is TCP on `5000`, so the
+ image is still pulling or the guest has no DHCP lease.
## bench-web
diff --git a/docs/content/docs/cua-bench/guides/convert-benchmark-images.mdx b/docs/content/docs/cua-bench/guides/convert-benchmark-images.mdx
index d3515a38e5..6a2ff81a2d 100644
--- a/docs/content/docs/cua-bench/guides/convert-benchmark-images.mdx
+++ b/docs/content/docs/cua-bench/guides/convert-benchmark-images.mdx
@@ -27,5 +27,3 @@ listed in [Adapter benchmarks](/cua-bench/guides/adapter-benchmarks).
- On an arm64 host, amd64 images run under x86 emulation, where Mesa's
llvmpipe draws a black screen; server, file and spacesd checks still work.
Doctor and screen evidence for amd64 need a native amd64 host.
-- A cloud sandbox of a private package never becomes ready until pool pull
- secrets ship; publish the package publicly or use an allowlisted registry.
diff --git a/docs/content/docs/cua-bench/reference/cli/env.mdx b/docs/content/docs/cua-bench/reference/cli/env.mdx
index 2f46ff896d..a200b8f5e3 100644
--- a/docs/content/docs/cua-bench/reference/cli/env.mdx
+++ b/docs/content/docs/cua-bench/reference/cli/env.mdx
@@ -15,7 +15,7 @@ description: "Cloud pools and local sandboxes, sign-in, status and cleanup."
| [`cb env`](#cb-env) | List or garbage-collect sandboxes and pools. |
| [`cb env ls`](#cb-env-ls) | List managed cloud pools and claims. |
| [`cb env gc`](#cb-env-gc) | Delete idle managed pools and stuck claims. |
-| [`cb login`](#cb-login) | Sign in for --on cloud (runs `cua auth login`). |
+| [`cb login`](#cb-login) | Removed: Cua Cloud has ended. |
| [`cb status`](#cb-status) | Show system status dashboard. |
| [`cb prune`](#cb-prune) | Clean up cua-bench run data (and 0.2.x image leftovers). |
@@ -87,7 +87,7 @@ cb env gc --idle 2h
## `cb login`
-Sign in for --on cloud (runs `cua auth login`).
+Removed: Cua Cloud has ended.
```text output
cb login [OPTIONS]
diff --git a/docs/content/docs/cua-bench/reference/cli/index.mdx b/docs/content/docs/cua-bench/reference/cli/index.mdx
index 47b90dfbe7..a99b129929 100644
--- a/docs/content/docs/cua-bench/reference/cli/index.mdx
+++ b/docs/content/docs/cua-bench/reference/cli/index.mdx
@@ -75,7 +75,7 @@ Cloud pools and local sandboxes, sign-in, status and cleanup. [Reference](/cua-b
| <span id="cb-env"></span>[`cb env`](/cua-bench/reference/cli/env#cb-env) | List or garbage-collect sandboxes and pools. |
| <span id="cb-env-ls"></span>[`cb env ls`](/cua-bench/reference/cli/env#cb-env-ls) | List managed cloud pools and claims. |
| <span id="cb-env-gc"></span>[`cb env gc`](/cua-bench/reference/cli/env#cb-env-gc) | Delete idle managed pools and stuck claims. |
-| <span id="cb-login"></span>[`cb login`](/cua-bench/reference/cli/env#cb-login) | Sign in for --on cloud (runs `cua auth login`). |
+| <span id="cb-login"></span>[`cb login`](/cua-bench/reference/cli/env#cb-login) | Removed: Cua Cloud has ended. |
| <span id="cb-status"></span>[`cb status`](/cua-bench/reference/cli/env#cb-status) | Show system status dashboard. |
| <span id="cb-prune"></span>[`cb prune`](/cua-bench/reference/cli/env#cb-prune) | Clean up cua-bench run data (and 0.2.x image leftovers). |
diff --git a/docs/content/docs/cua-bench/reference/cli/run.mdx b/docs/content/docs/cua-bench/reference/cli/run.mdx
index 3868f05124..08fee56534 100644
--- a/docs/content/docs/cua-bench/reference/cli/run.mdx
+++ b/docs/content/docs/cua-bench/reference/cli/run.mdx
@@ -66,7 +66,7 @@ cb run task [OPTIONS] <task_path>
| <span id="cb-run-task--agent-import-path"></span>`--agent-import-path` | | string | | Import path for custom agent (e.g., "path.to.agent:MyCustomAgent"). |
| <span id="cb-run-task--model"></span>`--model` | | string | | Model to use with the agent (e.g., anthropic/claude-sonnet-4-20250514). |
| <span id="cb-run-task--max-steps"></span>`--max-steps` | | integer | `100` | Maximum number of steps for agent execution (default: 100). |
-| <span id="cb-run-task--on"></span>`--on` | | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
+| <span id="cb-run-task--on"></span>`--on` | | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
| <span id="cb-run-task--kind"></span>`--kind` | | `auto` \| `container` \| `vm` | | What kind of sandbox: container or vm. Default auto: Linux as a container unless the task or image says VM; Windows, macOS and Android are VM-only. Default: CUA_DEFAULT_KIND, else `cua config set default.kind`. |
| <span id="cb-run-task--runtime"></span>`--runtime` | | `auto` \| `gvisor` \| `runc` \| `qemu` \| `lume` \| `kubevirt` | | Which engine: gvisor or runc (local containers), qemu or lume (local VMs), gvisor or kubevirt (cloud containers, VMs). Implies its kind. Default auto: the SDK picks (CUA_DEFAULT_RUNTIME, else `cua config set default.runtime`). |
| <span id="cb-run-task--image"></span>`--image` | | string | | Image for every task (overrides the task's setup_config.image): an OS alias (linux, windows, macos:tahoe), ghcr.io/trycua/&lt;os&gt;, any registry ref or a digest, or pool:&lt;name&gt; for an existing Fleet pool. Env: CUA_BENCH_IMAGE. |
@@ -91,8 +91,8 @@ cb run task [OPTIONS] <task_path>
# Run variant 0 with the oracle solution
cb run task ./tasks/hello_file_env
-# Run variant 2 with an agent in the cloud
-cb run task ./tasks/hello_file_env --variant-id 2 --agent cua-agent --model anthropic/claude-sonnet-4-20250514 --on cloud
+# Run variant 2 with an agent on this machine
+cb run task ./tasks/hello_file_env --variant-id 2 --agent cua-agent --model anthropic/claude-sonnet-4-20250514 --on local
# Show what would run without starting a sandbox
cb run ./tasks/hello_file_env --dry-run
@@ -119,7 +119,7 @@ cb run dataset [OPTIONS] <dataset_path>
| <span id="cb-run-dataset--agent-import-path"></span>`--agent-import-path` | | string | | Import path for custom agent (e.g., "path.to.agent:MyCustomAgent"). |
| <span id="cb-run-dataset--model"></span>`--model` | | string | | Model to use with the agent (e.g., anthropic/claude-sonnet-4-20250514). |
| <span id="cb-run-dataset--max-steps"></span>`--max-steps` | | integer | `100` | Maximum number of steps for agent execution (default: 100). |
-| <span id="cb-run-dataset--on"></span>`--on` | | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
+| <span id="cb-run-dataset--on"></span>`--on` | | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
| <span id="cb-run-dataset--kind"></span>`--kind` | | `auto` \| `container` \| `vm` | | What kind of sandbox: container or vm. Default auto: Linux as a container unless the task or image says VM; Windows, macOS and Android are VM-only. Default: CUA_DEFAULT_KIND, else `cua config set default.kind`. |
| <span id="cb-run-dataset--runtime"></span>`--runtime` | | `auto` \| `gvisor` \| `runc` \| `qemu` \| `lume` \| `kubevirt` | | Which engine: gvisor or runc (local containers), qemu or lume (local VMs), gvisor or kubevirt (cloud containers, VMs). Implies its kind. Default auto: the SDK picks (CUA_DEFAULT_RUNTIME, else `cua config set default.runtime`). |
| <span id="cb-run-dataset--image"></span>`--image` | | string | | Image for every task (overrides the task's setup_config.image): an OS alias (linux, windows, macos:tahoe), ghcr.io/trycua/&lt;os&gt;, any registry ref or a digest, or pool:&lt;name&gt; for an existing Fleet pool. Env: CUA_BENCH_IMAGE. |
@@ -276,7 +276,7 @@ cb interact [OPTIONS] <env_path>
| <span id="cb-interact--max-steps"></span>`--max-steps` | integer | | Maximum number of env.step() calls before stopping. |
| <span id="cb-interact--screenshot"></span>`--screenshot` | string | | Save a screenshot to this file. |
| <span id="cb-interact--trace-out"></span>`--trace-out` | string | | Record a trace and save it as a dataset to this path on exit. |
-| <span id="cb-interact--on"></span>`--on` | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
+| <span id="cb-interact--on"></span>`--on` | `local` \| `cloud` \| `e2b` \| `daytona` \| `modal` \| `cloudflare` \| `vercel` \| `morph` \| `runloop` \| `fly` \| `blaxel` \| `codesandbox` \| `northflank` \| `aws` \| `gcp` | | Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local. |
| <span id="cb-interact--kind"></span>`--kind` | `auto` \| `container` \| `vm` | | What kind of sandbox: container or vm. Default auto: Linux as a container unless the task or image says VM; Windows, macOS and Android are VM-only. Default: CUA_DEFAULT_KIND, else `cua config set default.kind`. |
| <span id="cb-interact--runtime"></span>`--runtime` | `auto` \| `gvisor` \| `runc` \| `qemu` \| `lume` \| `kubevirt` | | Which engine: gvisor or runc (local containers), qemu or lume (local VMs), gvisor or kubevirt (cloud containers, VMs). Implies its kind. Default auto: the SDK picks (CUA_DEFAULT_RUNTIME, else `cua config set default.runtime`). |
| <span id="cb-interact--image"></span>`--image` | string | | Image for every task (overrides the task's setup_config.image): an OS alias (linux, windows, macos:tahoe), ghcr.io/trycua/&lt;os&gt;, any registry ref or a digest, or pool:&lt;name&gt; for an existing Fleet pool. Env: CUA_BENCH_IMAGE. |
diff --git a/docs/content/docs/cua-cli/guides/authentication.mdx b/docs/content/docs/cua-cli/guides/authentication.mdx
index 609779e2d6..01ddf866f7 100644
--- a/docs/content/docs/cua-cli/guides/authentication.mdx
+++ b/docs/content/docs/cua-cli/guides/authentication.mdx
@@ -1,6 +1,6 @@
---
title: Authenticate
-description: 'Sign in with cua auth login, see which Fleet credential the CLI uses, create API keys, and authenticate in GitHub Actions.'
+description: 'Sign in with cua auth login, see which credential the CLI uses, and create API keys.'
---
import { Callout } from 'fumadocs-ui/components/callout';
@@ -13,7 +13,7 @@ share one credential store. Local sandboxes need no sign-in.
```bash test="cli-shape" id="cua-auth-login"
cua auth login # browser (PKCE, loopback redirect)
cua auth login --remote # device code, for SSH sessions
-cua auth whoami # the Fleet credential in use, checked against Fleet
+cua auth whoami # the credential in use
cua auth status # session and expiry, no network
cua auth logout # revoke and remove the session
```
@@ -35,17 +35,16 @@ printed.
is a new app to the Keychain every time it is rebuilt, so it uses the file and
never asks for Keychain access.
-## Which credential Fleet uses
+## Which credential the CLI uses
The first that is set wins:
| Order | Source | For |
|-------|--------|-----|
-| 1 | `FLEETS_TOKEN` | A workload token, for example from `cua wif-token github`. |
-| 2 | `CUA_CLIENT_ID` + `CUA_CLIENT_SECRET` | An API key, for scripts and servers (`CUA_TOKEN_URL` overrides the endpoint). |
-| 3 | The `cua auth login` session | Interactive use. |
+| 1 | `CUA_CLIENT_ID` + `CUA_CLIENT_SECRET` | An API key, for scripts and servers (`CUA_TOKEN_URL` overrides the endpoint). |
+| 2 | The `cua auth login` session | Interactive use. |
-Legacy `key_...` keys belong to the retired VM API and do not work with Fleet.
+Legacy `key_...` keys belong to the retired VM API and no longer work.
## API keys
@@ -57,28 +56,9 @@ cua auth keys ls
cua auth keys rm <id>
```
-## GitHub Actions
-
-`cua wif-token github` exchanges the job's OIDC identity for a Fleet token. It
-needs `id-token: write` and a Fleet trust policy for the repository:
-
-```yaml test="config" id="yaml-config"
-permissions:
- id-token: write
- contents: read
-
-steps:
- - name: Use a cloud sandbox
- run: |
- export FLEETS_TOKEN="$(cua wif-token github)"
- cua sb create linux --on cloud --name "run-$GITHUB_RUN_ID"
- cua sb exec "run-$GITHUB_RUN_ID" "uname -a"
- cua sb rm "run-$GITHUB_RUN_ID" --force
-```
-
<Callout type="warn">
The stored refresh token mints access tokens until revoked. On shared hosts,
- run `cua auth logout` when done, or use an API key or workload token.
+ run `cua auth logout` when done, or use an API key.
</Callout>
## Targeting staging
@@ -105,10 +85,7 @@ cua auth status # starts with "Environment: staging (...)"
Each environment has its own session, host enrollment, Spaces registry and
daemon, so signing in to staging never replaces or sends your production
-session, and the other way round. Fleet has no staging deployment: under
-`CUA_ENV=staging` the CLI does not send the staging session to
-`https://run.cua.ai`, so cloud sandboxes need `CUA_FLEET_BASE_URL` set to a
-non-production Fleet, or an API key.
+session, and the other way round.
Usage telemetry follows the environment too: staging events go to the staging
PostHog project, never to production's. `CUA_POSTHOG_KEY` overrides the
@@ -125,5 +102,5 @@ For the macOS app, launch it with the variable set:
first. The host service (`cua host setup`) has one name on each machine, so pair
a staging host on a separate machine or VM.
-Other variables (`CUA_FLEET_BASE_URL`, `CUA_OIDC_ISSUER`, `CUA_AUTH_FLOW`,
+Other variables (`CUA_OIDC_ISSUER`, `CUA_AUTH_FLOW`,
`CUA_NO_BROWSER`, ...) are listed in the [CLI reference](/cua-cli/reference/cli).
diff --git a/docs/content/docs/cua-cli/guides/mcp-server.mdx b/docs/content/docs/cua-cli/guides/mcp-server.mdx
index 47a3288f5d..423865d8b3 100644
--- a/docs/content/docs/cua-cli/guides/mcp-server.mdx
+++ b/docs/content/docs/cua-cli/guides/mcp-server.mdx
@@ -18,8 +18,7 @@ claude mcp add cua -- cua mcp --sandbox dev --permissions sandbox:readonly,compu
`cua agents setup` adds this entry for detected agents. `--sandbox`
(`CUA_SANDBOX`) is the default target of the computer tools; each call can pass
-`sandbox`. Cloud sandboxes use the CLI's
-[credentials](/cua-cli/guides/authentication#which-credential-fleet-uses).
+`sandbox`.
Every tool is in [MCP tools](/cua-cli/reference/mcp-tools).
## Supported agents
diff --git a/docs/content/docs/cua-cli/index.mdx b/docs/content/docs/cua-cli/index.mdx
index 1dea42b2f2..e2209b5f7f 100644
--- a/docs/content/docs/cua-cli/index.mdx
+++ b/docs/content/docs/cua-cli/index.mdx
@@ -1,10 +1,10 @@
---
title: Cua CLI
-description: 'The cua command: sign-in, sandboxes local and cloud, one-shot computer actions, MCP, Spaces, unattended access and teleport.'
+description: 'The cua command: sign-in, sandboxes local and in your cloud, one-shot computer actions, MCP, Spaces, unattended access and teleport.'
---
`cua` is one binary built on the [cua SDK](/cua-sdk). It creates and drives
-sandboxes on this machine or in the cloud, serves them to AI agents over MCP,
+sandboxes on this machine or in your own cloud, serves them to AI agents over MCP,
and manages Spaces.
## Install
@@ -24,9 +24,9 @@ flags: [Cua Spaces quickstart](/spaces/quickstart#run).
| Group | Alias | Purpose |
|-------|-------|---------|
-| `cua auth` | | Sign in, session, Fleet identity, API keys ([Authentication](/cua-cli/guides/authentication)). |
+| `cua auth` | | Sign in, session, API keys ([Authentication](/cua-cli/guides/authentication)). |
| `cua agents` | | Install cua skills and the cua MCP server into AI coding agents. |
-| `cua sandbox` | `sb` | Create, list and operate sandboxes; `--on local\|cloud\|aws\|gcp\|modal\|direct:<addr>`, `--kind`, `--runtime`. |
+| `cua sandbox` | `sb` | Create, list and operate sandboxes; `--on local\|aws\|gcp\|modal\|direct:<addr>`, `--kind`, `--runtime`. |
| `cua config` | | User defaults: where sandboxes run (`default.on`), the default kind and runtime. |
| `cua do` | | One computer action (click, type, screenshot, ...) against the selected sandbox. |
| `cua mcp` | `serve-mcp` | Stdio MCP server ([MCP server](/cua-cli/guides/mcp-server)). |
@@ -35,14 +35,12 @@ flags: [Cua Spaces quickstart](/spaces/quickstart#run).
| `cua cloud` | | Your own AWS, Google Cloud or Modal account as a location ([Use your own cloud](/cua-sdk/guides/your-cloud)). |
| `cua host` | | [Unattended access](/spaces/guides/unattended-access) to this machine. |
| `cua teleport` | | [Move an app session](/spaces/guides/teleport-an-app) into a sandbox. |
-| `cua image` | `img` | Local OCI images and Fleet image resources. |
-| `cua fleet` | | Pools behind your cloud sandboxes (advanced). |
+| `cua image` | `img` | Local OCI images. |
| `cua spacesd` | | Talk to any cua-spacesd by URL. |
| `cua runtime` | | Inspect or provision local runtimes. |
| `cua cache` | | Disk used by images, sandboxes and logs, and its cleanup ([Disk usage](/cua-sdk/guides/disk-usage)). |
| `cua doctor` | | Check the host, an image and a sandbox's guest in one report. |
| `cua skills`, `cua trajectory` | `traj` | Recorded demonstrations and `cua do` sessions. |
-| `cua wif-token` | | GitHub Actions OIDC token for Fleet. |
Every command accepts `--json`, `--embedded`, `--daemon <addr>`,
`--daemon-token <token>` and `--state-dir <dir>`. The CLI uses a running
diff --git a/docs/content/docs/cua-sdk/concepts/how-sandboxes-work.mdx b/docs/content/docs/cua-sdk/concepts/how-sandboxes-work.mdx
index 5d48804db4..45e511ba48 100644
--- a/docs/content/docs/cua-sdk/concepts/how-sandboxes-work.mdx
+++ b/docs/content/docs/cua-sdk/concepts/how-sandboxes-work.mdx
@@ -9,7 +9,7 @@ description: The SDK, the daemon, cua-spacesd and the backends, where a sandbox
+------------- cua SDK (Rust core, UniFFI) -----------------+
embedded in your process, or a client of `cua daemon`
|
- local (gVisor, runc, QEMU, Lume) | cloud | direct | relay
+ local (gVisor, runc, QEMU, Lume) | your cloud | direct | relay
v
sandbox: any OCI image; optional cua-spacesd on port 3211
```
@@ -21,7 +21,7 @@ description: The SDK, the daemon, cua-spacesd and the backends, where a sandbox
| cua SDK and `cua` CLI | The client: a Rust core with generated bindings | Your process or machine |
| `cua daemon` | The SDK as a local service, so several processes (the CLI, the Spaces app, MCP clients, your script) share sandboxes, connections and credentials. `cua.connect()` instead of `cua.embedded()` | Your machine |
| cua-spacesd | The optional daemon inside a sandbox: one port (`3211`), gRPC and gRPC-Web. Input and accessibility go to Cua Driver in the guest | The sandbox |
-| Runtimes | Local: gVisor or runc (on Docker or Podman), QEMU, Lume. Cloud: gVisor containers and KubeVirt VMs | This machine or the cloud |
+| Runtimes | Local: gVisor or runc (on Docker or Podman), QEMU, Lume. Your cloud: a VM in your AWS or Google Cloud account, or a Modal sandbox | This machine or your cloud |
## Where, what kind, which engine
@@ -29,32 +29,30 @@ Every create takes the same three choices, all optional:
| Axis | SDK | CLI | Values | Default |
| --- | --- | --- | --- | --- |
-| Where | `on=` (cua-sandbox also `local=True/False`) | `--on` | `local`, `cloud`, `direct:<addr>` (an existing machine running cua-spacesd), a registered provider | `default.on`, else `local` |
+| Where | `on=` (cua-sandbox also `local=True`) | `--on` | `local`, `aws`, `gcp`, `modal` ([your cloud](/cua-sdk/guides/your-cloud)), `direct:<addr>` (an existing machine running cua-spacesd), a registered provider | `default.on`, else `local` |
| What kind | `kind=` | `--kind` | `auto`, `container`, `vm` | `auto` |
| Which engine | `runtime=` | `--runtime` | `auto` or an engine below | `auto` |
| Location | container | vm |
| --- | --- | --- |
| `local` | `gvisor` (auto when installed), `runc` | `qemu` (auto), `lume` (auto for macOS guests; Apple silicon only) |
-| `cloud` | `gvisor` | `kubevirt` |
| `direct:<addr>` | the existing machine: `auto` only | |
`auto` kind comes from the image: macOS and Windows images are VMs, an image
with a container rootfs is a container, and a disk-only image is a VM. So
-`ghcr.io/trycua/linux:24.04` is a gVisor container locally and in the cloud,
-and `--kind vm` picks its `-disk` variant (QEMU locally, KubeVirt in the
-cloud). A runtime implies its kind. A combination that does not exist fails
+`ghcr.io/trycua/linux:24.04` is a gVisor container locally, and `--kind vm` picks its `-disk` variant
+(QEMU locally). A runtime implies its kind. A combination that does not exist fails
with `InvalidPlacement`, listing the valid values.
Defaults resolve in this order, first match wins:
1. explicit: `--on` / `--kind` / `--runtime`, `on=` / `local=` / `kind=` / `runtime=`
2. env: `CUA_DEFAULT_ON`, `CUA_DEFAULT_KIND`, `CUA_DEFAULT_RUNTIME`
-3. config: `$CUA_HOME/config.toml` (`cua config set default.on cloud`)
+3. config: `$CUA_HOME/config.toml` (`cua config set default.on aws`)
4. built-in: `local`, `auto`, `auto`
A default kind or runtime that does not fit an explicit request is skipped.
-See [Choose where sandboxes run by default](/cua-sdk/guides/cloud#choose-where-sandboxes-run-by-default).
+See [Choose where sandboxes run by default](/cua-sdk/guides/local-runtimes#change-the-default).
## Sandboxes do not require a guest agent
@@ -77,7 +75,7 @@ a sandbox; deleting destroys it and its state.
| Pattern | Lifetime |
| --- | --- |
| `Sandbox.ephemeral(...)` | Deleted when the block exits |
-| `Sandbox.create(...)`, `cua sb create` | Until deleted; a cloud sandbox also lapses when nothing renews its TTL |
+| `Sandbox.create(...)`, `cua sb create` | Until deleted; a sandbox in your cloud also lapses at its time limit |
| `suspend` / `resume` | Local only |
| Direct sandbox | Deleting only forgets the record |
diff --git a/docs/content/docs/cua-sdk/guides/browse-the-web.mdx b/docs/content/docs/cua-sdk/guides/browse-the-web.mdx
index 52f11b66b3..25d9b04150 100644
--- a/docs/content/docs/cua-sdk/guides/browse-the-web.mdx
+++ b/docs/content/docs/cua-sdk/guides/browse-the-web.mdx
@@ -5,7 +5,7 @@ description: Give a coding agent (Claude Code, Codex, Cursor and others) a real
Once Cua is installed, a coding agent can browse the web with no other tool or
setup. The browser runs inside a sandbox, never on your machine: a local
-container (gVisor when installed), a VM, or a Cua Fleet sandbox. The agent
+container (gVisor when installed), or a VM. The agent
drives it through the sandbox's own Cua Driver, whose typed browser tools the
`cua` MCP server reaches with `call_tool`.
diff --git a/docs/content/docs/cua-sdk/guides/cloud.mdx b/docs/content/docs/cua-sdk/guides/cloud.mdx
deleted file mode 100644
index d4e818b7cc..0000000000
--- a/docs/content/docs/cua-sdk/guides/cloud.mdx
+++ /dev/null
@@ -1,145 +0,0 @@
----
-title: Run sandboxes in the cloud
-description: Run the same sandbox code in the Cua cloud, make the cloud your default, set up credentials, and see what differs from local.
----
-
-import { Callout } from 'fumadocs-ui/components/callout';
-
-<Callout type="warn" title="Cua Cloud ended on 16 October 2026">
- `on="cloud"` and `local=False` no longer reach a service. Run sandboxes
- locally or in [your own cloud](/cua-sdk/guides/your-cloud). See
- [Cua Cloud (Fleets) has ended](/cua-sdk/guides/cua-cloud-ended).
-</Callout>
-
-Cloud sandboxes use the same code as local ones with `on="cloud"` (`local=False`
-in cua-sandbox), and `--on cloud` in the CLI. To run in your own AWS, Google
-Cloud or Modal account instead, see [Use your own cloud](/cua-sdk/guides/your-cloud). The SDK manages the capacity:
-no pools to create, and idle capacity is removed for you.
-
-## Credentials
-
-```bash test="cli-shape" id="cua-auth-login"
-cua auth login # browser sign-in; --remote for SSH sessions
-cua auth whoami # verifies the identity against the cloud
-```
-
-The CLI and every SDK resolve credentials in this order:
-
-| Credential | Set with | Use for |
-| --- | --- | --- |
-| Bearer token | `FLEETS_TOKEN` | CI with workload identity (`cua wif-token github`) |
-| API key | `CUA_CLIENT_ID` + `CUA_CLIENT_SECRET` | Scripts, services, CI |
-| Signed-in session | `cua auth login` | Your machine |
-
-For scripts, create an API key while signed in. It prints the ID and secret
-once; store them in a secret manager:
-
-```bash test="cli-shape" id="cua-auth-keys-create"
-cua auth keys create my-script
-```
-
-```bash skip="placeholder"
-export CUA_CLIENT_ID="<client-id>"
-export CUA_CLIENT_SECRET="<client-secret>"
-unset FLEETS_TOKEN # a token takes precedence over the key
-```
-
-Manage keys with `cua auth keys ls` / `rm ID` or under
-[API keys](https://run.cua.ai/user-keys). Without credentials, a cloud create
-fails with:
-
-```text output
-Fleet credentials missing: run `cua auth login` or set CUA_CLIENT_ID/CUA_CLIENT_SECRET, or pass local=True
-```
-
-## Run it
-
-```bash test="cli-shape" id="cua-sb-create-linux"
-cua sb create linux --on cloud --name demo # a gVisor container
-cua sb create linux --on cloud --kind vm --name demo-vm # a KubeVirt VM
-cua sb exec demo -- uname -a
-cua sb rm demo -f
-```
-
-In code, pass `local=False` to the [quickstart](/cua-sdk/quickstart) calls, and
-`kind=` / `runtime=` as locally (cloud runtimes: `gvisor` for containers,
-`kubevirt` for VMs). `CloudOptions` tunes the managed capacity:
-
-| Field | Default (env override) | Effect |
-| --- | --- | --- |
-| `warm` | on for the canonical images (`CUA_FLEET_WARM`) | Keep one ready sandbox of this image |
-| `max_pool_size` | `10` (`CUA_FLEET_MAX_POOL_SIZE`) | Autoscaling ceiling |
-| `claim_ttl` | 15 min (`CUA_FLEET_CLAIM_TTL`) | Lifetime after your process stops renewing |
-| `pool` | none | Claim from a pool you manage (Cua Fleets, [ended 16 Oct 2026](/cua-sdk/guides/cua-cloud-ended)) |
-
-`cpu` and `memory` are part of the shape: a new shape is a new pool. Managed
-pools idle for 30 minutes are deleted (`CUA_FLEET_POOL_IDLE_GC`, `off` disables
-it; `cua fleet pools gc` runs it now).
-
-## Choose where sandboxes run by default
-
-Without `--on` (or `on=` / `local=`) a sandbox runs on this machine. To make
-the cloud your default:
-
-```bash test="cli-shape" id="cua-config-set-default-on"
-cua config set default.on cloud # written to ~/.cua/config.toml
-cua config list # each setting, its value and its source
-```
-
-```text output
-KEY VALUE SOURCE
-default.on cloud config
-default.kind auto default
-default.runtime auto default
-```
-
-Now `cua sb create linux` and `Sandbox.create(...)` run in the cloud, and
-`--on local` still runs one here. `cua sb ls` lists every location either way.
-The first match wins:
-
-1. `--on`, `on=` or `local=`
-2. `CUA_DEFAULT_ON` (one shell or CI job)
-3. `default.on` in `$CUA_HOME/config.toml`
-4. `local`
-
-`default.kind` and `default.runtime` (`CUA_DEFAULT_KIND`, `CUA_DEFAULT_RUNTIME`)
-work the same way, and `cua doctor` shows each default with its source. The
-SDKs read and write the same file:
-
-```python test="docs" id="cloud-config-default-on"
-import cua
-
-cua.config_set("default.on", "cloud")
-entry = cua.config_get("default.on")
-print([entry.value, entry.source])
-# ['cloud', 'config']
-cua.config_unset("default.on")
-```
-
-Switch back with `cua config unset default.on` (or `cua config set default.on
-local`). With a cloud default and no credentials, a create fails and says to
-run `cua auth login` or `cua config set default.on local`.
-
-## What differs from local
-
-- Public or [private](/cua-sdk/guides/images#private-registries) registry
- images, amd64 only: containers under gVisor, containerDisks as KubeVirt VMs.
- No macOS.
-- A cold image's first start takes a few minutes; canonical images are warm.
-- Services go through the gateway: `url()` is a signed URL and `request` adds
- the gateway's credentials.
-- `command=`, `env=` and [sidecars](/cua-sdk/guides/sidecars) work on container
- and VM images; VM `env` values are single-line.
-- The sandbox lapses `claim_ttl` after your process stops renewing it
- ([Lifecycle](/cua-sdk/guides/lifecycle#cloud-lifetime)). No suspend or
- restart.
-- Usage is billed while a sandbox runs.
-
-<Callout type="info">
- Image builds from layers are not in the cloud yet: a cloud sandbox with
- layers fails with a clear error. Build locally, push, and reference the
- image ([Choose and build an image](/cua-sdk/guides/images)).
-</Callout>
-
-Named pools, fixed warm replicas, Terraform and per-claim secrets were part of
-Cua Fleets, which [ended on 16 October 2026](/cua-sdk/guides/cua-cloud-ended).
diff --git a/docs/content/docs/cua-sdk/guides/cua-cloud-ended.mdx b/docs/content/docs/cua-sdk/guides/cua-cloud-ended.mdx
index 59cf4e05cf..bc4d02c22e 100644
--- a/docs/content/docs/cua-sdk/guides/cua-cloud-ended.mdx
+++ b/docs/content/docs/cua-sdk/guides/cua-cloud-ended.mdx
@@ -19,15 +19,25 @@ The same SDK calls, images and `cua` CLI commands run anywhere else:
## In your code
-- `on="cloud"`, `local=False`, `--on cloud`, `Cua.fleet()` and `cua fleet` are
- deprecated and no longer reach a service. They are removed in `cua` 0.5.0.
-- Replace `on="cloud"` with a local runtime or your own cloud. Sidecars,
- services, secrets and images work the same way there:
- [Sidecars](/cua-sdk/guides/sidecars), [Services](/cua-sdk/guides/services),
- [Secrets](/cua-sdk/guides/secrets), [Images](/cua-sdk/guides/images).
-- Fleet pool names, claim TTLs and warm-replica settings have no replacement.
- Your own cloud gives each sandbox a time limit and cleans up after it
- ([Time limits and cleanup](/cua-sdk/guides/your-cloud#time-limits-and-cleanup)).
+`on="cloud"`, `local=False`, `--on cloud`, `Cua.fleet()` and `cua fleet` are
+deprecated in `cua` 0.4.2 and `cua-sandbox` 0.9.1. They fail with this message:
+
+```text output
+Cua Cloud has ended; use a local sandbox or your own machine. See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended
+```
+
+They are removed in `cua` 0.5.0. The same goes for `cua images` listings of
+cloud images, `cua pools`, `--pool`, `FLEETS_TOKEN` and cloud suspend, resume
+and extend-lease.
+
+Replace `on="cloud"` with a local runtime or your own cloud. Sidecars,
+services, secrets and images work the same way there:
+[Sidecars](/cua-sdk/guides/sidecars), [Services](/cua-sdk/guides/services),
+[Secrets](/cua-sdk/guides/secrets), [Images](/cua-sdk/guides/images).
+
+Fleet pool names, claim TTLs and warm-replica settings have no replacement.
+Your own cloud gives each sandbox a time limit and cleans up after it
+([Time limits and cleanup](/cua-sdk/guides/your-cloud#time-limits-and-cleanup)).
Questions: [GitHub issues](https://github.com/trycua/cua/issues) or
[Discord](https://discord.com/invite/mVnXXpdE85).
diff --git a/docs/content/docs/cua-sdk/guides/images.mdx b/docs/content/docs/cua-sdk/guides/images.mdx
index 8eb6f2c623..408f5c0c78 100644
--- a/docs/content/docs/cua-sdk/guides/images.mdx
+++ b/docs/content/docs/cua-sdk/guides/images.mdx
@@ -1,11 +1,11 @@
---
title: Choose and build an image
-description: Pick a canonical or registry image, add packages and files, and pull private images, the same way locally and in the cloud.
+description: Pick a canonical or registry image, add packages and files, and pull private images, locally or in your own cloud.
---
A sandbox runs one image reference. One resolver picks the variant each
backend runs (container rootfs or VM disk) and pins its digest, so the same
-reference works locally and in the cloud.
+reference works locally or in your own cloud.
<span id="choose-a-published-fleet-image" />
@@ -19,12 +19,12 @@ Image.windows() # ghcr.io/trycua/windows:2022, Windows Server 2022 VM
Image.macos() # ghcr.io/trycua/macos:26 (Tahoe); Image.macos("15") for Sequoia
```
-| Image | Local | Cloud |
-| --- | --- | --- |
-| `Image.linux()` | Container (gVisor when installed) | gVisor container |
-| `Image.linux(kind="vm")` | QEMU VM from `linux:24.04-disk` | KubeVirt VM from `linux:24.04-disk` |
-| `Image.windows()` | QEMU VM from `windows:2022-disk` | KubeVirt VM from `windows:2022-disk` |
-| `Image.macos()` | Lume VM (Apple silicon) | Not available |
+| Image | Local |
+| --- | --- |
+| `Image.linux()` | Container (gVisor when installed) |
+| `Image.linux(kind="vm")` | QEMU VM from `linux:24.04-disk` |
+| `Image.windows()` | QEMU VM from `windows:2022-disk` |
+| `Image.macos()` | Lume VM (Apple silicon) |
- Only `Image.linux()` ships cua-spacesd, so only it gets the computer
interfaces. Reach the Windows and macOS images through services you declare.
@@ -47,8 +47,7 @@ windows = Image.from_registry("registry.example/win:1", os_type="windows", kind=
- `kind` is detected: a container image runs as a container, a containerDisk
(a disk at `/disk/disk.img`) as a VM.
- `os_type="windows"` selects EFI firmware; a Windows disk never boots on BIOS.
-- The cloud runs amd64. Pin a digest when every sandbox must boot the same
- content.
+- Pin a digest when every sandbox must boot the same content.
```bash test="cli-shape" id="cua-sb-create-linux"
cua sb create linux --name desk
@@ -57,11 +56,10 @@ cua sb create python:3.12-slim --name app -- python -m http.server 8000
## Add packages, files and settings
-Each builder method returns a new, immutable `Image`. Locally, steps build
-into your container engine before boot (VM images apply them after boot
-through cua-spacesd). In the cloud, `apt_install`, `pip_install`, `uv_install`,
-`run`, `copy` and `env` build remotely; until the cloud builds images, build
-and push it yourself with [`cua image build` and `cua image push`](/cua-cli/reference/cli/image).
+Each builder method returns a new, immutable `Image`. Steps build into your
+container engine before boot (VM images apply them after boot through
+cua-spacesd). To build once and reuse an image, use
+[`cua image build` and `cua image push`](/cua-cli/reference/cli/image).
```python test="docs" id="install-packages" session="build"
from cua_sandbox import Image
@@ -117,9 +115,7 @@ Image.from_file('https://example.com/windows.vhdx', os_type='windows')
## Private registries
-Pass a `RegistrySecret`. The SDK uses it for the pull (in the cloud it becomes
-the sandbox's pull secret, which also covers sidecar images on the same
-registry). Credentials are never logged or saved in `~/.cua`.
+Pass a `RegistrySecret`. The SDK uses it for the pull. Credentials are never logged or saved in `~/.cua`.
```python skip="pseudo"
from cua_sandbox import Image, RegistrySecret, Sandbox
diff --git a/docs/content/docs/cua-sdk/guides/lifecycle.mdx b/docs/content/docs/cua-sdk/guides/lifecycle.mdx
index 0ae3392b57..a69dc29594 100644
--- a/docs/content/docs/cua-sdk/guides/lifecycle.mdx
+++ b/docs/content/docs/cua-sdk/guides/lifecycle.mdx
@@ -1,10 +1,10 @@
---
title: Manage sandbox lifecycle
-description: Create, keep, reconnect to, list, suspend and delete sandboxes, keep cloud sandboxes alive, and run many at once.
+description: Create, keep, reconnect to, list, suspend and delete sandboxes, and run many at once.
---
Sandboxes run on this machine by default, so the examples pass no location.
-Every lifecycle call takes the same `local=` switch as `Sandbox.create`.
+To use [your own cloud](/cua-sdk/guides/your-cloud) pass `on=` as in `Sandbox.create`.
## Ephemeral or kept
@@ -29,20 +29,19 @@ lifetimes.
print(sb.id) # its ref, like local:dev: what connect() and delete() take
info = await sb.info()
info.status # provisioning, starting, ready or stopped
-info.location # local or cloud
+info.location # local, direct or the cloud you chose
info.services # {"web": 8000, ...}
-info.expires_at # cloud: when the sandbox lapses without a keep-alive
-info.provider_details # backend internals (local runtime; cloud pool and claim)
+info.provider_details # backend internals (for example the local runtime)
```
| Status | Meaning |
| --- | --- |
-| `provisioning` | Capacity is being found or created (image pull, cloud capacity) |
+| `provisioning` | Capacity is being found or created (image pull) |
| `starting` | Booting, or `wait_for` probes have not passed yet |
| `ready` | Running and every probe passed |
| `stopped` | Exited, suspended or released |
-Refs are `local:<name>`, `cloud:<name>` or `direct:<host:port>`. A bare name
+Refs are `local:<name>`, `aws:<name>` (also `gcp:` and `modal:`) or `direct:<host:port>`. A bare name
works when it is unique; otherwise the call raises `AmbiguousSandbox`.
## Reconnect, list, delete
@@ -57,45 +56,24 @@ await Sandbox.delete("dev")
```
`await sb.destroy()` deletes the sandbox you hold. Suspend, resume and restart
-are local only: in the cloud `suspend` and `restart` raise `Unsupported`, and
+are local only: elsewhere `suspend` and `restart` raise `Unsupported`, and
`resume` of a running sandbox reconnects. The CLI and the SDK share local state
in `~/.cua/sandboxes`, so either can reconnect to the other's sandboxes.
```bash test="cli-shape" id="cua-sb-create-linux"
cua sb create linux --name dev
-cua sb ls # local and cloud; --local or --cloud filters
+cua sb ls # every location; --local filters
cua sb info dev
cua sb suspend dev && cua sb resume dev
-cua sb keep-alive dev --for 2h # cloud
cua sb rm dev -f
```
-## Cloud lifetime
-
-A cloud sandbox has a TTL (15 minutes by default) that the SDK renews while
-your process holds it. When the process exits, it lapses after the TTL. Set a
-longer TTL or extend it:
-
-```python test="docs" id="cloud-lifetime" session="cloud" prelude="fakefleet,image"
-from datetime import timedelta
-from cua_sandbox import CloudOptions
-
-sb = await Sandbox.create(image, cloud=CloudOptions(claim_ttl=timedelta(hours=2)))
-await sb.keep_alive(minutes=60)
-```
-
-- `cloud=` implies the cloud; passing it with `local=True` is an error.
-- `sb.to_dict()` and `Sandbox.from_dict(...)` carry a cloud sandbox to another
- process.
-- With `cua daemon` running, CLI-created cloud sandboxes keep being renewed
- after the command exits.
-
-Local sandboxes run until you delete them.
+Local sandboxes run until you delete them. In your own cloud, a sandbox
+deletes itself at its [time limit](/cua-sdk/guides/your-cloud#time-limits-and-cleanup).
## Run many at once
`Sandbox.ephemeral` is async, so `asyncio.gather` runs sandboxes in parallel.
Cap concurrency with an `asyncio.Semaphore` (every local sandbox uses host CPU,
memory and disk) and pass `return_exceptions=True` so one failure does not
-cancel the rest. In the cloud, one image runs at most 10 at once unless you
-raise `CloudOptions(max_pool_size=...)`.
+cancel the rest.
diff --git a/docs/content/docs/cua-sdk/guides/local-runtimes.mdx b/docs/content/docs/cua-sdk/guides/local-runtimes.mdx
index 6233d640c6..4916c9f341 100644
--- a/docs/content/docs/cua-sdk/guides/local-runtimes.mdx
+++ b/docs/content/docs/cua-sdk/guides/local-runtimes.mdx
@@ -7,7 +7,7 @@ import { Callout } from 'fumadocs-ui/components/callout';
Local sandboxes run on this machine with no account. Local is the built-in
default: omit `on=` (`local=` in cua-sandbox, `--on` in the CLI), or
-[change the default](/cua-sdk/guides/cloud#choose-where-sandboxes-run-by-default).
+[change the default](#change-the-default).
The SDK picks the kind and runtime from the image and starts it itself.
| Image | Runtime (`auto`) |
@@ -52,13 +52,6 @@ fails with `InvalidPlacement` and lists the valid values:
invalid placement: runtime qemu runs vm sandboxes, not container ones locally; valid runtime: auto, gvisor, runc
```
-`pool:<name>` runs a cloud pool's
-template image locally (it needs cloud credentials to read the template):
-
-```bash test="cli-shape" id="cua-sb-create"
-cua sb create pool:my-pool --name copy-of-my-pool
-```
-
In code, pass `kind=` and `runtime=` (`Sandbox.create(image, kind="vm",
runtime="qemu")`); cua-sandbox still accepts a `Runtime` object
([runtime support](/cua-sdk/reference/runtime-support)).
@@ -71,10 +64,31 @@ runtime="qemu")`); cua-sandbox still accepts a `Runtime` object
- [Sidecars](/cua-sdk/guides/sidecars) need `runtime="runc"` where gVisor would run.
- Image layers build into your container engine before boot; VM images apply
them after boot through cua-spacesd.
-- A sandbox runs until you delete it; `keep_alive` and `cloud=` raise.
+- A sandbox runs until you delete it; `keep_alive` raises.
- Images without cua-spacesd fall back to the runtime's agentless path (QMP,
VNC, SSH or ADB) where there is one.
+## Change the default
+
+Without `--on` (or `on=` / `local=`) a sandbox runs on this machine. To default
+to [your own cloud](/cua-sdk/guides/your-cloud) instead, set `default.on`:
+
+```bash test="cli-shape" id="cua-config-set-default-on"
+cua config set default.on aws # written to ~/.cua/config.toml
+cua config list # each setting, its value and its source
+```
+
+The first match wins:
+
+1. `--on`, `on=` or `local=`
+2. `CUA_DEFAULT_ON` (one shell or CI job)
+3. `default.on` in `$CUA_HOME/config.toml`
+4. `local`
+
+`default.kind` and `default.runtime` (`CUA_DEFAULT_KIND`,
+`CUA_DEFAULT_RUNTIME`) work the same way, and `cua doctor` shows each default
+with its source. Switch back with `cua config unset default.on`.
+
## Disk usage and cleanup
Images share a cache budget and are evicted least recently used first; a pull
diff --git a/docs/content/docs/cua-sdk/guides/meta.json b/docs/content/docs/cua-sdk/guides/meta.json
index fa250a3811..23c560d819 100644
--- a/docs/content/docs/cua-sdk/guides/meta.json
+++ b/docs/content/docs/cua-sdk/guides/meta.json
@@ -12,7 +12,6 @@
"local-runtimes",
"disk-usage",
"cua-cloud-ended",
- "cloud",
"your-cloud",
"your-cloud-resources",
"contrib-providers",
diff --git a/docs/content/docs/cua-sdk/guides/migrate-from-deprecated-packages.mdx b/docs/content/docs/cua-sdk/guides/migrate-from-deprecated-packages.mdx
index de7c67d4dd..bba5e2b76d 100644
--- a/docs/content/docs/cua-sdk/guides/migrate-from-deprecated-packages.mdx
+++ b/docs/content/docs/cua-sdk/guides/migrate-from-deprecated-packages.mdx
@@ -49,7 +49,7 @@ Instead:
`cua-computer` was the Python `Computer` class that started a VM or container
and drove it through `cua-computer-server`. Use the `cua` SDK instead: it
-creates local and cloud sandboxes, and `Sandbox` exposes the screen, input,
+creates local sandboxes and sandboxes in your own cloud, and `Sandbox` exposes the screen, input,
shell and files. Start with the [SDK quickstart](/cua-sdk/quickstart) and the
[sandbox reference](/cua-sdk/reference/python/sandbox).
diff --git a/docs/content/docs/cua-sdk/guides/secrets.mdx b/docs/content/docs/cua-sdk/guides/secrets.mdx
index f0835d0c5c..afe2712a38 100644
--- a/docs/content/docs/cua-sdk/guides/secrets.mdx
+++ b/docs/content/docs/cua-sdk/guides/secrets.mdx
@@ -1,6 +1,6 @@
---
title: Pass secrets into a sandbox
-description: Pass credentials from the host into a local or cloud sandbox at runtime, and keep them out of images.
+description: Pass credentials from the host into a sandbox at runtime, and keep them out of images.
---
import { Callout } from 'fumadocs-ui/components/callout';
@@ -8,7 +8,7 @@ import { Callout } from 'fumadocs-ui/components/callout';
Read secrets on the host and hand them to one process in the sandbox at
runtime. Never put them in an image spec. The examples take a connected Linux
sandbox `sb` with an application at `/app/main.py`; they work locally and in
-the cloud.
+[your own cloud](/cua-sdk/guides/your-cloud).
| Value | Where it goes |
| --- | --- |
diff --git a/docs/content/docs/cua-sdk/guides/services.mdx b/docs/content/docs/cua-sdk/guides/services.mdx
index 09bc5b0bc4..61f82d087c 100644
--- a/docs/content/docs/cua-sdk/guides/services.mdx
+++ b/docs/content/docs/cua-sdk/guides/services.mdx
@@ -49,9 +49,7 @@ r = await api.request("POST", "/items", json={"a": 1}, headers={"x-trace": "1"})
print(await api.url()) # usable from this machine
```
-`url()` is a loopback URL locally and a signed URL (1 hour) in the cloud. In
-the cloud the gateway adds its own credentials, so an `authorization` header
-of your own is refused.
+`url()` is a loopback URL usable from this machine.
```ts test="container" id="typescript" prelude="local-cleanup"
import { embedded, http, SandboxCreateOptions } from '@trycua/cua';
@@ -131,7 +129,7 @@ cua sb mcp NAME mcp config # URL and headers for another client
`sb.tunnel.forward(port)` opens a loopback port for local tools such as a
browser, `psql` or a debugger.
-```python test="docs" id="forward-python" session="forward" prelude="fakefleet,sb-web"
+```python test="container" id="forward-python" session="forward" prelude="sb-web-local,local-cleanup"
async with sb.tunnel.forward(8000) as t:
print(t.url) # http://127.0.0.1:53817
@@ -147,15 +145,14 @@ cua sb port-forward web 8000 # until Ctrl-C
cua sb port-forward web 8000:9000 # pick the local port
```
-In the cloud, a port without cua-spacesd in the image must be declared in
+On a remote sandbox, a port without cua-spacesd in the image must be declared in
`services=`.
## Share with a public URL
`sb.public_url(service, ttl=...)` returns a URL that needs no cua credentials
and stops working after `ttl` seconds (60 s to 24 h, default 1 h) or when
-revoked. Locally it is served by the cua daemon on loopback; in the cloud it
-is a signed HTTPS URL reachable from anywhere. For an MCP server, append `/mcp`.
+revoked. It is served by the cua daemon on loopback. For an MCP server, append `/mcp`.
```python test="container" id="public-url" session="share" prelude="sb-web-local,local-cleanup"
share = await sb.public_url("web", ttl=600, label="demo")
@@ -167,13 +164,6 @@ await sb.revoke_public_url(share)
cua sb url web web --public --ttl 10m
```
-Cloud sandboxes also list their signed URLs:
-
-```python test="docs" id="list-signed-urls" session="signed-urls" prelude="fakefleet,sb-web"
-for item in await sb.services.list_signed_urls():
- print(item.label, item.expires_at, item.revoked_at)
-```
-
<Callout type="warn">
A public URL is a bearer credential. Use the shortest practical `ttl`, revoke
it when sharing ends, and keep it out of logs and source control. It does
diff --git a/docs/content/docs/cua-sdk/guides/spacesd.mdx b/docs/content/docs/cua-sdk/guides/spacesd.mdx
index d346e5eee3..786ec6d1ec 100644
--- a/docs/content/docs/cua-sdk/guides/spacesd.mdx
+++ b/docs/content/docs/cua-sdk/guides/spacesd.mdx
@@ -32,7 +32,7 @@ In Python, `Sandbox.connect(url="http://127.0.0.1:3211", token=...)` returns a
regular `Sandbox`; in TypeScript, `embedded().spacesd(url, token)` returns the
typed spacesd client.
-Addresses can be direct (`http://10.0.0.5:3211`), a cloud sandbox's `env`
+Addresses can be direct (`http://10.0.0.5:3211`), a sandbox's `env`
service URL, or a relay URL (`https://<relay>/m/<machine-id>`). To run spacesd
on a machine, see [Run spacesd yourself](#run-spacesd-yourself); its RPCs are in the
[protocol reference](/cua-sdk/reference/protocol).
@@ -88,7 +88,7 @@ command to it.
spacesd takes the first non-empty token from `--token`, `CUA_ENV_TOKEN`, then
`--token-file`. Clients send it as `authorization: Bearer <token>` or
-`x-cua-env-authorization` (the Fleet gateway keeps `authorization` for itself).
+`x-cua-env-authorization` (use it when a gateway keeps `authorization` for itself).
| Mode | Behavior |
| --- | --- |
diff --git a/docs/content/docs/cua-sdk/reference/python/image.mdx b/docs/content/docs/cua-sdk/reference/python/image.mdx
index 58f303088b..13184816c9 100644
--- a/docs/content/docs/cua-sdk/reference/python/image.mdx
+++ b/docs/content/docs/cua-sdk/reference/python/image.mdx
@@ -12,7 +12,7 @@ description: "The Image builder, sidecar containers and registry credentials of
`Image` is an immutable, chainable description of what a sandbox boots. Builder methods return a new `Image`.
-Builder methods add layers and return a new `Image`. Locally, a container image is built into your container engine before boot; in the cloud the same layers run as a remote build. Both are cached by content. Layers a build cannot run (`brew_install`, `choco_install`, ...) are applied after boot through cua-spacesd, so they need an image that runs it.
+Builder methods add layers and return a new `Image`. Locally, a container image is built into your container engine before boot; it is cached by content. Layers a build cannot run (`brew_install`, `choco_install`, ...) are applied after boot through cua-spacesd, so they need an image that runs it.
## Image builder
diff --git a/docs/content/docs/cua-sdk/reference/python/index.mdx b/docs/content/docs/cua-sdk/reference/python/index.mdx
index 899a6fbe30..3b45392d59 100644
--- a/docs/content/docs/cua-sdk/reference/python/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/python/index.mdx
@@ -23,10 +23,8 @@ The high-level Python API: `cua_sandbox` (`Sandbox`, `Image`, the computer inter
| Variable | Purpose | Default |
| --- | --- | --- |
-| `FLEETS_TOKEN` | Cloud bearer token; wins over client credentials | None |
-| `CUA_CLIENT_ID`, `CUA_CLIENT_SECRET` | Cloud OAuth client credentials | None; then the `cua auth login` session |
-| `CUA_FLEET_BASE_URL`, `CUA_TOKEN_URL` | Cloud API and token endpoints | `https://run.cua.ai`, the cua.ai token endpoint |
-| `CUA_FLEET_MAX_POOL_SIZE`, `CUA_FLEET_CLAIM_TTL`, `CUA_FLEET_WARM`, `CUA_FLEET_POOL_IDLE_GC` | Cloud capacity defaults (`CUA_FLEET_POOL_IDLE_GC=off` disables idle cleanup) | 10, 15 min, warm for canonical images, 30 min |
+| `CUA_CLIENT_ID`, `CUA_CLIENT_SECRET` | API key credentials | None; then the `cua auth login` session |
+| `CUA_TOKEN_URL` | Token endpoint | The cua.ai token endpoint |
| `CUA_IMAGE_LINUX`, `CUA_IMAGE_WINDOWS`, `CUA_IMAGE_MACOS` | Override `Image.linux()`, `Image.windows()`, `Image.macos()` | The canonical images |
## Pages
diff --git a/docs/content/docs/cua-sdk/reference/python/pool.mdx b/docs/content/docs/cua-sdk/reference/python/pool.mdx
index 566bb3aeeb..d0a3205385 100644
--- a/docs/content/docs/cua-sdk/reference/python/pool.mdx
+++ b/docs/content/docs/cua-sdk/reference/python/pool.mdx
@@ -12,7 +12,7 @@ description: "Pools, templates, sandbox specs and pool errors of cua-sandbox."
`Pool` keeps warm cloud capacity for a `SandboxSpec`. `Sandbox.create` uses shared capacity; a named pool is for dedicated capacity.
-Most programs never touch pools: a cloud `Sandbox.create` claims from a pool the SDK manages per image and shape (`cua-auto-*`), tuned with `CloudOptions`. A named `Pool` is dedicated capacity you size and own; `Sandbox.create(cloud=CloudOptions(pool=...))` claims from it, and fields that differ from its template raise `PoolSpecMismatch`.
+Pools and `CloudOptions` belonged to Cua Cloud, which has ended. Every call here fails with a clear error, and the module is removed in `cua-sandbox` 0.10.0.
## Pools and templates
@@ -73,25 +73,6 @@ memory_mb=..., services=..., autoscaling=..., ttl_seconds_after_created=...,
runtime=...)` still works and is converted to the new one, with a
`DeprecationWarning`.
-**Example**
-
-{/* Examples: scripts/docs-generators/examples/cua-sdk/python/Pool.apply.py */}
-
-```python test="docs" id="pool-apply-py" session="pool-apply-py" prelude="fakefleet"
-import asyncio
-
-from cua_sandbox import CloudOptions, Image, Pool, PoolOptions, Sandbox, SandboxSpec
-
-async def main():
- pool = await Pool.apply("my-team-linux", SandboxSpec(image=Image.linux()), PoolOptions(replicas=2))
- sb = await Sandbox.create(cloud=CloudOptions(pool=pool)) # or CloudOptions(pool="my-team-linux")
- print(sb.id)
- await sb.destroy()
- await pool.delete()
-
-asyncio.run(main())
-```
-
#### Pool.export
```python
@@ -195,20 +176,10 @@ async def reconcile(request: CreateTemplateRequest) -> 'Template'
### pools
-Managed Fleet pools: list them and garbage-collect them.
-
-`Sandbox.ephemeral(image, local=False)` claims sandboxes from this
-account's managed pools (`cua-auto-*`), one per image spec, created on
-first use and scaled to zero when idle. Idle pools are deleted automatically
-after `CUA_FLEET_POOL_IDLE_GC`; these calls inspect them or collect now.
+Managed Fleet pools: Cua Cloud has ended (CUA-1854).
-```python
-from cua_sandbox import pools
-
-for pool in await pools.list_pools():
- print(pool.name, pool.claims, pool.last_used)
-report = await pools.gc(idle_after=1800)
-```
+Every call raises `cua_sandbox._ended.CloudEnded`; the module goes
+away in the next minor release.
### list_pools
diff --git a/docs/content/docs/cua-sdk/reference/python/sandbox.mdx b/docs/content/docs/cua-sdk/reference/python/sandbox.mdx
index 4b71eaedd2..1770052fc5 100644
--- a/docs/content/docs/cua-sdk/reference/python/sandbox.mdx
+++ b/docs/content/docs/cua-sdk/reference/python/sandbox.mdx
@@ -12,7 +12,7 @@ description: "Sandbox, SandboxInfo, the sandbox() helper and the creation option
The `Sandbox` class is the entry point of `cua-sandbox`: create, connect to, or reattach a sandbox, then use its interfaces.
-Local is the default: `Sandbox.create(image)` runs on this machine, `local=False` or `cloud=CloudOptions(...)` in the cloud, and every other parameter means the same on both. `Sandbox.connect(name)` and the class methods take `local=None`: the local sandbox of that name when one exists, else the cloud.
+Local is the default: `Sandbox.create(image)` runs on this machine, `on="aws"`, `"gcp"` or `"modal"` in your own cloud. `local=False` and `cloud=CloudOptions(...)` meant Cua Cloud, which has ended: they fail with a clear error and are removed in `cua-sandbox` 0.10.0. `Sandbox.connect(name)` and the class methods take `local=None`: the local sandbox of that name when one exists.
## Sandboxes
diff --git a/docs/content/docs/cua-sdk/reference/runtime-support.mdx b/docs/content/docs/cua-sdk/reference/runtime-support.mdx
index 08f96674a6..479b70c3fc 100644
--- a/docs/content/docs/cua-sdk/reference/runtime-support.mdx
+++ b/docs/content/docs/cua-sdk/reference/runtime-support.mdx
@@ -1,6 +1,6 @@
---
title: "Runtime support"
-description: "Which images run on which local runtime or in the cloud, what customization each accepts, and how ports reach them."
+description: "Which images run on which local runtime, what customization each accepts, and how ports reach them."
---
{/*
@@ -18,23 +18,21 @@ evidence of SDK behavior, not proof that a guest boots on every host or deployme
## Operating systems and image kinds
-The same image reference runs locally (`local=True`, or `cua sb create`) and in
-the cloud. The resolver picks the variant each backend runs; the guest OS can
-still differ in format, backend and available operations between the two.
+The resolver picks the variant each local backend runs (`local=True`, or
+`cua sb create`).
-| Image input | Guest and kind | Local backend | Cloud |
-| --- | --- | --- | --- |
-| `Image.linux()` | `ghcr.io/trycua/linux:24.04` rootfs (amd64, arm64) | Docker or Podman; gVisor when the engine has `runsc`, else `runc` | gVisor; warm by default |
-| `Image.linux(kind='vm')` | `ghcr.io/trycua/linux:24.04-disk` containerDisk | QEMU (`cua runtime setup qemu` installs it); raises when QEMU is missing | KubeVirt |
-| `Image.windows()` | `ghcr.io/trycua/windows:2022-disk` containerDisk | Hyper-V on a Windows host that has it, else QEMU | KubeVirt, EFI; warm by default |
-| `Image.windows('11')` | Windows 11 VM | Local ISO installation | Rejected |
-| `Image.macos()` / `Image.macos('15')` | `ghcr.io/trycua/macos:26` / `:15` Lume VM | Lume on Apple silicon | Rejected |
-| `Image.android()` | Android 14 | Legacy Android emulator adapter | Rejected |
-| `Image.from_registry(ref)` | Any OCI image: rootfs, containerDisk or Lume | Rootfs as a container, containerDisk on QEMU, Lume image on Lume | Rootfs on gVisor, containerDisk on KubeVirt; amd64 only |
-| `Image.from_file(...)` | Disk or ISO | QEMU (or Hyper-V) | Rejected |
-
-Not supported locally: macOS containers and macOS images that are not Lume images. The
-cloud runs amd64 only, so a Linux image must have an amd64 variant. With no
+| Image input | Guest and kind | Local backend |
+| --- | --- | --- |
+| `Image.linux()` | `ghcr.io/trycua/linux:24.04` rootfs (amd64, arm64) | Docker or Podman; gVisor when the engine has `runsc`, else `runc` |
+| `Image.linux(kind='vm')` | `ghcr.io/trycua/linux:24.04-disk` containerDisk | QEMU (`cua runtime setup qemu` installs it); raises when QEMU is missing |
+| `Image.windows()` | `ghcr.io/trycua/windows:2022-disk` containerDisk | Hyper-V on a Windows host that has it, else QEMU |
+| `Image.windows('11')` | Windows 11 VM | Local ISO installation |
+| `Image.macos()` / `Image.macos('15')` | `ghcr.io/trycua/macos:26` / `:15` Lume VM | Lume on Apple silicon |
+| `Image.android()` | Android 14 | Legacy Android emulator adapter |
+| `Image.from_registry(ref)` | Any OCI image: rootfs, containerDisk or Lume | Rootfs as a container, containerDisk on QEMU, Lume image on Lume |
+| `Image.from_file(...)` | Disk or ISO | QEMU (or Hyper-V) |
+
+Not supported locally: macOS containers and macOS images that are not Lume images. With no
container engine the managed runtime VM is not available yet; install Colima or
Docker Engine. See [Manage local runtimes](/cua-sdk/guides/local-runtimes#check-and-set-up-the-host).
@@ -48,38 +46,36 @@ The canonical images are generated from the SDK source:
| `Image.macos()` | `ghcr.io/trycua/macos:26` | Lume, local only (`Image.macos("15")`: `ghcr.io/trycua/macos:15`) |
{/* GENERATED:sandbox-builtin-mappings:end */}
-The resolver pins them by digest on both sides. Override one with
+The resolver pins them by digest. Override one with
`CUA_IMAGE_LINUX`, `CUA_IMAGE_WINDOWS` or `CUA_IMAGE_MACOS`.
### Windows firmware
-Cloud templates for `image.os_type == 'windows'` use `Firmware.EFI`.
-`Image.from_registry()` defaults to `os_type='linux'` and does not inspect the
+A Windows image uses `Firmware.EFI`. `Image.from_registry()` defaults to `os_type='linux'` and does not inspect the
disk, so pass `os_type='windows', kind='vm'` for a Windows containerDisk.
## Image customization
-| Operation | Local | Cloud |
-| --- | --- | --- |
-| Layers: `apt_install()`, `pip_install()`, `uv_install()`, `run()`, `env()`, `copy()` | Container image: built into the local engine before boot, cached by content. VM image: applied after boot through cua-spacesd (else `Unsupported`) | Remote build on the image as base, cached by content (not available yet) |
-| Other layers: `brew_install()`, `choco_install()`, `winget_install()`, `app_install()`, ... | Applied after boot through cua-spacesd (for example `Image.linux()`); `Unsupported` on an image without it | `Unsupported` (a `NotImplementedError`) |
-| `expose()` | Forwarded to a free host port, reported in `sb.exposed_ports` | Declares the service `port-N` |
-| `Image.from_registry(ref, secret=...)` | Authenticated pull | Registry pull secret for the sandbox and its sidecars |
-| `Sandbox.snapshot()` | Not implemented | Not implemented; snapshot-derived images are rejected |
-
-Cloud layers fail with a clear error until Fleet builds images. `cua image build` and `cua image push` build and
-publish an image both sides can use. See
+| Operation | Local |
+| --- | --- |
+| Layers: `apt_install()`, `pip_install()`, `uv_install()`, `run()`, `env()`, `copy()` | Container image: built into the local engine before boot, cached by content. VM image: applied after boot through cua-spacesd (else `Unsupported`) |
+| Other layers: `brew_install()`, `choco_install()`, `winget_install()`, `app_install()`, ... | Applied after boot through cua-spacesd (for example `Image.linux()`); `Unsupported` on an image without it |
+| `expose()` | Forwarded to a free host port, reported in `sb.exposed_ports` |
+| `Image.from_registry(ref, secret=...)` | Authenticated pull |
+| `Sandbox.snapshot()` | Not implemented |
+
+`cua image build` and `cua image push` build and publish an image to reuse. See
[Choose and build an image](/cua-sdk/guides/images).
## Workloads, ports and sidecars
-| Option | Local | Cloud |
-| --- | --- | --- |
-| `command=` | Container entrypoint, or run by cloud-init in a Linux VM | Template command with `processMode: Run` (container and VM images) |
-| `env=` | Container environment or cloud-init | Template environment with `processMode: Run` (VM images: single-line values) |
-| `services=`, `wait_for=` | Published loopback ports; probes | Gateway services; probes |
-| `sidecars=` | Extra containers sharing the network namespace, reached by name or `localhost`; needs `runtime="runc"` where gVisor would run | Container images: extra containers in the gVisor pod. VM images: a companion gVisor pod named in the guest's `/etc/hosts` |
-| VM sandboxes with `sidecars=` | Refused | Supported (companion pod) |
+| Option | Local |
+| --- | --- |
+| `command=` | Container entrypoint, or run by cloud-init in a Linux VM |
+| `env=` | Container environment or cloud-init |
+| `services=`, `wait_for=` | Published loopback ports; probes |
+| `sidecars=` | Extra containers sharing the network namespace, reached by name or `localhost`; needs `runtime="runc"` where gVisor would run |
+| VM sandboxes with `sidecars=` | Refused |
Sidecars are reached by name on every runtime: the sandbox reaches `db:6379`,
and a sidecar reaches the sandbox at `main`. With sidecars the service names
@@ -91,12 +87,12 @@ CLI), and fails fast when the sandbox exits. The computer interfaces use
cua-spacesd on 3211 when the image has it; the SDK reports the `env`
service only for images that do.
-### Cloud guest services
+### Guest services
-| Service | Template behavior | Guest requirement |
+| Service | Behavior | Guest requirement |
| --- | --- | --- |
| `env` | Published on port 3211 when the image has cua-spacesd | cua-spacesd, for the computer interfaces and `sb.spacesd()` |
-| Names in `services=` | One gateway service per name | Your process listening on that port |
+| Names in `services=` | One service per name | Your process listening on that port |
| `port-N` | Added by `.expose(N)` | The application listening on `N` |
| `server` | Added by the older `server_port=` | Your own daemon on that port |
@@ -108,13 +104,11 @@ Declaring a service does not install or start it. For an example layout, see the
| Sandbox | Computer interfaces | `sb.tunnel.forward()` | `sb.service()`, `public_url()`, `mcp()` |
| --- | --- | --- | --- |
| Local (container, QEMU, Lume) | spacesd, else QMP or VNC fallback | Loopback TCP listener | Yes; public URLs through the cua daemon |
-| Cloud | spacesd through the gateway (gRPC-Web) | Loopback listener (spacesd tunnel, else gateway proxy for a declared service) | Yes; public URLs are signed service URLs |
| Direct `Sandbox.connect(url=...)` | spacesd | spacesd tunnel | No declared services |
| Legacy adapters (Android ADB, OSWorld, Tart, Hyper-V) | Adapter-specific | ADB forwards ports and Android sockets | Adapter-specific |
-Cloud service URLs require authentication unless you create a public URL. See
-[Set up cloud credentials](/cua-sdk/guides/cloud) and
-[Sandbox interfaces](/cua-sdk/reference/python/interfaces).
+For sandboxes in your own cloud, see [Use your own cloud](/cua-sdk/guides/your-cloud)
+and [Sandbox interfaces](/cua-sdk/reference/python/interfaces).
## Evidence and limits
@@ -134,7 +128,7 @@ versions inside a particular deployed image.
published or deployment-qualified guest image.
{/* GENERATED:sandbox-evidence:end */}
-Verification covers source and offline contract checks, not provisioned cloud
-boots, authenticated service requests, or local VM and container boots on every
+Verification covers source and offline contract checks, not provisioned
+cloud boots, authenticated service requests, or local VM and container boots on every
host. Recipe observations, such as the [Windows Minecraft workflow](/cua-sdk/guides/agent-frameworks),
describe their own tested environment.
diff --git a/docs/content/docs/cua-sdk/reference/rust/cua-sandbox-core.mdx b/docs/content/docs/cua-sdk/reference/rust/cua-sandbox-core.mdx
index b381250e44..8948452835 100644
--- a/docs/content/docs/cua-sdk/reference/rust/cua-sandbox-core.mdx
+++ b/docs/content/docs/cua-sdk/reference/rust/cua-sandbox-core.mdx
@@ -297,6 +297,7 @@ Errors.
```rust
pub enum Error {
InvalidArgument(String),
+ CloudEnded,
InvalidPlacement(PlacementError),
NotFound(String),
AmbiguousSandbox { name: String, candidates: Vec<String>, message: String },
@@ -1511,7 +1512,7 @@ pub fn capabilities(on: &On) -> Capabilities
pub fn cloud_capabilities() -> Capabilities
/// The built-in `local` capabilities.
pub fn local_capabilities() -> Capabilities
-/// Every location: `local`, `cloud`, then ...
+/// Every location: `local`, then the ...
pub fn locations() -> Vec<Capabilities>
/// The registered third-party provider ...
pub fn provider(name: &str) -> Option<Capabilities>
@@ -1582,6 +1583,9 @@ pub fn registry_image_dict(reference: &str, os_type: &str, kind: Option<&str>) -
## Constants
```rust
+/// The one "Cua Cloud has ended" message ...
+pub const CLOUD_ENDED: &str = "Cua Cloud has ended; use a local sandbox or your own machine. \
+ See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended";
/// Your own cloud accounts as locations ...
pub const CLOUD_LOCATIONS: &[&str] = _;
/// Every contrib location word the refs ...
diff --git a/docs/content/docs/cua-sdk/reference/sandbox/index.mdx b/docs/content/docs/cua-sdk/reference/sandbox/index.mdx
index e08aac890a..69db7faa10 100644
--- a/docs/content/docs/cua-sdk/reference/sandbox/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/sandbox/index.mdx
@@ -21,7 +21,7 @@ A sandbox's `id()` is its ref, and every call that takes a sandbox name accepts
| Ref | Meaning |
| --- | --- |
| `local:<name>` | A sandbox on this machine |
-| `cloud:<name>` | A cloud sandbox |
+| `aws:<name>` | A sandbox in your own cloud (`gcp:` and `modal:` the same way) |
| `direct:<host:port>` | A machine reached by address |
| `relay:<machine-id>` | An account machine reached through the relay (a Space) |
| `<name>` | A bare name, searched across locations; `AmbiguousSandbox` when it matches more than one |
diff --git a/docs/content/docs/cua-sdk/reference/services.mdx b/docs/content/docs/cua-sdk/reference/services.mdx
index f95c0c8ac4..9784b64173 100644
--- a/docs/content/docs/cua-sdk/reference/services.mdx
+++ b/docs/content/docs/cua-sdk/reference/services.mdx
@@ -18,7 +18,7 @@ Python programs usually use the high-level API instead: [`cua_sandbox` services,
| To reach a guest port | Use | Works |
| --- | --- | --- |
-| From your code, by name | `sandbox.service(name).request(...)` or `.url()` | Declared services, locally and in the cloud |
+| From your code, by name | `sandbox.service(name).request(...)` or `.url()` | Declared services |
| From local tools (a browser, a client) | `sandbox.forward(port)` | Any port; a loopback listener |
| From someone else | `sandbox.public_url(service, ttl_seconds, label)` | Declared services; a bearer URL that expires |
| From an MCP client | `sandbox.mcp_config(service, path)` or `sandbox.mcp(service, path)` | An MCP server behind a declared service |
diff --git a/docs/content/docs/redirects.json b/docs/content/docs/redirects.json
index 9c77b07d12..a6d610df18 100644
--- a/docs/content/docs/redirects.json
+++ b/docs/content/docs/redirects.json
@@ -1,7 +1,7 @@
{
"$comment": "Old docs slug -> current slug. Read by the docs.cua.ai renderer and next.config. When a page is merged or removed, point its entry (and entries targeting it) at the page that preserves its intent.",
"redirects": {
- "cloud-fleets": "cua-sdk/guides/cloud",
+ "cloud-fleets": "cua-sdk/guides/cua-cloud-ended",
"concepts": "",
"concepts/architecture": "cua-sdk/concepts/how-sandboxes-work",
"concepts/browser-targeting-and-background-delivery": "cua-driver/guides/browsers",
@@ -132,7 +132,7 @@
"cua-sdk/guides/mcp": "cua-sdk/guides/services",
"cua-sdk/guides/private-registries": "cua-sdk/guides/images",
"cua-sdk/guides/scale-out": "cua-sdk/guides/lifecycle",
- "cua-sdk/guides/set-up-fleet-credentials": "cua-sdk/guides/cloud",
+ "cua-sdk/guides/set-up-fleet-credentials": "cua-sdk/guides/cua-cloud-ended",
"cua-sdk/guides/share-service-with-signed-url": "cua-sdk/guides/services",
"cua-sdk/guides/tunneling": "cua-sdk/guides/services",
"cua-sdk/reference/api": "cua-sdk/reference",
@@ -277,7 +277,7 @@
"how-to-guides/sandbox/scale-out": "cua-sdk/guides/lifecycle",
"how-to-guides/sandbox/secrets": "cua-sdk/guides/secrets",
"how-to-guides/sandbox/services": "cua-sdk/guides/services",
- "how-to-guides/sandbox/set-up-fleet-credentials": "cua-sdk/guides/cloud",
+ "how-to-guides/sandbox/set-up-fleet-credentials": "cua-sdk/guides/cua-cloud-ended",
"how-to-guides/sandbox/share-service-with-signed-url": "cua-sdk/guides/services",
"how-to-guides/sandbox/sidecars": "cua-sdk/guides/sidecars",
"how-to-guides/sandbox/troubleshoot-fleet-pools": "cua-sdk/guides/cua-cloud-ended",
@@ -440,6 +440,7 @@
"spaces/teams": "spaces/guides/teams",
"spaces/teams/machines": "spaces/guides/teams/machines",
"spaces/teams/faq": "spaces/guides/teams/faq",
- "cua-cli/reference/cli/fleet": "cua-sdk/guides/cua-cloud-ended"
+ "cua-cli/reference/cli/fleet": "cua-sdk/guides/cua-cloud-ended",
+ "cua-sdk/guides/cloud": "cua-sdk/guides/cua-cloud-ended"
}
}
diff --git a/docs/content/docs/spaces/guides/add-a-space.mdx b/docs/content/docs/spaces/guides/add-a-space.mdx
index 4ba381a56b..c82251c69a 100644
--- a/docs/content/docs/spaces/guides/add-a-space.mdx
+++ b/docs/content/docs/spaces/guides/add-a-space.mdx
@@ -7,7 +7,7 @@ import { Callout } from 'fumadocs-ui/components/callout';
The [Quickstart](/spaces/quickstart#run) adds an existing machine by URL. The
same `spaces` object also creates Spaces. Ids are the sandbox refs `cua sb ls`
-prints (`local:<name>`, `cloud:<name>`, `direct:<host:port>`,
+prints (`local:<name>`, `aws:<name>`, `direct:<host:port>`,
`relay:<machine-id>`); a bare name works when it matches one Space.
## Create a Space
diff --git a/docs/content/docs/spaces/guides/cua-volume.mdx b/docs/content/docs/spaces/guides/cua-volume.mdx
index b3799b28be..97537b5613 100644
--- a/docs/content/docs/spaces/guides/cua-volume.mdx
+++ b/docs/content/docs/spaces/guides/cua-volume.mdx
@@ -6,8 +6,8 @@ description: 'One versioned drive per account, shared by every Space and agent:
import { Callout } from 'fumadocs-ui/components/callout';
Cua Volume keeps what outlives a Space: a persistent agent's memory, its
-outputs, and files the user shares with every Space. A cloud Space's disk goes
-back to the pool on release; the drive does not.
+outputs, and files the user shares with every Space. A Space's own disk goes
+away when the Space is deleted; the drive does not.
## Layout
diff --git a/docs/content/docs/spaces/guides/share-a-space.mdx b/docs/content/docs/spaces/guides/share-a-space.mdx
index a88b204564..1f7347f0a5 100644
--- a/docs/content/docs/spaces/guides/share-a-space.mdx
+++ b/docs/content/docs/spaces/guides/share-a-space.mdx
@@ -106,8 +106,8 @@ tools are `relay_register_space` and `relay_unregister_space`.
- The relay shares with accounts, not teams: share with each member.
- Presence cursors travel on the relay stream, not QUIC datagrams, so remote
cursors update a little less often than on your own network.
-- A cloud Space that is released (for example a paused persistent agent)
- leaves the relay. Share it again after it is created again.
+- A Space that is released (for example a paused persistent agent in your
+ cloud) leaves the relay. Share it again after it is created again.
<Callout type="warn">
An editor gets full control of the Space, including anything signed in
diff --git a/docs/content/docs/spaces/guides/stream-a-desktop.mdx b/docs/content/docs/spaces/guides/stream-a-desktop.mdx
index 74be62de04..3e25004841 100644
--- a/docs/content/docs/spaces/guides/stream-a-desktop.mdx
+++ b/docs/content/docs/spaces/guides/stream-a-desktop.mdx
@@ -92,7 +92,7 @@ Agents use the MCP tool `stream_endpoint`. A Space without `desktop_stream`,
| | Details |
|---|---|
-| WebSocket `/media?ticket=...` on 3211 | Default. Works through the Fleet gateway, the relay and browsers. |
+| WebSocket `/media?ticket=...` on 3211 | Default. Works through the relay and browsers. |
| QUIC (ALPN `rcdp/2`) on UDP 3212 | Lower latency when you reach the guest directly; certificate pinned from `OpenMedia`. |
| Video | H.264 (Annex B, SPS/PPS on every keyframe). Encode: VideoToolbox (hardware) on macOS, OpenH264 (software) in Linux Spaces. SDK decode: VideoToolbox (hardware) on macOS, OpenH264 elsewhere. Browser viewers decode with WebCodecs. |
| Audio | Opus 48 kHz stereo, 20 ms frames, same clock as video (A/V skew within ±40 ms). |
diff --git a/docs/content/docs/spaces/quickstart.mdx b/docs/content/docs/spaces/quickstart.mdx
index 013c3f534a..e06faf4959 100644
--- a/docs/content/docs/spaces/quickstart.mdx
+++ b/docs/content/docs/spaces/quickstart.mdx
@@ -125,7 +125,7 @@ docker rm -f my-space
## Next
-- [Add a Space](/spaces/guides/add-a-space): create one locally or in the cloud, from any image.
+- [Add a Space](/spaces/guides/add-a-space): create one locally or in your own cloud, from any image.
- [Stream a desktop](/spaces/guides/stream-a-desktop).
- [Use Spaces from an agent](/spaces/guides/use-from-an-agent).
- [Cua Bots](/spaces/examples/cua-bots): an example app of persistent bots, each with its own Space.
diff --git a/docs/content/docs/spaces/reference/errors.mdx b/docs/content/docs/spaces/reference/errors.mdx
index 67a4fec8da..51ea04fb1f 100644
--- a/docs/content/docs/spaces/reference/errors.mdx
+++ b/docs/content/docs/spaces/reference/errors.mdx
@@ -45,9 +45,9 @@ Branch on `kind`; the message is for people. Every tool can return `invalid_argu
| [`cancelled`](#cancelled) | The create was cancelled (cancel_create, or its caller went away); what it made is gone. |
| [`stream`](#stream) | The media plane failed to open or run the stream. |
| [`env`](#env) | A cua-spacesd call failed. |
-| [`fleet`](#fleet) | The Fleet control plane failed a cloud Space call. |
-| [`fleet_admission_denied`](#fleet_admission_denied) | Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit. The message is Fleet's and names the limit. |
-| [`cloud_credit_exhausted`](#cloud_credit_exhausted) | The account is out of Cua Cloud credit (no credit left, and no card or plan): Fleet refused the new cloud Space. Running Spaces keep running; local Spaces are never affected. The message ends with the billing page's URL. |
+| [`fleet`](#fleet) | Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The Fleet control plane failed a cloud Space call. |
+| [`fleet_admission_denied`](#fleet_admission_denied) | Retired: no longer returned since Cua Cloud ended (cua 0.4.2). Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit. |
+| [`cloud_credit_exhausted`](#cloud_credit_exhausted) | Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The account was out of Cua Cloud credit and Fleet refused the new cloud Space. |
| [`invalid_placement`](#invalid_placement) | The location, kind or runtime does not exist, or the combination (with the image) does not. |
| [`sandbox`](#sandbox) | Starting, stopping or deleting the Space's sandbox failed. |
| [`cloud`](#cloud) | Your cloud account refused or failed a call Cua made for a Space there (AWS, Google Cloud, Modal): a missing permission, a quota, a region without the instance type. The message names the cloud's own error. |
@@ -204,25 +204,25 @@ Fix: Retry; if it persists, check the spacesd log in the Space.
### fleet
-The Fleet control plane failed a cloud Space call.
+Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The Fleet control plane failed a cloud Space call.
-Fix: See the Fleet errors reference for the HTTP status in the message.
+Fix: Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.
Listed by [`create_space`](/spaces/reference/lifecycle#create_space), [`delete_space`](/spaces/reference/lifecycle#delete_space), [`agent_resume`](/spaces/reference/persistent-agents#agent_resume).
### fleet_admission_denied
-Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit. The message is Fleet's and names the limit.
+Retired: no longer returned since Cua Cloud ended (cua 0.4.2). Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit.
-Fix: Pick a size within the limit the message names (most accounts run 1-8 vCPUs and 1-32 GiB), or contact Cua support to raise the account's limits.
+Fix: Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.
Listed by [`create_space`](/spaces/reference/lifecycle#create_space).
### cloud_credit_exhausted
-The account is out of Cua Cloud credit (no credit left, and no card or plan): Fleet refused the new cloud Space. Running Spaces keep running; local Spaces are never affected. The message ends with the billing page's URL.
+Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The account was out of Cua Cloud credit and Fleet refused the new cloud Space.
-Fix: Add credit on the billing page the message names (a plan, or a card for pay as you go), or create the Space locally.
+Fix: Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.
Listed by [`create_space`](/spaces/reference/lifecycle#create_space).
diff --git a/docs/content/docs/spaces/reference/lifecycle.mdx b/docs/content/docs/spaces/reference/lifecycle.mdx
index 8f49c61230..082e9db381 100644
--- a/docs/content/docs/spaces/reference/lifecycle.mdx
+++ b/docs/content/docs/spaces/reference/lifecycle.mdx
@@ -112,7 +112,7 @@ JSON: an array of Spaces (`id`, `name`, `provider`, `spacesd_version`, `features
Create a Space: a new sandbox on this machine, on one of your machines, or in the cloud.
-Creates a new sandbox where `on` says (local: this machine, free; cloud: Cua cloud, metered; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:&lt;name&gt; or cloud:&lt;name&gt;. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on="host:&lt;machine&gt;" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example "spin up 2 macOS Spaces on my spare Mac mini" is on="host:spare mac mini", image="macos", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on="host:&lt;id&gt;"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:&lt;machine&gt; with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on="direct:&lt;addr&gt;" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.
+Creates a new sandbox where `on` says (local: this machine, free; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:&lt;name&gt;. Cua Cloud (on="cloud") has ended and fails with an error that says so. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on="host:&lt;machine&gt;" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example "spin up 2 macOS Spaces on my spare Mac mini" is on="host:spare mac mini", image="macos", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on="host:&lt;id&gt;"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:&lt;machine&gt; with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on="direct:&lt;addr&gt;" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.
| | |
| --- | --- |
diff --git a/docs/scripts/sandbox-navigation.test.ts b/docs/scripts/sandbox-navigation.test.ts
index 8a252fcf50..7819b7fc8f 100644
--- a/docs/scripts/sandbox-navigation.test.ts
+++ b/docs/scripts/sandbox-navigation.test.ts
@@ -33,17 +33,23 @@ test('the Cua SDK has its task guides and one concept page', async () => {
'sidecars',
'lifecycle',
'desktop',
+ 'thumbnails',
+ 'spacesd',
'local-runtimes',
'disk-usage',
- 'cloud',
+ 'cua-cloud-ended',
+ 'your-cloud',
+ 'your-cloud-resources',
'contrib-providers',
'test-in-ci',
'run-a-coding-agent',
+ 'coding-agent-options',
'browse-the-web',
'agent-frameworks',
'omarchy',
+ 'migrate-from-deprecated-packages',
]);
- assert.deepEqual((await metadata('cua-sdk/concepts')).pages, ['how-sandboxes-work']);
+ assert.deepEqual((await metadata('cua-sdk/concepts')).pages, ['how-sandboxes-work', 'telemetry', 'telemetry-events']);
for (const slug of guides.pages) {
assert.equal(await routeExists(`/cua-sdk/guides/${slug}`), true, slug);
}
@@ -72,7 +78,6 @@ test('entry pages link only to existing routes', async () => {
for (const page of [
'cua-sdk/index.mdx',
'cua-sdk/quickstart.mdx',
- 'cua-sdk/guides/cloud.mdx',
'cua-sdk/guides/local-runtimes.mdx',
'cua-sdk/guides/cua-cloud-ended.mdx',
]) {
@@ -91,7 +96,8 @@ test('removed Sandbox and Fleet pages redirect to the page that replaced them',
'cua-sdk/guides/choose-an-image': 'cua-sdk/guides/images',
'cua-sdk/guides/mcp': 'cua-sdk/guides/services',
'cua-sdk/guides/control-the-desktop-with-cua-driver': 'cua-sdk/guides/desktop',
- 'cua-sdk/guides/set-up-fleet-credentials': 'cua-sdk/guides/cloud',
+ 'cua-sdk/guides/set-up-fleet-credentials': 'cua-sdk/guides/cua-cloud-ended',
+ 'cua-sdk/guides/cloud': 'cua-sdk/guides/cua-cloud-ended',
'cua-sdk/guides/examples/minecraft': 'cua-sdk/guides/agent-frameworks',
'cua-sdk/concepts/architecture': 'cua-sdk/concepts/how-sandboxes-work',
'fleets': 'cua-sdk/guides/cua-cloud-ended',
diff --git a/docs/scripts/tests/test_unified_sandbox_docs.py b/docs/scripts/tests/test_unified_sandbox_docs.py
index fe32e97149..6246d96478 100644
--- a/docs/scripts/tests/test_unified_sandbox_docs.py
+++ b/docs/scripts/tests/test_unified_sandbox_docs.py
@@ -54,10 +54,10 @@ class UnifiedSandboxDocsTests(unittest.TestCase):
self.assertIn('<span id="choose-a-published-fleet-image" />', text)
self.assertIn("Windows images do not include a Windows license", text)
- def test_cloud_page_points_to_the_retirement_note(self):
- text = page("cua-sdk/guides/cloud")
- self.assertIn("local=False", text)
- self.assertIn("(/cua-sdk/guides/cua-cloud-ended)", text)
+ def test_cloud_guide_is_removed_and_the_ended_page_stays(self):
+ self.assertFalse((DOCS / "cua-sdk" / "guides" / "cloud.mdx").exists())
+ text = page("cua-sdk/guides/cua-cloud-ended")
+ self.assertIn("Cua Cloud has ended; use a local sandbox or your own machine.", text)
self.assertFalse((DOCS / "fleets").exists())
diff --git a/libs/cua-bench/README.md b/libs/cua-bench/README.md
index 93696fb672..7eb636e8a8 100644
--- a/libs/cua-bench/README.md
+++ b/libs/cua-bench/README.md
@@ -1,6 +1,8 @@
# cua-bench
-Run computer-use benchmark datasets on local and cloud sandboxes.
+Run computer-use benchmark datasets on local sandboxes.
+
+Cua Cloud has ended; `--on cloud` now fails with a pointer to [the notice](https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended).
**[Documentation](https://cua.ai/docs/cuabench)** - Installation, guides, and API reference.
@@ -20,12 +22,12 @@ once into `~/.cua/cbregistry`. `CUA_BENCH_REGISTRY` points at another index.
## Running tasks
-One command runs a task or a dataset on this machine or in the cloud. There is no pool or
+One command runs a task or a dataset on this machine. There is no pool or
provider to set up.
```bash
cb run example_tasks/hello_file_env # local gVisor container (default)
-cb run datasets/cua-bench-basic -j 8 --on cloud # 8 at a time on cua cloud
+cb run datasets/cua-bench-basic -j 8 # 8 at a time, locally
cb run my_task --agent cua-agent --model anthropic/claude-sonnet-4-20250514
cb run my_task --dry-run # what would run, nothing starts
```
@@ -36,9 +38,9 @@ dataset (every task and variant). It runs in the foreground with per-variant sta
| Flag | Meaning |
| --- | --- |
-| `--on local\|cloud` | Where. `local`: sandboxes on this machine through the cua SDK. `cloud`: managed Fleet pools. Default: `CUA_DEFAULT_ON`, then `cua config set default.on`, then `local`. |
+| `--on local` | Where. `local`: sandboxes on this machine through the cua SDK. `cloud` is removed (Cua Cloud has ended). Default: `CUA_DEFAULT_ON`, then `cua config set default.on`, then `local`. |
| `--kind auto\|container\|vm` | What kind. `auto` (default): Linux runs as a container unless the task or the image's variant index says VM; Windows, macOS and Android are VM-only. Default: `CUA_DEFAULT_KIND`, then `default.kind`. |
-| `--runtime auto\|gvisor\|runc\|qemu\|lume\|kubevirt` | Which engine, and it implies the kind. Local containers: `gvisor`, `runc`; local VMs: `qemu`, `lume`; cloud: `gvisor` (containers), `kubevirt` (VMs). `auto` (default) lets the SDK pick. A combination that does not exist is an error listing the valid values. Default: `CUA_DEFAULT_RUNTIME`, then `default.runtime` (skipped for a task it does not fit). |
+| `--runtime auto\|gvisor\|runc\|qemu\|lume\|kubevirt` | Which engine, and it implies the kind. Local containers: `gvisor`, `runc`; local VMs: `qemu`, `lume`. `auto` (default) lets the SDK pick. A combination that does not exist is an error listing the valid values. Default: `CUA_DEFAULT_RUNTIME`, then `default.runtime` (skipped for a task it does not fit). |
| `--image REF` | Image for every task: an OS alias (`linux`, `windows`, `macos:tahoe`), `ghcr.io/trycua/<os>`, any registry ref or a digest, or `pool:<name>` to claim from an existing Fleet pool (`fleet:<name>` is a deprecated alias). Otherwise the task's `setup_config.image`, then `CUA_BENCH_IMAGE`, then the canonical image for the OS. |
| `--cpu`, `--memory` | Resources per sandbox (`--memory 4G`), local and cloud. |
| `-j`, `--max-parallel` | Variants at once. In the cloud this is also the pool's max size. |
@@ -179,9 +181,6 @@ Opt-in live tests (they start real sandboxes):
```bash
CUA_BENCH_E2E_LOCAL=1 uv run pytest -s cua_bench/tests/live/test_local_live.py
-
-set -a; source ~/.env; set +a
-CUA_E2E_FLEET=1 uv run pytest -s cua_bench/tests/live/test_cloud_live.py
```
The ALE check runs agents-last-exam's own loader and harness against this cua-bench:
diff --git a/libs/cua-bench/cua_bench/_ended.py b/libs/cua-bench/cua_bench/_ended.py
new file mode 100644
index 0000000000..f851603c00
--- /dev/null
+++ b/libs/cua-bench/cua_bench/_ended.py
@@ -0,0 +1,6 @@
+"""Cua Cloud has ended: the one message every cloud entry point raises."""
+
+CLOUD_ENDED = (
+ "Cua Cloud has ended; use a local sandbox or your own machine. "
+ "See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended"
+)
diff --git a/libs/cua-bench/cua_bench/cli/commands/env.py b/libs/cua-bench/cua_bench/cli/commands/env.py
index 6bd868f43b..5e49ae8032 100644
--- a/libs/cua-bench/cua_bench/cli/commands/env.py
+++ b/libs/cua-bench/cua_bench/cli/commands/env.py
@@ -10,6 +10,8 @@ they scale to zero when idle and are garbage collected after
"""
from __future__ import annotations
+from cua_bench._ended import CLOUD_ENDED
+
from ._help import examples
import asyncio
@@ -150,6 +152,9 @@ def execute(args) -> int:
if command not in ("ls", "list", "gc"):
print("Usage: cb env ls [--local] | cb env gc [--idle 30m]")
return 1
+ # Cua Cloud has ended: there are no managed pools to list or collect.
+ print(f"{RED}Error: {CLOUD_ENDED}{RESET}")
+ return 1
if not _require_auth():
return 1
try:
diff --git a/libs/cua-bench/cua_bench/cli/commands/login.py b/libs/cua-bench/cua_bench/cli/commands/login.py
index 32bc781b91..4cde94802b 100644
--- a/libs/cua-bench/cua_bench/cli/commands/login.py
+++ b/libs/cua-bench/cua_bench/cli/commands/login.py
@@ -10,6 +10,8 @@ from __future__ import annotations
import shutil
import subprocess
+from cua_bench._ended import CLOUD_ENDED
+
RESET = "\033[0m"
GREEN = "\033[92m"
RED = "\033[91m"
@@ -19,6 +21,9 @@ INSTALL_HINT = "Install the cua CLI: curl -fsSL https://cua.ai/install.sh | sh"
def execute(args) -> int:
+ # Cua Cloud has ended: there is nothing to sign in to for --on cloud.
+ print(f"{RED}Error: {CLOUD_ENDED}{RESET}")
+ return 1
cua = shutil.which("cua")
if cua is None:
print(f"{RED}The `cua` CLI is not on PATH.{RESET} {INSTALL_HINT}")
diff --git a/libs/cua-bench/cua_bench/cli/commands/run.py b/libs/cua-bench/cua_bench/cli/commands/run.py
index 147f894414..63bb0c6d5c 100644
--- a/libs/cua-bench/cua_bench/cli/commands/run.py
+++ b/libs/cua-bench/cua_bench/cli/commands/run.py
@@ -68,7 +68,7 @@ def add_target_args(parser) -> None:
"--on",
choices=list(ON_CHOICES),
default=None,
- help="Where sandboxes run: local (this machine), cloud, your own cloud account "
+ help="Where sandboxes run: local (this machine), your own cloud account "
"(aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a "
"contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). "
"Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
diff --git a/libs/cua-bench/cua_bench/cli/commands/status.py b/libs/cua-bench/cua_bench/cli/commands/status.py
index 703ae45b1c..81c0309721 100644
--- a/libs/cua-bench/cua_bench/cli/commands/status.py
+++ b/libs/cua-bench/cua_bench/cli/commands/status.py
@@ -6,6 +6,8 @@ Usage:
cb status # Show system overview
"""
+from cua_bench._ended import CLOUD_ENDED
+
from ._help import examples
import asyncio
import os
@@ -58,10 +60,9 @@ async def _execute_async(args) -> int:
if system == "Darwin":
_check("Lume:", shutil.which("lume") is not None, "installed", "not installed (macOS VMs)")
- print(f"\n{BOLD}Cloud{RESET} (--on cloud)")
+ print(f"\n{BOLD}Cloud{RESET}")
print("-" * 70)
- source = _cloud_auth()
- _check("Auth:", bool(source), source, "not signed in (cua auth login)")
+ print(f" {YELLOW}{CLOUD_ENDED}{RESET}")
print(f"\n{BOLD}Images{RESET} (canonical; any registry image works with --image)")
print("-" * 70)
diff --git a/libs/cua-bench/cua_bench/cli/main.py b/libs/cua-bench/cua_bench/cli/main.py
index 65a7e7ef9b..a4d683e6b9 100644
--- a/libs/cua-bench/cua_bench/cli/main.py
+++ b/libs/cua-bench/cua_bench/cli/main.py
@@ -228,9 +228,9 @@ def build_parser() -> argparse.ArgumentParser:
**examples(
("Run variant 0 with the oracle solution", "cb run task ./tasks/hello_file_env"),
(
- "Run variant 2 with an agent in the cloud",
+ "Run variant 2 with an agent on this machine",
"cb run task ./tasks/hello_file_env --variant-id 2 --agent cua-agent "
- "--model anthropic/claude-sonnet-4-20250514 --on cloud",
+ "--model anthropic/claude-sonnet-4-20250514 --on local",
),
(
"Show what would run without starting a sandbox",
@@ -435,7 +435,7 @@ def build_parser() -> argparse.ArgumentParser:
# login command (top-level) - authenticate with CUA Cloud
login_parser = subparsers.add_parser(
"login",
- help="Sign in for --on cloud (runs `cua auth login`)",
+ help="Removed: Cua Cloud has ended",
**examples(
("Sign in with a browser", "cb login"),
("Print the sign-in URL instead of opening a browser", "cb login --no-browser"),
diff --git a/libs/cua-bench/cua_bench/sandboxes.py b/libs/cua-bench/cua_bench/sandboxes.py
index ca7a4cc93a..630512769e 100644
--- a/libs/cua-bench/cua_bench/sandboxes.py
+++ b/libs/cua-bench/cua_bench/sandboxes.py
@@ -227,6 +227,11 @@ async def open_sandbox(
)
)
+ if spec.pool or target.cloud:
+ # Cua Cloud has ended: neither `--on cloud` nor `--image pool:<name>` starts one.
+ from cua_bench.targets import CloudEnded
+
+ raise CloudEnded()
if spec.pool:
# `--image pool:<name>`: a claim from an existing Fleet pool.
kwargs = {"pool": spec.pool, "on": "cloud", "time_to_start": TIME_TO_START_S}
diff --git a/libs/cua-bench/cua_bench/targets.py b/libs/cua-bench/cua_bench/targets.py
index 4b4ec0c009..0c6607acf9 100644
--- a/libs/cua-bench/cua_bench/targets.py
+++ b/libs/cua-bench/cua_bench/targets.py
@@ -43,6 +43,7 @@ import re
from dataclasses import dataclass, field
from typing import Any, Iterable, Mapping, Optional
+from cua_bench._ended import CLOUD_ENDED
from cua_bench.images import CANONICAL
#: Contrib providers (third-party platforms) the cua SDK knows; mirrors
@@ -149,6 +150,13 @@ class TargetError(ValueError):
"""An execution target or task environment that cannot run as asked."""
+class CloudEnded(TargetError):
+ """``--on cloud`` (Cua Cloud, Fleet-backed) no longer exists."""
+
+ def __init__(self) -> None:
+ super().__init__(CLOUD_ENDED)
+
+
def parse_memory_mb(value: Any) -> Optional[int]:
"""``"8G"``, ``"8GB"``, ``"512M"``, ``"4096"`` or an int (MiB) to MiB."""
if value is None or value == "":
@@ -362,6 +370,8 @@ def resolve_target(
on, on_source = default("default.on")
on = on or "local"
on = _choice(on, "--on", ON_CHOICES, on_source) or "local"
+ if on == "cloud":
+ raise CloudEnded()
kind = _choice(kind, "--kind", KIND_FLAG_CHOICES, kind_source)
runtime = _choice(runtime, "--runtime", RUNTIME_FLAG_CHOICES, runtime_source)
@@ -683,6 +693,7 @@ def resolve_env_spec(
pool = parse_pool_image(image)
if pool is not None:
# `pool:<name>`: an existing Fleet pool; its template decides the rest.
+ raise CloudEnded() # pool:<name> names a Fleet pool; Cua Cloud has ended
if not target.cloud:
raise TargetError(f"pool:{pool} names a Fleet pool: run it with --on cloud")
kind = (
diff --git a/libs/cua-bench/cua_bench/tests/test_cli_golden.py b/libs/cua-bench/cua_bench/tests/test_cli_golden.py
index 5687d16391..9e17827486 100644
--- a/libs/cua-bench/cua_bench/tests/test_cli_golden.py
+++ b/libs/cua-bench/cua_bench/tests/test_cli_golden.py
@@ -248,6 +248,7 @@ def test_run_list_info_logs_and_trace_lookup(cli_env, tmp_path, capsys):
assert [name for name, _ in traces] == ["hello_file_env_v1"]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_dry_run_plans_without_a_sandbox(cli_env, tmp_path, capsys):
out = tmp_path / "out"
code = run_cb(["run", str(HELLO), "--dry-run", "--kind", "auto", "--output-dir", str(out)])
@@ -273,6 +274,7 @@ def test_dry_run_plans_without_a_sandbox(cli_env, tmp_path, capsys):
assert "valid runtime: auto, gvisor, runc, qemu, lume" in capsys.readouterr().out
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_the_user_default_location_drives_cb_run(cli_env, monkeypatch, capsys):
monkeypatch.setenv("CUA_DEFAULT_ON", "cloud")
assert run_cb(["run", str(HELLO), "--dry-run"]) == 0
@@ -328,6 +330,7 @@ def test_results_record_what_ran(cli_env, tmp_path):
]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_env_ls_and_gc_use_the_sdk_pools_api(cli_env, monkeypatch, capsys):
from types import SimpleNamespace
diff --git a/libs/cua-bench/cua_bench/tests/test_cloud_ended.py b/libs/cua-bench/cua_bench/tests/test_cloud_ended.py
new file mode 100644
index 0000000000..9be3c6fe1f
--- /dev/null
+++ b/libs/cua-bench/cua_bench/tests/test_cloud_ended.py
@@ -0,0 +1,49 @@
+"""Cua Cloud has ended (CUA-1854): ``--on cloud`` fails with one message."""
+
+import pytest
+from cua_bench._ended import CLOUD_ENDED
+from cua_bench.cli.commands import env as env_cmd
+from cua_bench.cli.commands import login as login_cmd
+from cua_bench.targets import CloudEnded, Target, TargetError, resolve_env_spec, resolve_target
+
+MESSAGE = (
+ "Cua Cloud has ended; use a local sandbox or your own machine. "
+ "See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended"
+)
+
+
+def test_the_message_is_exact():
+ assert CLOUD_ENDED == MESSAGE
+ assert str(CloudEnded()) == MESSAGE
+ assert isinstance(CloudEnded(), TargetError)
+
+
+def test_on_cloud_is_refused():
+ with pytest.raises(CloudEnded, match="Cua Cloud has ended"):
+ resolve_target("cloud")
+
+
+def test_a_cloud_default_is_refused():
+ with pytest.raises(CloudEnded):
+ resolve_target(environ={"CUA_DEFAULT_ON": "cloud"})
+
+
+def test_a_fleet_pool_image_is_refused():
+ with pytest.raises(CloudEnded):
+ resolve_env_spec({"provider": "native"}, Target(on="local", image="pool:bench-p"))
+
+
+def test_local_still_resolves():
+ assert resolve_target("local").on == "local"
+
+
+def test_env_and_login_exit_non_zero(capsys):
+ class Args:
+ env_command = "ls"
+ local = False
+ idle = "30m"
+ no_browser = False
+
+ assert env_cmd.execute(Args()) == 1
+ assert login_cmd.execute(Args()) == 1
+ assert MESSAGE in capsys.readouterr().out
diff --git a/libs/cua-bench/cua_bench/tests/test_lifecycle.py b/libs/cua-bench/cua_bench/tests/test_lifecycle.py
index 4f32592689..4125fc68f2 100644
--- a/libs/cua-bench/cua_bench/tests/test_lifecycle.py
+++ b/libs/cua-bench/cua_bench/tests/test_lifecycle.py
@@ -38,6 +38,7 @@ async def test_gym_reset_opens_and_close_releases(sdk):
assert sdk.live == 0 and sdk.released == 1
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_gym_target_cloud(sdk):
env = make(str(HELLO))
diff --git a/libs/cua-bench/cua_bench/tests/test_remote_session.py b/libs/cua-bench/cua_bench/tests/test_remote_session.py
index fbfbe4e149..b9ce25d14a 100644
--- a/libs/cua-bench/cua_bench/tests/test_remote_session.py
+++ b/libs/cua-bench/cua_bench/tests/test_remote_session.py
@@ -39,7 +39,9 @@ def fake_sdk(monkeypatch):
@pytest.mark.asyncio
async def test_client_only_mode_connects_by_url(fake_sdk):
mod, sb = fake_sdk
- async with remote.RemoteDesktopSession(api_url="http://h:1234/", transport="spacesd") as session:
+ async with remote.RemoteDesktopSession(
+ api_url="http://h:1234/", transport="spacesd"
+ ) as session:
assert session.sandbox is sb and session.computer.interface.sandbox is sb
mod.Sandbox.connect.assert_awaited_once_with(url="http://h:1234")
sb.disconnect.assert_awaited_once()
@@ -69,6 +71,7 @@ async def test_full_lifecycle_uses_the_runner_lifecycle(monkeypatch):
assert sdk.live == 0 and sdk.released == 1
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_full_lifecycle_windows_and_cloud(monkeypatch):
from cua_bench import sandboxes
@@ -232,9 +235,7 @@ async def test_click_element_scrolls_into_view_and_picks_options(monkeypatch):
assert actions == [ClickAction(x=120, y=210)]
# An <option> is picked in the page; the open native popup is closed.
- session, scripts, actions = _scripted_session(
- monkeypatch, [("'OPTION'", "option")], {}
- )
+ session, scripts, actions = _scripted_session(monkeypatch, [("'OPTION'", "option")], {})
await session.click_element(7, 'option[value="apple"]')
assert [type(a).__name__ for a in actions] == ["KeyAction"]
assert actions[0].key == "Escape"
diff --git a/libs/cua-bench/cua_bench/tests/test_targets.py b/libs/cua-bench/cua_bench/tests/test_targets.py
index dff21da9c2..42e9ad126d 100644
--- a/libs/cua-bench/cua_bench/tests/test_targets.py
+++ b/libs/cua-bench/cua_bench/tests/test_targets.py
@@ -58,6 +58,7 @@ class TestResolveTarget:
with pytest.raises(SystemExit):
parser.parse_args(["--on", "fleet"])
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_env_fallbacks(self):
t = resolve_target(
environ={"CUA_DEFAULT_ON": "cloud", "CUA_DEFAULT_KIND": "vm", "CUA_BENCH_IMAGE": IMG}
@@ -73,6 +74,7 @@ class TestResolveTarget:
t = resolve_target("local", runtime="qemu", environ={})
assert (t.on, t.kind, t.runtime) == ("local", "vm", "qemu")
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_resources(self):
t = resolve_target(
"cloud", cpu="2", memory="4G", concurrency=8, warm=True, claim_ttl="20m", environ={}
@@ -338,6 +340,7 @@ class TestVariantSelection:
class TestPoolImages:
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_pool_prefix_claims_from_an_existing_fleet_pool(self):
spec = resolve_env_spec({"provider": "native"}, Target(on="cloud", image="pool:bench-p"))
assert (spec.pool, spec.image, spec.image_label) == ("bench-p", None, "pool:bench-p")
@@ -345,6 +348,7 @@ class TestPoolImages:
with pytest.raises(TargetError, match="--on cloud"):
resolve_env_spec({"provider": "native"}, Target(image="pool:bench-p"))
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_fleet_prefix_is_a_deprecated_alias(self):
with pytest.warns(DeprecationWarning, match="use pool:old"):
spec = resolve_env_spec({"provider": "native"}, Target(on="cloud", image="fleet:old"))
diff --git a/libs/cua-bench/cua_bench/tests/test_unified_runner.py b/libs/cua-bench/cua_bench/tests/test_unified_runner.py
index 9ef5360f19..33d28bc0fb 100644
--- a/libs/cua-bench/cua_bench/tests/test_unified_runner.py
+++ b/libs/cua-bench/cua_bench/tests/test_unified_runner.py
@@ -215,6 +215,7 @@ class TestCloudAuth:
with pytest.raises(sandboxes.CloudAuthError, match="cua auth login"):
sandboxes.cloud_auth_source(lambda: None)
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_cloud_run_stops_before_any_claim_without_credentials(
self, fake_sdk, monkeypatch, tmp_path, capsys
):
@@ -313,6 +314,7 @@ class Recorder:
class TestBatchRunner:
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_cloud_batch_claims_one_pool_sized_to_concurrency(self, fake_sdk, task_dir, tmp_path):
statuses = []
recorder = Recorder()
@@ -353,6 +355,7 @@ class TestBatchRunner:
)
assert ("s0", "running") in statuses and ("s2", "failed") in statuses
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_first_cloud_claim_per_pool_is_single_flight(self, fake_sdk, task_dir, tmp_path):
order = []
real = fake_sdk.Sandbox.ephemeral
@@ -390,6 +393,7 @@ class TestBatchRunner:
)
assert results[0].backend == "local-gvisor"
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
def test_cancel_releases_every_claim(self, fake_sdk, task_dir, tmp_path):
fake_sdk.delay = 30 # hold the claims until cancelled
runner = BatchRunner(Target(on="cloud", concurrency=3), AgentOptions(oracle=True))
@@ -482,6 +486,7 @@ if sys.platform == "win32": # pragma: no cover
pytestmark = pytest.mark.skip("fcntl-based run bookkeeping")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_pool_image_opens_a_claim_from_that_pool(monkeypatch):
from cua_bench.targets import resolve_env_spec as resolve
diff --git a/libs/cua-spacesd/tests/spaces-e2e/tests/daemon_spaces.rs b/libs/cua-spacesd/tests/spaces-e2e/tests/daemon_spaces.rs
index 2651fdd1b0..1d07d80cbf 100644
--- a/libs/cua-spacesd/tests/spaces-e2e/tests/daemon_spaces.rs
+++ b/libs/cua-spacesd/tests/spaces-e2e/tests/daemon_spaces.rs
@@ -376,6 +376,28 @@ async fn mcp_over_streamable_http_decodes_through_the_typed_client() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+async fn creating_a_cloud_space_fails_with_the_cloud_ended_message() {
+ let dir = tempfile::tempdir().unwrap();
+ let h = daemon(dir.path()).await;
+ let status = client(&h)
+ .spaces()
+ .create_space(pb::CreateSpaceRequest {
+ image: "ghcr.io/trycua/linux:24.04-disk".into(),
+ location: "cloud".into(),
+ name: "cua-e2e-ended".into(),
+ ..Default::default()
+ })
+ .await
+ .expect_err("a cloud create fails");
+ assert_eq!(status.code(), tonic::Code::Unimplemented);
+ assert!(
+ status.message().contains("Cua Cloud has ended"),
+ "{status:?}"
+ );
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn media_bridge_resolves_a_fleet_space_with_its_gateway_headers() {
use cua_daemon::fixtures;
use futures_util::StreamExt;
diff --git a/libs/cua-spacesd/tests/spaces-e2e/tests/spaces_mcp.rs b/libs/cua-spacesd/tests/spaces-e2e/tests/spaces_mcp.rs
index f04da697d3..fa7ba5de19 100644
--- a/libs/cua-spacesd/tests/spaces-e2e/tests/spaces_mcp.rs
+++ b/libs/cua-spacesd/tests/spaces-e2e/tests/spaces_mcp.rs
@@ -171,10 +171,14 @@ async fn stdio_speaks_mcp_and_publishes_the_contract() {
teleport["structuredContent"]["error"]["kind"],
"host_capability_missing"
);
+ // Cua Cloud has ended: a cloud create fails with the one message.
let fleet = c.call("create_space", json!({"on": "cloud"})).await;
- assert_eq!(
- fleet["structuredContent"]["error"]["kind"],
- "host_capability_missing"
+ assert_eq!(fleet["structuredContent"]["error"]["kind"], "sandbox");
+ assert!(
+ fleet["structuredContent"]["error"]["message"]
+ .as_str()
+ .is_some_and(|m| m.contains("Cua Cloud has ended")),
+ "{fleet}"
);
}
diff --git a/libs/cua/crates/cua-cli/src/auth.rs b/libs/cua/crates/cua-cli/src/auth.rs
index 3685d8cffb..9c66849761 100644
--- a/libs/cua/crates/cua-cli/src/auth.rs
+++ b/libs/cua/crates/cua-cli/src/auth.rs
@@ -104,15 +104,15 @@ pub async fn fleet_config() -> Result<Option<(cua_fleet::FleetConfig, FleetAuth)
}
}
-/// A connected Fleet client, or `ProviderNotConfigured`.
+/// A connected Fleet client. Cua Cloud has ended: always
+/// [`cloud_ended`], so no command reaches Fleet.
pub async fn fleet_client() -> Result<(cua_fleet::FleetClient, FleetAuth), CuaError> {
- let Some((cfg, auth)) = fleet_config().await? else {
- return Err(CuaError::ProviderNotConfigured(
- cua_fleet::MISSING_CREDENTIALS.into(),
- ));
- };
- let c = cua_fleet::FleetClient::connect(cfg).map_err(fleet_err)?;
- Ok((c, auth))
+ Err(cloud_ended())
+}
+
+/// The "Cua Cloud has ended" error every Cua Cloud command fails with.
+pub fn cloud_ended() -> CuaError {
+ CuaError::Unsupported(cua_sandbox_core::CLOUD_ENDED.into())
}
/// Maps a Fleet error.
diff --git a/libs/cua/crates/cua-cli/src/config_cmd.rs b/libs/cua/crates/cua-cli/src/config_cmd.rs
index 48959f885d..96ef016634 100644
--- a/libs/cua/crates/cua-cli/src/config_cmd.rs
+++ b/libs/cua/crates/cua-cli/src/config_cmd.rs
@@ -184,12 +184,12 @@ mod tests {
let (r, o) = run_s(
ConfigCmd::Set {
key: "default.on".into(),
- value: "cloud".into(),
+ value: "aws".into(),
},
false,
);
assert_eq!(r.unwrap(), 0);
- assert!(o.starts_with("default.on = cloud ("), "{o}");
+ assert!(o.starts_with("default.on = aws ("), "{o}");
let (_, o) = run_s(ConfigCmd::List, true);
let v: serde_json::Value = serde_json::from_str(&o).unwrap();
let on = v
@@ -200,7 +200,7 @@ mod tests {
.unwrap();
assert_eq!(
(on["value"].as_str(), on["source"].as_str()),
- (Some("cloud"), Some("config"))
+ (Some("aws"), Some("config"))
);
let kind = v
.as_array()
@@ -227,7 +227,7 @@ mod tests {
let (_, o) = run_s(
ConfigCmd::Set {
key: "default.on".into(),
- value: "cloud".into(),
+ value: "aws".into(),
},
false,
);
@@ -246,6 +246,18 @@ mod tests {
assert!(o.contains("default.on unset; now local (default)"), "{o}");
let (_, o) = run_s(ConfigCmd::Path, false);
assert!(o.trim().ends_with("config.toml"));
+ // Cua Cloud has ended: refused with the one message.
+ let (r, _) = run_s(
+ ConfigCmd::Set {
+ key: "default.on".into(),
+ value: "cloud".into(),
+ },
+ false,
+ );
+ assert!(
+ r.unwrap_err().to_string().contains("Cua Cloud has ended"),
+ "default.on cloud is refused"
+ );
drop(env);
}
diff --git a/libs/cua/crates/cua-cli/src/lib.rs b/libs/cua/crates/cua-cli/src/lib.rs
index 0d57fa3d12..786e44387c 100644
--- a/libs/cua/crates/cua-cli/src/lib.rs
+++ b/libs/cua/crates/cua-cli/src/lib.rs
@@ -1629,10 +1629,14 @@ async fn run(cli: Cli, out: &mut dyn Write) -> Result<i32, CuaError> {
let state_dir = cli.state_dir.clone();
return cache::run(cmd.clone(), state_dir.as_deref(), json, out).await;
}
+ // Cua Cloud has ended: Fleet pools and Fleet image resources fail
+ // before anything else.
Command::Fleet(FleetCmd::Pool(PoolCmd::Export { name, terraform })) => {
+ Err::<(), _>(auth::cloud_ended())?;
return pools::export(name, *terraform, out).await;
}
Command::Fleet(FleetCmd::Pools(cmd)) => {
+ Err::<(), _>(auth::cloud_ended())?;
let state_dir = cli.state_dir.as_deref();
return match cmd {
PoolsCmd::Ls => pools::list(state_dir, json, out).await,
@@ -1647,6 +1651,7 @@ async fn run(cli: Cli, out: &mut dyn Write) -> Result<i32, CuaError> {
| ImageCmd::Rm { .. }
| ImageCmd::Create { .. }),
) => {
+ Err::<(), _>(auth::cloud_ended())?;
return match i {
ImageCmd::Ls { namespace } => images::list(namespace.clone(), json, out).await,
ImageCmd::Info { name, namespace } => {
diff --git a/libs/cua/crates/cua-cli/src/sandbox.rs b/libs/cua/crates/cua-cli/src/sandbox.rs
index 3bc5cd9b32..09d03b8f99 100644
--- a/libs/cua/crates/cua-cli/src/sandbox.rs
+++ b/libs/cua/crates/cua-cli/src/sandbox.rs
@@ -1311,10 +1311,17 @@ fn print(out: &mut dyn Write, v: serde_json::Value, json: bool, text: impl FnOnc
/// flags, else `--pool` means the cloud, else the user defaults
/// (`cua config`, `CUA_DEFAULT_*`), each with its source.
pub fn resolve_placement(a: &CreateArgs) -> Result<cua_sandbox_core::settings::Resolved, CuaError> {
- let on = a.on.clone().or_else(|| a.pool.as_ref().map(|_| On::Cloud));
+ // Cua Cloud has ended: `--pool` (a cloud pool, or its template run
+ // locally) and `--on cloud`, given or as the default.
+ if a.pool.is_some() {
+ return Err(auth::cloud_ended());
+ }
let r = settings()?
- .resolve(on, a.kind, a.runtime.clone())
+ .resolve(a.on.clone(), a.kind, a.runtime.clone())
.map_err(|e| CuaError::InvalidArgument(e.0))?;
+ if r.on == On::Cloud {
+ return Err(auth::cloud_ended());
+ }
cua_sandbox_core::placement::validate(&r.on, r.kind, &r.runtime)
.map_err(|e| CuaError::InvalidPlacement(e.message))?;
Ok(r)
@@ -1792,20 +1799,8 @@ pub async fn run(
let _ = all; // deprecated no-op: everything is the default
return ls(cua, local, cloud, !no_size, json_global, out).await;
}
- SandboxCmd::KeepAlive { name, at, duration } => {
- let name = at.apply(&name)?;
- let sb = sbx.connect(name.clone()).await?;
- sb.keep_alive(duration).await?;
- let until =
- std::time::SystemTime::now() + std::time::Duration::from_secs(u64::from(duration));
- let until = humantime::format_rfc3339_seconds(until).to_string();
- print(
- out,
- serde_json::json!({"name": name, "expires_at": until}),
- json_global,
- || format!("Sandbox '{name}' is kept alive until {until}"),
- );
- }
+ // Extends a Fleet claim's lease: Cua Cloud has ended.
+ SandboxCmd::KeepAlive { .. } => return Err(auth::cloud_ended()),
SandboxCmd::Cp { src, dst, at } => return cp(cua, &src, &dst, at, json_global, out).await,
SandboxCmd::Url {
name,
@@ -3374,30 +3369,27 @@ mod tests {
#[test]
fn placement_resolves_flags_then_pool_then_defaults() {
let _env = crate::util::test_env::isolated();
- let a = CreateArgs {
+ // Cua Cloud has ended: --pool (either location) and --on cloud.
+ let ended = |a: &CreateArgs| {
+ let e = resolve_placement(a).unwrap_err();
+ assert!(e.to_string().contains("Cua Cloud has ended"), "{e}");
+ };
+ ended(&CreateArgs {
pool: Some("p".into()),
..Default::default()
- };
- assert_eq!(resolve_placement(&a).unwrap().on, On::Cloud);
- let a = CreateArgs {
+ });
+ ended(&CreateArgs {
on: Some(On::Local),
pool: Some("p".into()),
..Default::default()
- };
- assert_eq!(resolve_placement(&a).unwrap().on, On::Local);
- let a = CreateArgs::default();
- assert_eq!(resolve_placement(&a).unwrap().on, On::Local);
- let a = CreateArgs {
+ });
+ ended(&CreateArgs {
on: Some(On::Cloud),
runtime: Some(Runtime::Qemu),
..Default::default()
- };
- let e = resolve_placement(&a).unwrap_err();
- assert!(
- e.to_string()
- .contains("valid runtime: auto, gvisor, kubevirt"),
- "{e}"
- );
+ });
+ let a = CreateArgs::default();
+ assert_eq!(resolve_placement(&a).unwrap().on, On::Local);
}
#[test]
diff --git a/libs/cua/crates/cua-cli/tests/auth.rs b/libs/cua/crates/cua-cli/tests/auth.rs
index b68484cff2..6f8f492105 100644
--- a/libs/cua/crates/cua-cli/tests/auth.rs
+++ b/libs/cua/crates/cua-cli/tests/auth.rs
@@ -189,6 +189,7 @@ async fn whoami_reports_client_credentials_and_workload_tokens() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_user_api_keys() {
let fake = FakeFleet::new();
let fleet = cua_daemon::fixtures::start_fleet_http(fake.clone()).await;
diff --git a/libs/cua/crates/cua-cli/tests/mcp_skills_images.rs b/libs/cua/crates/cua-cli/tests/mcp_skills_images.rs
index dc7feacb62..011f651b3c 100644
--- a/libs/cua/crates/cua-cli/tests/mcp_skills_images.rs
+++ b/libs/cua/crates/cua-cli/tests/mcp_skills_images.rs
@@ -580,6 +580,7 @@ async fn trajectory_view_serves_the_zip_with_cors_then_stops() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_image_resources() {
let fake = FakeFleet::new();
fake.put_object(
diff --git a/libs/cua/crates/cua-cli/tests/sandbox_do.rs b/libs/cua/crates/cua-cli/tests/sandbox_do.rs
index 62450db6c3..ab418ef5c5 100644
--- a/libs/cua/crates/cua-cli/tests/sandbox_do.rs
+++ b/libs/cua/crates/cua-cli/tests/sandbox_do.rs
@@ -166,17 +166,28 @@ async fn launch_validates_arguments() {
assert_eq!(o.code, 2, "{o:?}");
assert!(o.stderr.contains("--name is required"), "{o:?}");
let o = h
- .run(&["--embedded", "sb", "launch", "linux", "--memory", "lots"])
+ .run(&[
+ "--embedded",
+ "sb",
+ "launch",
+ "linux",
+ "--on",
+ "local",
+ "--memory",
+ "lots",
+ ])
.await;
assert_eq!(o.code, 2, "{o:?}");
- // Fleet without credentials.
+ // Cua Cloud has ended: launch's cloud default and --pool fail with it.
let o = h
.run(&["--embedded", "sb", "launch", "--pool", "p", "--name", "x"])
.await;
assert_eq!(o.code, 4, "{o:?}");
+ assert!(o.stderr.contains("Cua Cloud has ended"), "{o:?}");
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_pool_launch_list_suspend_and_release() {
let fake = FakeFleet::new();
let fleet = fixtures::start_fleet_http(fake.clone()).await;
@@ -852,6 +863,7 @@ async fn sandbox_mcp_tools_call_and_content() {
/// vault only when the session marker says one is stored (a stand-in vault
/// here; it counts its reads).
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn default_ls_reads_a_keychain_session_only_with_the_marker() {
let fake = FakeFleet::new();
let fleet = fixtures::start_fleet_http(fake.clone()).await;
diff --git a/libs/cua/crates/cua-cli/tests/sandbox_on.rs b/libs/cua/crates/cua-cli/tests/sandbox_on.rs
index a8cdb7ed63..8d8961f239 100644
--- a/libs/cua/crates/cua-cli/tests/sandbox_on.rs
+++ b/libs/cua/crates/cua-cli/tests/sandbox_on.rs
@@ -110,6 +110,7 @@ fn row<'a>(rows: &'a Value, name: &str) -> &'a Value {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_managed_pool_full_lifecycle() {
let w = fleet_world("box", &[("web", 8080)]).await;
let h = &w.h;
@@ -375,6 +376,7 @@ async fn fleet_managed_pool_full_lifecycle() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn launch_is_a_create_alias_on_fleet_with_generated_names() {
let w = fleet_world("unused", &[]).await;
let h = &w.h;
@@ -438,6 +440,7 @@ async fn launch_is_a_create_alias_on_fleet_with_generated_names() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn the_daemon_is_started_and_holds_fleet_claims() {
let w = fleet_world("held", &[]).await;
let mut h = w.h;
@@ -624,13 +627,13 @@ async fn create_validates_on_and_flags() {
.await;
assert_eq!(o.code, 2, "{o:?}");
assert!(o.stderr.contains("unknown location"), "{o:?}");
- assert!(o.stderr.contains("valid on: local, cloud"), "{o:?}");
+ assert!(o.stderr.contains("valid on: local, e2b"), "{o:?}");
// Engines and kinds are not locations: the error names the right flag.
for (on, hint) in [
("qemu", "use `--runtime qemu`"),
("lume", "use `--runtime lume`"),
("docker", "use `--kind container`"),
- ("fleet", "the cloud location is `cloud`"),
+ ("fleet", "Cua Cloud has ended"),
] {
let o = h
.run(&["--embedded", "sb", "create", "img", "--on", on])
@@ -639,22 +642,6 @@ async fn create_validates_on_and_flags() {
assert!(o.stderr.contains(hint), "{on}: {o:?}");
}
// An impossible location x kind x runtime lists the valid runtimes.
- let o = h
- .run(&[
- "--embedded",
- "sb",
- "create",
- "img",
- "--on",
- "cloud",
- "--kind",
- "vm",
- "--runtime",
- "gvisor",
- ])
- .await;
- assert_eq!(o.code, 2, "{o:?}");
- assert!(o.stderr.contains("valid runtime: auto, kubevirt"), "{o:?}");
let o = h
.run(&[
"--embedded",
@@ -673,62 +660,34 @@ async fn create_validates_on_and_flags() {
.contains("valid runtime: auto, gvisor, runc, qemu, lume"),
"{o:?}"
);
- let o = h
- .run(&["--embedded", "sb", "create", "--on", "cloud"])
- .await;
- assert_eq!(o.code, 2, "{o:?}");
- assert!(
- o.stderr.contains("IMAGE is required for --on cloud"),
- "{o:?}"
- );
- // --pool locally runs that pool's template; an existing machine refuses.
- let o = h
- .run(&[
- "--embedded",
- "sb",
- "create",
- "--on",
- "direct:127.0.0.1:1",
- "--pool",
- "p",
- ])
- .await;
- assert_eq!(o.code, 2, "{o:?}");
- let o = h
- .run(&[
- "--embedded",
- "sb",
- "create",
+ // Cua Cloud has ended: --on cloud and --pool (any location) fail with
+ // the one message before anything else.
+ for args in [
+ &[
"img",
"--on",
- "local",
- "--pool",
- "p",
- ])
- .await;
- assert_eq!(o.code, 2, "{o:?}");
- assert!(o.stderr.contains("not both"), "{o:?}");
- // launch --local --pool (deprecated spelling) needs no --name (a local
- // template run); without cloud credentials it fails naming the backend.
+ "cloud",
+ "--kind",
+ "vm",
+ "--runtime",
+ "gvisor",
+ ][..],
+ &["--on", "cloud"],
+ &["ghcr.io/x/y@sha256:1", "--on", "cloud"],
+ &["--on", "direct:127.0.0.1:1", "--pool", "p"],
+ &["img", "--on", "local", "--pool", "p"],
+ ] {
+ let o = h
+ .run(&[&["--embedded", "sb", "create"][..], args].concat())
+ .await;
+ assert_eq!(o.code, 4, "{args:?}: {o:?}");
+ assert!(o.stderr.contains("Cua Cloud has ended"), "{args:?}: {o:?}");
+ }
let o = h
.run(&["--embedded", "sb", "launch", "--local", "--pool", "p"])
.await;
- assert_ne!(o.code, 2, "{o:?}");
- assert!(o.stderr.contains("[local]"), "{o:?}");
- assert!(o.stderr.contains("`--local` is deprecated"), "{o:?}");
- // The cloud without credentials names the backend.
- let o = h
- .run(&[
- "--embedded",
- "sb",
- "create",
- "ghcr.io/x/y@sha256:1",
- "--on",
- "cloud",
- ])
- .await;
assert_eq!(o.code, 4, "{o:?}");
- assert!(o.stderr.contains("[cloud]"), "{o:?}");
+ assert!(o.stderr.contains("Cua Cloud has ended"), "{o:?}");
// The flags `create` never shipped are gone.
for gone in ["--vm", "--container", "--provider", "--url", "--local"] {
let o = h.run(&["--embedded", "sb", "create", "img", gone]).await;
@@ -783,7 +742,11 @@ async fn the_default_location_is_configurable() {
let o = h.run(&["config", "get", "default.on"]).await;
o.ok();
assert_eq!(o.stdout.trim(), "local");
- h.run(&["config", "set", "default.on", "cloud"]).await.ok();
+ // Cua Cloud has ended: refused with the one message.
+ let o = h.run(&["config", "set", "default.on", "cloud"]).await;
+ assert_ne!(o.code, 0, "{o:?}");
+ assert!(o.stderr.contains("Cua Cloud has ended"), "{o:?}");
+ h.run(&["config", "set", "default.on", "aws"]).await.ok();
let o = h.run(&["--json", "config", "list"]).await;
o.ok();
let on = o
@@ -796,17 +759,7 @@ async fn the_default_location_is_configurable() {
.unwrap();
assert_eq!(
(on["value"].as_str(), on["source"].as_str()),
- (Some("cloud"), Some("config"))
- );
- // No credentials: the error says how to log in or switch back.
- let o = h
- .run(&["--embedded", "sb", "create", "ghcr.io/x/y@sha256:1"])
- .await;
- assert_eq!(o.code, 4, "{o:?}");
- assert!(o.stderr.contains("cua auth login"), "{o:?}");
- assert!(
- o.stderr.contains("cua config set default.on local"),
- "{o:?}"
+ (Some("aws"), Some("config"))
);
// The environment beats the config file.
h.set("CUA_DEFAULT_ON", "local");
diff --git a/libs/cua/crates/cua-daemon/src/lib.rs b/libs/cua/crates/cua-daemon/src/lib.rs
index 1094023892..7bbf208a5f 100644
--- a/libs/cua/crates/cua-daemon/src/lib.rs
+++ b/libs/cua/crates/cua-daemon/src/lib.rs
@@ -397,6 +397,7 @@ impl From<cua_sandbox_core::Error> for Error {
let m = e.to_string();
match e {
E::InvalidArgument(a) => Error::InvalidArgument(a),
+ E::CloudEnded => Error::Unsupported(m),
E::InvalidPlacement(p) => Error::from(p),
E::NotFound(_) => Error::NotFound(m),
E::AmbiguousSandbox {
@@ -411,7 +412,7 @@ impl From<cua_sandbox_core::Error> for Error {
cua_sandbox_core::ProviderKind::Local => {
"local runtimes are not available in this build yet (cua-vmm)".into()
}
- cua_sandbox_core::ProviderKind::Fleet => cua_fleet::MISSING_CREDENTIALS.into(),
+ cua_sandbox_core::ProviderKind::Fleet => cua_sandbox_core::CLOUD_ENDED.into(),
cua_sandbox_core::ProviderKind::Direct
| cua_sandbox_core::ProviderKind::Contrib => m,
}),
diff --git a/libs/cua/crates/cua-daemon/src/runtime.rs b/libs/cua/crates/cua-daemon/src/runtime.rs
index 275d0da629..2aa31b8a46 100644
--- a/libs/cua/crates/cua-daemon/src/runtime.rs
+++ b/libs/cua/crates/cua-daemon/src/runtime.rs
@@ -198,7 +198,9 @@ pub struct Listing {
}
/// The account's live Fleet claims as records (`location` `cloud`).
-/// Namespaces this principal may not read are skipped.
+/// Namespaces this principal may not read are skipped. Unused since Cua
+/// Cloud ended; removed with the Fleet runtime.
+#[allow(dead_code)]
async fn cloud_claims(fleet: &FleetClient) -> Result<Vec<SandboxRecord>> {
let namespaces = fleet
.sdk()
@@ -690,7 +692,9 @@ impl Runtime {
};
let provider = match &resolved.on {
On::Local => ProviderKind::Local,
- On::Cloud => ProviderKind::Fleet,
+ On::Cloud => {
+ return Err(Error::Unsupported(cua_sandbox_core::CLOUD_ENDED.into()));
+ }
On::Direct(addr) => {
if !addr.is_empty() {
req.url = Some(addr.clone());
@@ -1151,47 +1155,24 @@ impl Runtime {
}
/// The sandbox listing every surface shows: the known sandboxes of
- /// `provider` (all when `None`) and, with `include_cloud` when the
- /// filter allows cloud rows, the account's live Fleet claims, each
- /// tagged with its `location`. The cloud part never fails the listing:
- /// without Fleet credentials it is skipped silently (a warning only when
- /// only cloud rows were asked for), and a Fleet error or a Fleet call
- /// slower than [`LIST_CLOUD_TIMEOUT`] becomes a warning.
+ /// `provider` (all when `None`), each tagged with its `location`. Cua
+ /// Cloud has ended, so `include_cloud` no longer adds the account's
+ /// Fleet claims (Fleet is never called).
pub async fn list_filtered(
&self,
provider: Option<ProviderKind>,
include_cloud: bool,
) -> Result<Listing> {
- let mut out: BTreeMap<String, SandboxRecord> = self
+ let out: BTreeMap<String, SandboxRecord> = self
.list(provider)
.await?
.into_iter()
.map(|r| (r.id.clone(), r))
.collect();
- let mut warnings = Vec::new();
- if include_cloud && provider.is_none_or(|p| p == ProviderKind::Fleet) {
- let cloud = match self.fleet() {
- Ok(fleet) => {
- match tokio::time::timeout(LIST_CLOUD_TIMEOUT, cloud_claims(fleet)).await {
- Ok(r) => r,
- Err(_) => Err(Error::Timeout(format!(
- "Fleet did not answer within {}s",
- LIST_CLOUD_TIMEOUT.as_secs()
- ))),
- }
- }
- Err(e) => Err(e),
- };
- match cloud {
- Ok(rows) => {
- for r in rows {
- out.entry(r.id.clone()).or_insert(r);
- }
- }
- Err(Error::ProviderNotConfigured(_)) if provider.is_none() => {}
- Err(e) => warnings.push(format!("cloud sandboxes not listed: {e}")),
- }
- }
+ // Cua Cloud has ended: the account's cloud claims are no longer
+ // listed (Fleet is never called); `include_cloud` is ignored.
+ let _ = include_cloud;
+ let warnings = Vec::new();
Ok(Listing {
sandboxes: out.into_values().collect(),
warnings,
@@ -1355,33 +1336,11 @@ impl Runtime {
self.inner.handles.lock().unwrap().remove(name);
}
- /// Reattaches every running named sandbox on a managed Fleet pool, so
- /// this (daemon) runtime renews their claims again after a restart.
- /// Returns the names held. Claims that expired meanwhile are skipped.
+ /// Reattached every running named sandbox on a managed Fleet pool after
+ /// a restart. Cua Cloud has ended: holds nothing.
pub async fn adopt_managed_fleet_sandboxes(&self) -> Vec<String> {
- if self.inner.fleet.is_none() {
- return vec![];
- }
- let mut held = vec![];
- for s in self.inner.sandboxes.state().list_all() {
- let cua_sandbox_core::SandboxState::Fleet(f) = s else {
- continue;
- };
- if !f
- .pool_name
- .starts_with(cua_fleet::autopool::AUTO_POOL_PREFIX)
- || f.status != "running"
- {
- continue;
- }
- match self.connect(&format!("cloud:{}", f.name)).await {
- Ok(_) => held.push(f.name),
- Err(e) => {
- tracing::info!(sandbox = %f.name, error = %e, "managed Fleet sandbox not reattached")
- }
- }
- }
- held
+ // Cua Cloud has ended: nothing to reattach, and Fleet is never called.
+ vec![]
}
/// Restarts.
diff --git a/libs/cua/crates/cua-sandbox-core/src/lib.rs b/libs/cua/crates/cua-sandbox-core/src/lib.rs
index 13646f4c9b..8481b2a9de 100644
--- a/libs/cua/crates/cua-sandbox-core/src/lib.rs
+++ b/libs/cua/crates/cua-sandbox-core/src/lib.rs
@@ -84,6 +84,12 @@ pub use sandbox::{
};
/// Why a cloud (Fleet) sandbox cannot have a GPU yet.
pub const FLEET_NO_GPU_REASON: &str = sandbox::FLEET_NO_GPU;
+
+/// The one "Cua Cloud has ended" message: every Cua Cloud (`on="cloud"`,
+/// `cloud:` refs, pools) entry point in the SDKs, the CLI, the MCP server and
+/// Spaces fails with it ([`Error::CloudEnded`]) instead of calling Fleet.
+pub const CLOUD_ENDED: &str = "Cua Cloud has ended; use a local sandbox or your own machine. \
+ See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended";
pub use state::{EphemeralLease, FleetState, LEASE_DIR, LocalState, SandboxState, StateStore};
/// Errors.
@@ -92,6 +98,10 @@ pub enum Error {
/// Bad input.
#[error("invalid argument: {0}")]
InvalidArgument(String),
+ /// Cua Cloud (`on="cloud"`, a `cloud:` sandbox, a pool) has ended
+ /// ([`CLOUD_ENDED`]). Use a local sandbox or your own machine.
+ #[error("{}", CLOUD_ENDED)]
+ CloudEnded,
/// A location, kind or runtime that does not exist, or a combination
/// of them (or with the image) that does not; the error lists the
/// valid values ([`placement::PlacementError::valid`]).
@@ -175,7 +185,7 @@ pub enum Error {
fn provider_not_configured(p: &ProviderKind) -> String {
match p {
- ProviderKind::Fleet => cua_fleet::MISSING_CREDENTIALS.into(),
+ ProviderKind::Fleet => CLOUD_ENDED.into(),
ProviderKind::Contrib => "no contrib provider is configured".into(),
other => format!("provider {other:?} is not configured"),
}
diff --git a/libs/cua/crates/cua-sandbox-core/src/placement.rs b/libs/cua/crates/cua-sandbox-core/src/placement.rs
index 1a101e3845..42a24b32f1 100644
--- a/libs/cua/crates/cua-sandbox-core/src/placement.rs
+++ b/libs/cua/crates/cua-sandbox-core/src/placement.rs
@@ -119,7 +119,7 @@ impl On {
return Ok(On::Provider(lower));
}
let hint = match lower.as_str() {
- "fleet" => " (the cloud location is `cloud`)".to_string(),
+ "fleet" => " (Cua Cloud has ended)".to_string(),
"docker" | "container" => {
" (`--on` says where it runs; use `--kind container`)".to_string()
}
@@ -532,9 +532,11 @@ pub fn provider(name: &str) -> Option<Capabilities> {
.cloned()
}
-/// Every location: `local`, `cloud`, then the registered providers.
+/// Every location: `local`, then the registered providers. Cua Cloud
+/// (`cloud`) has ended and is no longer listed; it still parses, and a
+/// create there fails with [`crate::CLOUD_ENDED`].
pub fn locations() -> Vec<Capabilities> {
- let mut v = vec![local_capabilities(), cloud_capabilities()];
+ let mut v = vec![local_capabilities()];
v.extend(
providers_lock()
.read()
@@ -1037,13 +1039,13 @@ mod tests {
("gvisor", "--runtime gvisor"),
("docker", "--kind container"),
("vm", "--kind vm"),
- ("fleet", "`cloud`"),
+ ("fleet", "Cua Cloud has ended"),
] {
let e = On::parse(word).unwrap_err();
assert_eq!(e.axis, Axis::On, "{word}");
assert!(e.message.contains(hint), "{word}: {}", e.message);
assert!(e.valid.contains(&"local".to_string()), "{word}");
- assert!(e.valid.contains(&"cloud".to_string()), "{word}");
+ assert!(!e.valid.contains(&"cloud".to_string()), "{word}");
}
assert!(
On::parse("direct:")
diff --git a/libs/cua/crates/cua-sandbox-core/src/sandbox.rs b/libs/cua/crates/cua-sandbox-core/src/sandbox.rs
index 588590a91a..254ac1190e 100644
--- a/libs/cua/crates/cua-sandbox-core/src/sandbox.rs
+++ b/libs/cua/crates/cua-sandbox-core/src/sandbox.rs
@@ -805,7 +805,11 @@ impl Lease {
}
struct Inner {
+ // Unused since Cua Cloud ended ([`Error::CloudEnded`]); removed with
+ // the Fleet provider.
+ #[allow(dead_code)]
fleet: Option<FleetClient>,
+ #[allow(dead_code)]
pools: Option<PoolManager>,
local: Option<Arc<dyn LocalRuntime>>,
/// Contrib and cloud providers by location word.
@@ -900,14 +904,9 @@ impl SandboxesBuilder {
/// Suspend, resume and restart of a cloud sandbox: Fleet has no per-claim
/// pause, stop or restart, and scaling the pool would touch every sandbox
/// in it.
-fn fleet_lifecycle_unsupported(op: &str) -> Error {
- Error::Unsupported {
- provider: ProviderKind::Fleet,
- op: format!(
- "{op} of a cloud sandbox (Fleet cannot suspend a single sandbox; hold it with \
- keep_alive, or delete it and create a new one)"
- ),
- }
+/// Lifecycle calls on a cloud sandbox: Cua Cloud has ended.
+fn fleet_lifecycle_unsupported(_op: &str) -> Error {
+ Error::CloudEnded
}
impl Sandboxes {
@@ -921,19 +920,16 @@ impl Sandboxes {
&self.inner.state
}
+ /// Cua Cloud has ended: every Fleet call fails with
+ /// [`Error::CloudEnded`] instead of reaching Fleet.
fn fleet(&self) -> Result<&FleetClient> {
- self.inner
- .fleet
- .as_ref()
- .ok_or(Error::ProviderNotConfigured(ProviderKind::Fleet))
+ Err(Error::CloudEnded)
}
- /// The managed-pool manager (Fleet only).
+ /// The managed-pool manager (Fleet only). Cua Cloud has ended: always
+ /// [`Error::CloudEnded`].
pub fn pools(&self) -> Result<&PoolManager> {
- self.inner
- .pools
- .as_ref()
- .ok_or(Error::ProviderNotConfigured(ProviderKind::Fleet))
+ Err(Error::CloudEnded)
}
/// The registered contrib provider `name`: [`crate::provider::not_built`]
@@ -1036,6 +1032,9 @@ impl Sandboxes {
pub async fn create(&self, mut options: CreateOptions) -> Result<Sandbox> {
use crate::progress::{Phase, Progress, report};
let started = Instant::now();
+ if options.provider == ProviderKind::Fleet {
+ return Err(Error::CloudEnded);
+ }
report(Progress::phase(Phase::Preparing).detail(&options.image));
options.apply_placement()?;
options.validate_sidecars()?;
@@ -1826,13 +1825,14 @@ impl Sandboxes {
.ok_or_else(|| Error::NotFound(name.into()))?;
match state {
SandboxState::Fleet(f) => {
+ // Cua Cloud has ended: fails here, before anything else.
+ let fleet = self.fleet()?;
if f.status == "suspended" {
return Err(Error::InvalidArgument(format!(
"sandbox {} is suspended; resume it first",
f.name
)));
}
- let fleet = self.fleet()?;
let bound = fleet.attach_claim(&f.pool_name, &f.name).await?;
// A claim on a managed pool has a TTL: keep it alive while
// this handle lives (dropping the handle detaches).
@@ -1942,10 +1942,7 @@ impl Sandboxes {
Some(_) => Err(Error::NotFound(r.to_string())),
None => self.connect(name).await,
},
- SandboxRef::Cloud { name, namespace } => match self.inner.state.load(name) {
- Some(SandboxState::Fleet(_)) => self.connect(name).await,
- _ => self.connect_cloud(name, namespace.as_deref()).await,
- },
+ SandboxRef::Cloud { .. } => Err(Error::CloudEnded),
SandboxRef::Direct { authority } => {
let named = self
.inner
@@ -1978,6 +1975,7 @@ impl Sandboxes {
/// it the claim is found across the account's pools. The handle holds
/// no lease: dropping it leaves the claim alone, `delete` releases it.
pub async fn connect_cloud(&self, name: &str, namespace: Option<&str>) -> Result<Sandbox> {
+ // Cua Cloud has ended: fails with [`Error::CloudEnded`].
let fleet = self.fleet()?;
let namespace = match namespace {
Some(ns) => ns.to_string(),
@@ -2099,7 +2097,7 @@ impl Sandboxes {
}
let mut known = extra;
known.extend(self.known_named().await?);
- if let (SandboxRef::Bare { name }, Some(fleet)) = (wanted, &self.inner.fleet) {
+ if let (SandboxRef::Bare { name }, Ok(fleet)) = (wanted, self.fleet()) {
match tokio::time::timeout(LOOKUP_CLOUD_TIMEOUT, fleet.find_claims(name)).await {
Ok(Ok(claims)) => known.extend(claims.into_iter().map(|c| {
(
@@ -2142,6 +2140,10 @@ impl Sandboxes {
let mut out: BTreeMap<String, SandboxInfo> = BTreeMap::new();
for s in self.inner.state.list_all() {
let provider = provider_of(&s);
+ // Cua Cloud has ended: old cloud records are left out.
+ if provider == ProviderKind::Fleet {
+ continue;
+ }
let id = state_ref(&s).to_string();
out.insert(
id.clone(),
@@ -2220,6 +2222,7 @@ impl Sandboxes {
pub async fn get(&self, name: &str) -> Result<SandboxInfo> {
let state = self.inner.state.load(name);
match &state {
+ Some(SandboxState::Fleet(_)) => Err(Error::CloudEnded),
Some(s) if contrib::contrib_of(s).is_some() => {
let (provider, id) = self.contrib_target(s)?;
let status = match provider.get(&id).await {
diff --git a/libs/cua/crates/cua-sandbox-core/src/settings.rs b/libs/cua/crates/cua-sandbox-core/src/settings.rs
index f5c04e77cd..82f53fa74e 100644
--- a/libs/cua/crates/cua-sandbox-core/src/settings.rs
+++ b/libs/cua/crates/cua-sandbox-core/src/settings.rs
@@ -41,7 +41,7 @@ pub const KEYS: [Key; 9] = [
name: "default.on",
env: "CUA_DEFAULT_ON",
default: "local",
- description: "where sandboxes run when --on / local= is not given (local, cloud, or a provider)",
+ description: "where sandboxes run when --on / local= is not given (local or a provider)",
},
Key {
name: "default.kind",
@@ -387,6 +387,9 @@ pub fn normalize(key: Key, value: &str) -> Result<String, SettingsError> {
Ok(match key.name {
"default.on" => {
let on = On::parse(v).map_err(bad)?;
+ if on == On::Cloud {
+ return Err(SettingsError(crate::CLOUD_ENDED.into()));
+ }
if on.is_existing_machine() {
return Err(SettingsError(format!(
"default.on: {on} names one machine; use local, cloud or a provider"
@@ -597,7 +600,7 @@ mod tests {
fn precedence() {
let d = tempfile::tempdir().unwrap();
let mut s = settings(d.path(), &[]);
- s.set(key("default.on").unwrap(), "cloud").unwrap();
+ s.set(key("default.on").unwrap(), "aws").unwrap();
s.set(key("default.kind").unwrap(), "vm").unwrap();
s.set(key("cloud.warm").unwrap(), "yes").unwrap();
@@ -606,12 +609,12 @@ mod tests {
let path = d.path().join("config.toml");
assert_eq!(
s.default_on().unwrap(),
- (On::Cloud, Source::Config(path.clone()))
+ (On::Provider("aws".into()), Source::Config(path.clone()))
);
assert_eq!(s.entry(key("cloud.warm").unwrap()).value, "true");
let text = std::fs::read_to_string(&path).unwrap();
assert!(
- text.contains("[default]") && text.contains("on = \"cloud\""),
+ text.contains("[default]") && text.contains("on = \"aws\""),
"{text}"
);
assert!(text.contains("warm = true"), "{text}");
@@ -655,10 +658,10 @@ mod tests {
fn set_validates_and_normalizes() {
let d = tempfile::tempdir().unwrap();
let mut s = settings(d.path(), &[]);
- assert_eq!(
- s.set(key("default.on").unwrap(), " Cloud ").unwrap(),
- "cloud"
- );
+ assert_eq!(s.set(key("default.on").unwrap(), " AWS ").unwrap(), "aws");
+ // Cua Cloud has ended: refused with the one message.
+ let e = s.set(key("default.on").unwrap(), "cloud").unwrap_err();
+ assert_eq!(e.0, crate::CLOUD_ENDED);
assert_eq!(
s.set(key("default.runtime").unwrap(), "runsc").unwrap(),
"gvisor"
diff --git a/libs/cua/crates/cua-sandbox-core/tests/cloud_ended.rs b/libs/cua/crates/cua-sandbox-core/tests/cloud_ended.rs
new file mode 100644
index 0000000000..37eb86fc26
--- /dev/null
+++ b/libs/cua/crates/cua-sandbox-core/tests/cloud_ended.rs
@@ -0,0 +1,48 @@
+//! Cua Cloud has ended: every cloud entry point fails with the one message
+//! (`CLOUD_ENDED`) and never reaches Fleet.
+
+use cua_sandbox_core::{CLOUD_ENDED, CreateOptions, Error, ProviderKind, SandboxRef, Sandboxes};
+
+fn sandboxes(dir: &std::path::Path) -> Sandboxes {
+ Sandboxes::builder().state_dir(dir).build()
+}
+
+#[tokio::test]
+async fn creating_in_the_cloud_fails_with_the_ended_message() {
+ let dir = tempfile::tempdir().unwrap();
+ let e = sandboxes(dir.path())
+ .create(CreateOptions::new(ProviderKind::Fleet, "linux"))
+ .await
+ .unwrap_err();
+ assert!(matches!(e, Error::CloudEnded), "{e:?}");
+ assert_eq!(e.to_string(), CLOUD_ENDED);
+}
+
+#[tokio::test]
+async fn an_old_cloud_record_is_not_listed_and_fails_by_name() {
+ let dir = tempfile::tempdir().unwrap();
+ let sbx = sandboxes(dir.path());
+ sbx.state().save_fleet_claim("old", "cua-auto-x").unwrap();
+ assert!(sbx.list().await.unwrap().iter().all(|i| i.name != "old"));
+ assert!(matches!(sbx.get("old").await, Err(Error::CloudEnded)));
+ assert!(matches!(sbx.connect("old").await, Err(Error::CloudEnded)));
+ assert!(matches!(sbx.delete("old").await, Err(Error::CloudEnded)));
+ assert!(matches!(sbx.suspend("old").await, Err(Error::CloudEnded)));
+ assert!(matches!(sbx.resume("old").await, Err(Error::CloudEnded)));
+ let r = SandboxRef::parse("cloud:old").unwrap();
+ assert!(matches!(sbx.connect_ref(&r).await, Err(Error::CloudEnded)));
+ assert!(matches!(
+ sbx.connect_cloud("other", None).await,
+ Err(Error::CloudEnded)
+ ));
+ assert!(matches!(sbx.pools(), Err(Error::CloudEnded)));
+}
+
+#[test]
+fn cloud_is_no_longer_a_listed_location() {
+ assert!(
+ cua_sandbox_core::placement::locations()
+ .iter()
+ .all(|c| c.name != "cloud")
+ );
+}
diff --git a/libs/cua/crates/cua-sandbox-core/tests/fleet_claim_token.rs b/libs/cua/crates/cua-sandbox-core/tests/fleet_claim_token.rs
index f0dba6ecc1..69d7fc69cb 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/fleet_claim_token.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/fleet_claim_token.rs
@@ -89,6 +89,7 @@ async fn claim_secrets_pool(o: &CreateOptions) -> String {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn cloud_sandboxes_deliver_their_spacesd_token_with_the_claim() {
// The published image carries only the pre-rename labels; the
// upcoming one `ai.cua.spacesd`. Both run the same token scripts.
diff --git a/libs/cua/crates/cua-sandbox-core/tests/image_info.rs b/libs/cua/crates/cua-sandbox-core/tests/image_info.rs
index 14ccc76953..14f3b2562b 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/image_info.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/image_info.rs
@@ -210,6 +210,7 @@ async fn unresolved_local_images_and_direct_urls_report_none() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_managed_claims_report_the_pinned_template_image() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
diff --git a/libs/cua/crates/cua-sandbox-core/tests/mcp.rs b/libs/cua/crates/cua-sandbox-core/tests/mcp.rs
index 0dcda0a609..3072a7857c 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/mcp.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/mcp.rs
@@ -286,6 +286,7 @@ async fn local_pipe_is_transparent() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_gateway_pipe_is_transparent() {
let dir = tempfile::tempdir().unwrap();
let (sb, _server) = fleet_sandbox(
@@ -366,6 +367,7 @@ async fn rmcp_over_a_local_service() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn rmcp_through_the_fleet_gateway() {
let dir = tempfile::tempdir().unwrap();
let (sb, _server) =
diff --git a/libs/cua/crates/cua-sandbox-core/tests/parity.rs b/libs/cua/crates/cua-sandbox-core/tests/parity.rs
index 4ba174b6c7..400ef4f59c 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/parity.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/parity.rs
@@ -195,6 +195,7 @@ async fn local_image_layers_build_locally_then_run_the_built_image() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn cloud_vm_images_carry_sidecars_addressed_by_name() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -223,6 +224,7 @@ async fn cloud_vm_images_carry_sidecars_addressed_by_name() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn reserved_names_and_bad_sidecars_fail_before_anything_starts() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -264,6 +266,7 @@ async fn reserved_names_and_bad_sidecars_fail_before_anything_starts() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn cloud_sidecars_and_private_images() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -299,6 +302,7 @@ async fn cloud_sidecars_and_private_images() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn canonical_images_start_warm_by_default_and_others_do_not() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -342,6 +346,7 @@ async fn canonical_images_start_warm_by_default_and_others_do_not() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn cloud_image_layers_build_remotely_then_run_the_built_image() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -384,6 +389,7 @@ async fn cloud_image_layers_build_remotely_then_run_the_built_image() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn network_none_reaches_the_local_runtime_and_the_cloud_refuses_it() {
assert_eq!(NetworkMode::parse("").unwrap(), NetworkMode::Default);
assert_eq!(NetworkMode::parse("Default").unwrap(), NetworkMode::Default);
diff --git a/libs/cua/crates/cua-sandbox-core/tests/pool_image_info.rs b/libs/cua/crates/cua-sandbox-core/tests/pool_image_info.rs
index 5558c27bb1..4135da87eb 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/pool_image_info.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/pool_image_info.rs
@@ -23,6 +23,7 @@ fn claim_opts(pool: &str) -> CreateOptions {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn named_pool_claims_report_the_template_image() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
diff --git a/libs/cua/crates/cua-sandbox-core/tests/power.rs b/libs/cua/crates/cua-sandbox-core/tests/power.rs
index 72ef2c82dd..baf9e4d35e 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/power.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/power.rs
@@ -222,10 +222,7 @@ async fn sandboxes_without_a_power_control_refuse_by_name() {
assert_eq!(sbx.power_control("claim"), None);
assert!(matches!(
sbx.power_on("claim").await,
- Err(Error::Unsupported {
- provider: ProviderKind::Fleet,
- ..
- })
+ Err(Error::CloudEnded)
));
// No such sandbox.
assert_eq!(sbx.power_control("nope"), None);
diff --git a/libs/cua/crates/cua-sandbox-core/tests/providers.rs b/libs/cua/crates/cua-sandbox-core/tests/providers.rs
index b7ee2ae364..b595684036 100644
--- a/libs/cua/crates/cua-sandbox-core/tests/providers.rs
+++ b/libs/cua/crates/cua-sandbox-core/tests/providers.rs
@@ -270,6 +270,7 @@ fn seed_template(fake: &FakeFleet, pool: &str, template: &str, vm: serde_json::V
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_pool_runs_locally_with_its_template() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -341,6 +342,7 @@ async fn fleet_pool_runs_locally_with_its_template() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_macos_template_is_unsupported_locally() {
let dir = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -769,6 +771,7 @@ fn fleet_fake() -> FakeFleet {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_claim_on_existing_pool_reports_template_services() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -791,6 +794,7 @@ async fn fleet_claim_on_existing_pool_reports_template_services() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_runtime_defaults_from_the_image_and_is_validated() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -869,6 +873,7 @@ fn never_ready(name: &str) -> CreateOptions {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_named_sandbox_that_fails_readiness_releases_its_claim() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -897,6 +902,7 @@ async fn fleet_named_sandbox_that_fails_readiness_releases_its_claim() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_named_sandbox_kept_on_failure_keeps_its_claim() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -926,6 +932,7 @@ async fn fleet_named_sandbox_kept_on_failure_keeps_its_claim() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_named_sandbox_lifecycle() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1087,6 +1094,7 @@ async fn fleet_named_sandbox_lifecycle() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_ephemeral_sandboxes_share_a_managed_pool_and_release_claims() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1149,6 +1157,7 @@ async fn fleet_ephemeral_sandboxes_share_a_managed_pool_and_release_claims() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_managed_detach_keeps_the_claim_and_windows_gets_efi() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1172,6 +1181,7 @@ async fn fleet_managed_detach_keeps_the_claim_and_windows_gets_efi() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_probe_timeout_releases_resources() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1198,6 +1208,7 @@ async fn fleet_probe_timeout_releases_resources() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_explicit_pool_keeps_its_semantics() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1232,6 +1243,7 @@ async fn fleet_explicit_pool_keeps_its_semantics() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_env_through_gateway_and_missing_env_service() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1461,7 +1473,7 @@ async fn unconfigured_providers() {
sbx.create(CreateOptions::new(ProviderKind::Fleet, IMAGE))
.await
.unwrap_err(),
- Error::ProviderNotConfigured(ProviderKind::Fleet)
+ Error::CloudEnded
));
assert!(matches!(
sbx.create(CreateOptions::new(ProviderKind::Local, IMAGE))
@@ -1529,6 +1541,7 @@ async fn local_command_env_and_named_service_probes() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_command_and_env_are_hashed_and_run_on_both_runtimes() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
@@ -1620,6 +1633,7 @@ async fn fleet_command_and_env_are_hashed_and_run_on_both_runtimes() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_named_pool_is_checked_against_the_given_fields_or_applied() {
let dir = tempfile::tempdir().unwrap();
let fake = fleet_fake();
diff --git a/libs/cua/crates/cua-sdk/src/native/config.rs b/libs/cua/crates/cua-sdk/src/native/config.rs
index 0c2ba60035..ab22f6b70e 100644
--- a/libs/cua/crates/cua-sdk/src/native/config.rs
+++ b/libs/cua/crates/cua-sdk/src/native/config.rs
@@ -158,8 +158,11 @@ mod tests {
fn set_get_unset_and_sources() {
let env = super::super::test_env::EnvGuard::isolated();
assert_eq!(config_get("default.on".into()).unwrap().value, "local");
- let e = config_set("default.on".into(), "cloud".into()).unwrap();
- assert_eq!((e.value.as_str(), e.source.as_str()), ("cloud", "config"));
+ let e = config_set("default.on".into(), "aws".into()).unwrap();
+ assert_eq!((e.value.as_str(), e.source.as_str()), ("aws", "config"));
+ // Cua Cloud has ended.
+ let e = config_set("default.on".into(), "cloud".into()).unwrap_err();
+ assert!(e.to_string().contains("Cua Cloud has ended"), "{e}");
env.set("CUA_DEFAULT_ON", "local");
let e = config_get("default.on".into()).unwrap();
assert_eq!((e.value.as_str(), e.source.as_str()), ("local", "env"));
@@ -180,14 +183,8 @@ mod tests {
let l = locations();
let local = l.iter().find(|l| l.name == "local").unwrap();
assert_eq!(local.runtimes["container"], ["gvisor", "runc"]);
- let cloud = l.iter().find(|l| l.name == "cloud").unwrap();
- assert_eq!(cloud.runtimes["vm"], ["kubevirt"]);
- check_placement("cloud".into(), "vm".into(), "".into()).unwrap();
- let e = check_placement("cloud".into(), "vm".into(), "gvisor".into()).unwrap_err();
- assert!(
- e.to_string().contains("valid runtime: auto, kubevirt"),
- "{e}"
- );
+ // Cua Cloud has ended: no longer listed.
+ assert!(!l.iter().any(|l| l.name == "cloud"));
check_placement("".into(), "".into(), "".into()).unwrap();
}
}
diff --git a/libs/cua/crates/cua-sdk/src/native/cua.rs b/libs/cua/crates/cua-sdk/src/native/cua.rs
index b63d071469..772b953649 100644
--- a/libs/cua/crates/cua-sdk/src/native/cua.rs
+++ b/libs/cua/crates/cua-sdk/src/native/cua.rs
@@ -373,6 +373,9 @@ impl Cua {
/// from this process with this SDK's credentials (in daemon mode, from
/// the environment).
pub fn fleet(&self) -> Result<Arc<Fleet>> {
+ // Cua Cloud has ended: fails with the "Cua Cloud has ended" message
+ // and never connects. (Doc comment unchanged: it is in the bindings.)
+ Err::<(), _>(CuaError::Unsupported(cua_sandbox_core::CLOUD_ENDED.into()))?;
let (client, pools) = match &self.backend {
Backend::Embedded(rt) => (rt.fleet()?.clone(), rt.pools()?.clone()),
Backend::Daemon(_) => {
diff --git a/libs/cua/crates/cua-sdk/src/native/sandbox.rs b/libs/cua/crates/cua-sdk/src/native/sandbox.rs
index f222b9ce1c..15499ce465 100644
--- a/libs/cua/crates/cua-sdk/src/native/sandbox.rs
+++ b/libs/cua/crates/cua-sdk/src/native/sandbox.rs
@@ -776,6 +776,9 @@ impl SandboxCreateOptions {
let r = settings
.resolve(on, kind, runtime)
.map_err(|e| CuaError::InvalidArgument(e.to_string()))?;
+ if r.on == On::Cloud {
+ return Err(CuaError::Unsupported(cua_sandbox_core::CLOUD_ENDED.into()));
+ }
cua_sandbox_core::placement::validate(&r.on, r.kind, &r.runtime).map_err(place)?;
Ok(r)
}
@@ -2167,24 +2170,27 @@ mod tests {
let r = o.to_request().unwrap();
assert_eq!(r.location.as_deref(), Some("local"));
assert_eq!(r.provider, Some(CoreProvider::Local));
- // Cloud options imply the cloud.
+ // Cloud options imply the cloud, and Cua Cloud has ended.
o.cloud = Some(CloudOptions::default());
- assert_eq!(o.placement().unwrap().on, On::Cloud);
- assert_eq!(o.to_request().unwrap().provider, Some(CoreProvider::Fleet));
+ let e = o.placement().unwrap_err();
+ assert_eq!(
+ e.to_string(),
+ format!("unsupported: {}", cua_sandbox_core::CLOUD_ENDED)
+ );
// ...and contradict an explicit local.
o.on = Some("local".into());
assert!(matches!(o.placement(), Err(CuaError::InvalidArgument(_))));
// A deprecated flat cloud field implies the cloud too.
let mut o = SandboxCreateOptions::auto("x");
o.warm = Some(true);
- assert_eq!(o.placement().unwrap().on, On::Cloud);
+ assert!(matches!(o.placement(), Err(CuaError::Unsupported(_))));
// direct:<addr> carries the address.
let o = SandboxCreateOptions::new("direct:127.0.0.1:3211", "");
let r = o.to_request().unwrap();
assert_eq!(r.url.as_deref(), Some("127.0.0.1:3211"));
assert_eq!(r.location.as_deref(), Some("direct:127.0.0.1:3211"));
// kind and runtime go out resolved.
- let mut o = SandboxCreateOptions::new("cloud", "img");
+ let mut o = SandboxCreateOptions::new("local", "img");
o.kind = Some("vm".into());
let p = o.placement().unwrap();
assert_eq!((p.kind, p.runtime), (Kind::Vm, Runtime::Auto));
@@ -2194,13 +2200,13 @@ mod tests {
#[test]
fn invalid_placements_are_typed_and_list_the_valid_values() {
let _env = super::super::test_env::EnvGuard::isolated();
- let mut o = SandboxCreateOptions::new("cloud", "img");
- o.runtime = Some("qemu".into());
+ let mut o = SandboxCreateOptions::new("local", "img");
+ o.runtime = Some("kubevirt".into());
let e = o.placement().unwrap_err();
let CuaError::InvalidPlacement(m) = &e else {
panic!("{e:?}")
};
- assert!(m.ends_with("valid runtime: auto, gvisor, kubevirt"), "{m}");
+ assert!(m.contains("valid runtime: auto"), "{m}");
assert_eq!(e.variant(), "InvalidPlacement");
let mut o = SandboxCreateOptions::new("local", "img");
o.kind = Some("container".into());
@@ -2219,20 +2225,23 @@ mod tests {
let mut s = cua_sandbox_core::settings::Settings::load().unwrap();
s.set(
cua_sandbox_core::settings::key("default.on").unwrap(),
- "cloud",
+ "aws",
)
.unwrap();
let o = SandboxCreateOptions::auto("img");
let p = o.placement().unwrap();
- assert_eq!(p.on, On::Cloud);
+ assert_eq!(p.on, On::Provider("aws".into()));
assert!(matches!(
p.on_source,
cua_sandbox_core::settings::Source::Config(_)
));
env.set("CUA_DEFAULT_ON", "local");
assert_eq!(o.placement().unwrap().on, On::Local);
+ let o = SandboxCreateOptions::new("local", "img");
+ assert_eq!(o.placement().unwrap().on, On::Local);
+ // Cua Cloud has ended.
let o = SandboxCreateOptions::new("cloud", "img");
- assert_eq!(o.placement().unwrap().on, On::Cloud);
+ assert!(matches!(o.placement(), Err(CuaError::Unsupported(_))));
}
#[test]
@@ -2243,7 +2252,7 @@ mod tests {
assert_eq!(r.provider, Some(CoreProvider::Contrib));
assert_eq!(r.location.as_deref(), Some("e2b"));
o.on = Some("cloud".into());
- assert_eq!(o.to_request().unwrap().provider, Some(CoreProvider::Fleet));
+ assert!(matches!(o.to_request(), Err(CuaError::Unsupported(_))));
o.on = Some("direct:127.0.0.1:3211".into());
assert_eq!(
o.to_request().unwrap().url.as_deref(),
@@ -2255,6 +2264,7 @@ mod tests {
}
#[test]
+ #[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
fn cloud_options_win_over_the_deprecated_flat_fields() {
let mut o = SandboxCreateOptions::new("cloud", "python:3.12-slim");
o.warm = Some(false);
@@ -2326,7 +2336,8 @@ pub struct SandboxRefParts {
/// includes that provider (see [`contrib_providers_built`]).
#[uniffi::export]
pub fn sandbox_locations() -> Vec<String> {
- let mut out: Vec<String> = ["local", "cloud"]
+ // Cua Cloud (`cloud`) has ended and is no longer offered.
+ let mut out: Vec<String> = ["local"]
.into_iter()
.chain(cua_sandbox_core::CONTRIB_LOCATIONS.iter().copied())
.map(str::to_string)
diff --git a/libs/cua/crates/cua-sdk/src/web/mod.rs b/libs/cua/crates/cua-sdk/src/web/mod.rs
index be366e8c20..eadfe0bdeb 100644
--- a/libs/cua/crates/cua-sdk/src/web/mod.rs
+++ b/libs/cua/crates/cua-sdk/src/web/mod.rs
@@ -24,6 +24,10 @@ use cua_proto::env::v1::{
};
use std::{collections::HashMap, sync::Arc};
+/// `cua_sandbox_core::CLOUD_ENDED` (that crate does not build for wasm32).
+const CLOUD_ENDED: &str = "Cua Cloud has ended; use a local sandbox or your own machine. \
+ See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended";
+
#[cfg(target_arch = "wasm32")]
mod fetch;
@@ -153,6 +157,9 @@ impl Cua {
/// Fleet control plane.
pub fn fleet(&self) -> Result<Arc<Fleet>> {
+ // Cua Cloud has ended: fails with the "Cua Cloud has ended" message
+ // and never connects.
+ Err::<(), _>(CuaError::Unsupported(CLOUD_ENDED.into()))?;
let f = self.config.fleet.clone().unwrap_or_default();
let token = f.token.filter(|t| !t.is_empty()).ok_or_else(|| {
CuaError::ProviderNotConfigured("the browser Fleet client needs a token".into())
diff --git a/libs/cua/crates/cua-sdk/tests/ffi_threads.rs b/libs/cua/crates/cua-sdk/tests/ffi_threads.rs
index dd3613b36c..095bba2857 100644
--- a/libs/cua/crates/cua-sdk/tests/ffi_threads.rs
+++ b/libs/cua/crates/cua-sdk/tests/ffi_threads.rs
@@ -21,8 +21,8 @@ use cua_daemon::{
};
use cua_fleet::testing::FakeFleet;
use cua_sdk::{
- Cua, CuaConfig, FleetPoolSpec, PresenceCursor, PresenceIdentity, PresencePoint,
- SandboxCreateOptions, SpacesdCommand, presence_now_ms,
+ Cua, CuaConfig, PresenceCursor, PresenceIdentity, PresencePoint, SandboxCreateOptions,
+ SpacesdCommand, presence_now_ms,
};
use std::{
collections::{BTreeMap, HashMap, HashSet},
@@ -236,42 +236,10 @@ async fn exercise(cua: Arc<Cua>, env_url: String, with_fleet: bool) {
.await
.unwrap();
- // ---- Fleet (client side; embedded holds the fake Fleet client)
+ // ---- Fleet: Cua Cloud has ended, so the client never connects.
if with_fleet {
- let fleet = cua.fleet().unwrap();
- // The runtime defaults from the image's manifest (a fixture here).
- cua_fleet::testing::set_image_variant(
- "registry.test/cua-e2e:fake",
- cua_fleet::ImageVariant::ContainerDisk,
- );
- fleet
- .apply_pool(FleetPoolSpec {
- name: POOL.into(),
- image: "registry.test/cua-e2e:fake".into(),
- runtime: None,
- replicas: None,
- cpu: None,
- memory_mb: None,
- services: HashMap::from([("env".to_string(), 3211)]),
- readiness_tcp_port: None,
- efi: false,
- command: None,
- ttl_seconds_after_created: None,
- })
- .await
- .unwrap();
- fleet.get_pool(POOL.into()).await.unwrap();
- fleet.list_pools(POOL.into()).await.unwrap();
- let claim = fleet
- .acquire(POOL.into(), Some(format!("{POOL}-c")), None)
- .await
- .unwrap();
- fleet.list_claims(POOL.into()).await.unwrap();
- fleet
- .keep_alive(POOL.into(), claim.claim.clone(), 600)
- .await
- .unwrap();
- fleet.release(POOL.into(), claim.claim).await.unwrap();
+ let e = cua.fleet().err().expect("Cua.fleet() fails");
+ assert!(e.to_string().contains("Cua Cloud has ended"), "{e}");
}
// ---- sandboxes (direct)
diff --git a/libs/cua/crates/cua-sdk/tests/fleet_billing.rs b/libs/cua/crates/cua-sdk/tests/fleet_billing.rs
index 26986539a3..c5890e1c66 100644
--- a/libs/cua/crates/cua-sdk/tests/fleet_billing.rs
+++ b/libs/cua/crates/cua-sdk/tests/fleet_billing.rs
@@ -21,6 +21,7 @@ fn cua(fake: &FakeFleet, dirs: &tempfile::TempDir) -> std::sync::Arc<Cua> {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn the_status_carries_the_credit_and_the_billing_page() {
let fake = FakeFleet::new();
fake.faults.lock().unwrap().billing = Some(json!({
@@ -41,6 +42,7 @@ async fn the_status_carries_the_credit_and_the_billing_page() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_cloud_create_out_of_credit_is_a_typed_error_with_the_billing_page() {
let fake = FakeFleet::new();
fake.faults.lock().unwrap().credit_exhausted = Some("https://run.cua.ai/billing".into());
diff --git a/libs/cua/crates/cua-sdk/tests/fleet_token_refresh.rs b/libs/cua/crates/cua-sdk/tests/fleet_token_refresh.rs
index c7d22abb77..b2904f7095 100644
--- a/libs/cua/crates/cua-sdk/tests/fleet_token_refresh.rs
+++ b/libs/cua/crates/cua-sdk/tests/fleet_token_refresh.rs
@@ -75,6 +75,7 @@ fn bearer(headers: &[(String, String)]) -> Option<&str> {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_held_cloud_spacesd_client_opens_media_with_a_fresh_fleet_bearer() {
let gw = fixtures::start_env(None, Some(fixtures::fake_gateway(POOL, POOL))).await;
let fake = FakeFleet::new();
diff --git a/libs/cua/crates/cua-sdk/tests/image_info.rs b/libs/cua/crates/cua-sdk/tests/image_info.rs
index 0789711f7a..8516e8751c 100644
--- a/libs/cua/crates/cua-sdk/tests/image_info.rs
+++ b/libs/cua/crates/cua-sdk/tests/image_info.rs
@@ -9,6 +9,7 @@ use cua_sdk::{CloudOptions, Cua, ImageInfo, SandboxCreateOptions};
use std::{sync::Arc, time::Duration};
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_managed_sandboxes_report_the_pinned_image_and_direct_ones_none() {
let fake = FakeFleet::new();
// The in-memory registry, not the fixtures' inspector (which sends
diff --git a/libs/cua/crates/cua-sdk/tests/listing.rs b/libs/cua/crates/cua-sdk/tests/listing.rs
index f19051290e..b49a02ac7d 100644
--- a/libs/cua/crates/cua-sdk/tests/listing.rs
+++ b/libs/cua/crates/cua-sdk/tests/listing.rs
@@ -28,22 +28,18 @@ async fn no_fleet_credentials_list_local_silently() {
let l = c.sandboxes().list_with_warnings(None).await.unwrap();
assert!(l.warnings.is_empty(), "{l:?}");
assert!(l.sandboxes.iter().all(|s| s.location != "cloud"));
- // Asking for cloud sandboxes only says why there are none.
+ // Cua Cloud has ended: asking for cloud sandboxes lists none, quietly.
let l = c
.sandboxes()
.list_with_warnings(Some("cloud".into()))
.await
.unwrap();
assert!(l.sandboxes.is_empty());
- assert!(
- l.warnings
- .iter()
- .any(|w| w.starts_with("cloud sandboxes not listed:")),
- "{l:?}"
- );
+ assert!(l.warnings.is_empty(), "{l:?}");
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn unreachable_fleet_is_a_warning_not_an_error() {
// A port nothing listens on.
let port = std::net::TcpListener::bind("127.0.0.1:0")
@@ -82,6 +78,7 @@ async fn unreachable_fleet_is_a_warning_not_an_error() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_hanging_fleet_is_cut_off_after_the_listing_timeout() {
// Accepts connections (the kernel backlog) and never answers.
let silent = std::net::TcpListener::bind("127.0.0.1:0").unwrap();
diff --git a/libs/cua/crates/cua-sdk/tests/mcp.rs b/libs/cua/crates/cua-sdk/tests/mcp.rs
index d93c237d1d..f0a8449e76 100644
--- a/libs/cua/crates/cua-sdk/tests/mcp.rs
+++ b/libs/cua/crates/cua-sdk/tests/mcp.rs
@@ -259,13 +259,12 @@ async fn suite(daemon: bool) {
assert_pipe(sb.service("env".into()).unwrap().endpoint().await.unwrap()).await;
sb.delete().await.unwrap();
- // Fleet, through the (emulated) gateway.
+ // Cua Cloud has ended: a cloud create fails before reaching Fleet.
let mut o = opts("cloud", CLAIM);
o.pool = Some(CLAIM.into());
o.image = IMAGE.into();
- let fsb = sbx.create(o).await.unwrap();
- exercise(&fsb.mcp("mcp".into(), None).await.unwrap()).await;
- fsb.delete().await.unwrap();
+ let e = sbx.create(o).await.err().expect("cloud create fails");
+ assert!(e.to_string().contains("Cua Cloud has ended"), "{e}");
exercise(
&cua_sdk::mcp_connect_url(format!("{}/mcp", mcp_server.url), None)
diff --git a/libs/cua/crates/cua-sdk/tests/refs.rs b/libs/cua/crates/cua-sdk/tests/refs.rs
index 2b74ae1cce..cb66b01913 100644
--- a/libs/cua/crates/cua-sdk/tests/refs.rs
+++ b/libs/cua/crates/cua-sdk/tests/refs.rs
@@ -298,6 +298,7 @@ async fn suite(daemon: bool) {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn embedded() {
tokio::time::timeout(Duration::from_secs(120), suite(false))
.await
@@ -305,6 +306,7 @@ async fn embedded() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn daemon() {
tokio::time::timeout(Duration::from_secs(120), suite(true))
.await
diff --git a/libs/cua/crates/cua-sdk/tests/topologies.rs b/libs/cua/crates/cua-sdk/tests/topologies.rs
index fba3c29000..0a56712521 100644
--- a/libs/cua/crates/cua-sdk/tests/topologies.rs
+++ b/libs/cua/crates/cua-sdk/tests/topologies.rs
@@ -26,7 +26,10 @@ const POOL: &str = "cua-e2e-gw";
struct World {
env: SpacesdFixture,
+ // Held for the test's lifetime; unused since Cua Cloud ended.
+ #[allow(dead_code)]
gw: SpacesdFixture,
+ #[allow(dead_code)]
fake: FakeFleet,
_dirs: tempfile::TempDir,
daemon: Option<DaemonHandle>,
@@ -468,244 +471,14 @@ async fn suite(t: Topology) {
);
// ----------------------------------------------------------- fleet
- // An explicit, user-owned pool (the gateway fixture knows its name).
- w.fake
- .client()
- .apply_pool(&cua_fleet::PoolSpec::new(
- POOL,
- "ghcr.io/trycua/cua-desktop-linux:test",
- ))
- .await
- .unwrap();
+ // Cua Cloud has ended: a cloud create fails before reaching Fleet, in
+ // every topology.
let mut o = direct("", POOL, None);
o.on = Some("cloud".into());
o.pool = Some(POOL.into());
o.image = "ghcr.io/trycua/cua-desktop-linux:test".into();
- let fsb = sbx.create(o).await.unwrap();
- assert_eq!(fsb.location(), "cloud");
- assert!(w.fake.exists("pool", POOL, POOL));
- let fenv = fsb.spacesd(Some(5_000)).await.unwrap();
- // Embedded: gRPC-Web through the gateway. Daemon: native gRPC to the
- // daemon, which speaks gRPC-Web upstream.
- let expected = if matches!(t, Topology::Embedded) {
- "grpc-web"
- } else {
- "grpc"
- };
- assert_eq!(fenv.transport(), expected);
- let out = fenv.run(cmd("echo", &["gw"])).await.unwrap();
- assert_eq!(out.stdout, b"gw\n");
- let spaces = cua.spaces();
- let direct_space = spaces
- .add(w.env.url.clone(), Some(TOKEN.into()), None)
- .await
- .unwrap();
- let mut cat = cmd("cat", &[]);
- cat.stdin = true;
- let p = spaces
- .space(direct_space.id.clone())
- .await
- .unwrap()
- .spacesd()
- .unwrap()
- .spawn(cat)
- .await
- .unwrap();
- p.write_stdin(b"over stdin".to_vec()).await.unwrap();
- p.close_stdin().await.unwrap();
- assert_eq!(p.wait().await.unwrap().stdout, b"over stdin");
- spaces.remove(direct_space.id).await.unwrap();
- let cloud_space = spaces
- .add(format!("cloud:{}", fsb.info().name), None, None)
- .await
- .unwrap();
- let cenv = spaces
- .space(cloud_space.id.clone())
- .await
- .unwrap()
- .spacesd()
- .unwrap();
- assert_eq!(
- cenv.run(cmd("echo", &["space"])).await.unwrap().stdout,
- b"space\n"
- );
- assert!(
- cenv.current_ws_headers()
- .await
- .unwrap()
- .iter()
- .any(|(k, _)| k == "authorization")
- );
- spaces.remove(cloud_space.id).await.unwrap();
- let svc = fsb.service("env".into()).unwrap();
- // Cloud: signed service URLs, no Fleet vocabulary outside the details.
- let signed = svc.url().await.unwrap();
- assert!(signed.starts_with("https://signed.fleet.test/"), "{signed}");
- assert_eq!(svc.url().await.unwrap(), signed, "reused until near expiry");
- let p = fsb.public_url("env".into(), Some(600), None).await.unwrap();
- // The same from the service handle.
- let sp = svc.public_url(Some(600), None).await.unwrap();
- assert!(sp.url.starts_with("https://signed.fleet.test/"), "{sp:?}");
- assert_eq!(sp.service, "env");
- assert!(p.url.starts_with("https://signed.fleet.test/"), "{p:?}");
- assert_eq!(p.service, "env");
- assert_eq!(
- p.provider_details.get("claim").map(String::as_str),
- Some(POOL)
- );
- let finfo = fsb.info();
- assert_eq!(finfo.location, "cloud");
- // Listing: the default includes live cloud claims; `Local` never does,
- // and `Fleet` lists only cloud ones.
- let all = sbx.list_with_warnings(None).await.unwrap();
- assert!(all.warnings.is_empty(), "{all:?}");
- assert!(
- all.sandboxes
- .iter()
- .any(|s| s.name == finfo.name && s.location == "cloud"),
- "{all:?}"
- );
- assert!(
- !sbx.list(Some("local".into()))
- .await
- .unwrap()
- .iter()
- .any(|s| s.location == "cloud")
- );
- let cloud = sbx.list(Some("cloud".into())).await.unwrap();
- assert!(cloud.iter().all(|s| s.location == "cloud") && !cloud.is_empty());
- // Deprecated alias.
- assert_eq!(sbx.list_all().await.unwrap().len(), all.sandboxes.len());
- assert_eq!(finfo.phase, cua_sdk::SandboxPhase::Ready);
- assert_eq!(
- finfo.provider_details.get("pool").map(String::as_str),
- Some(POOL)
- );
- let hdr = |n: &str, v: &str| cua_sdk::HttpHeader {
- name: n.into(),
- value: v.into(),
- };
- // Service requests go straight to the gateway (the pipe itself is
- // tested in tests/mcp.rs): the route carries the Fleet bearer and claim.
- let ep = svc.endpoint().await.unwrap();
- if matches!(t, Topology::Embedded) {
- assert!(ep.url.ends_with("-env"), "{ep:?}");
- assert!(
- ep.headers
- .iter()
- .any(|h| h.name == "x-cua-fleet-claim" && h.value == POOL)
- );
- } else {
- assert!(
- ep.url.ends_with("/v1/sandboxes/cloud:cua-e2e-gw/svc/env"),
- "daemon passthrough: {ep:?}"
- );
- }
- // The gateway owns authorization.
- assert!(matches!(
- svc.request(
- "GET".into(),
- "/status".into(),
- None,
- Some(5_000),
- Some(vec![hdr("authorization", "Bearer x")]),
- )
- .await,
- Err(CuaError::InvalidArgument(_))
- ));
- // Fleet media carries the Fleet bearer and claim upstream.
- let fsink = Arc::new(Collect::default());
- let fs = fenv
- .open_media(
- MediaOpenOptions {
- display: None,
- window_handle: None,
- max_fps: 0,
- max_dimension: 0,
- audio: false,
- disable_video: false,
- request_json: None,
- },
- fsink.clone(),
- )
- .await
- .unwrap();
- eventually("fleet frames", || fsink.frames.lock().unwrap().len() >= 2).await;
- fs.close().await.unwrap();
- {
- let m = w.gw.media.lock().unwrap();
- assert_eq!(
- m.last_authorization.as_deref(),
- Some("Bearer fake-fleet-token")
- );
- assert_eq!(m.last_claim.as_deref(), Some(POOL));
- }
- fsb.delete().await.unwrap();
- assert!(
- !w.fake.exists("claim", POOL, POOL),
- "claim released on delete"
- );
- assert!(w.fake.exists("pool", POOL, POOL), "explicit pools stay");
-
- // Managed pool (no `pool`): same API in every topology; the runtime
- // (in daemon mode, the daemon) holds the claim and its heartbeat.
- let mut o = direct("", "", None);
- o.on = Some("cloud".into());
- o.name = None;
- o.image = "ghcr.io/trycua/cua-desktop-linux:test".into();
- // The runtime defaults from the image's manifest (a fixture here).
- cua_fleet::testing::set_image_variant(&o.image, cua_fleet::ImageVariant::ContainerDisk);
- o.warm = Some(true);
- o.max_pool_size = Some(3);
- o.fleet_ttl_seconds = Some(120);
- let msb = sbx.create(o).await.unwrap();
- assert!(msb.is_ephemeral());
- let managed: Vec<String> = w
- .fake
- .all_namespaces()
- .into_iter()
- .filter(|n| n.starts_with("cua-auto-"))
- .collect();
- assert_eq!(managed.len(), 1, "{managed:?}");
- let mp = &managed[0];
- let pool = w.fake.object("pool", mp, mp).unwrap();
- assert_eq!(pool["spec"]["replicas"], 1);
- assert_eq!(pool["spec"]["autoscaling"]["maxPoolSize"], 3);
- let claims = w.fake.names("claim", mp);
- assert_eq!(claims.len(), 1);
- let claim = w.fake.object("claim", mp, &claims[0]).unwrap();
- assert_eq!(claim["spec"]["ttlSecondsAfterCreated"], 120);
- msb.delete().await.unwrap();
- assert!(w.fake.names("claim", mp).is_empty(), "claim released");
- assert!(w.fake.exists("pool", mp, mp), "managed pool kept for reuse");
-
- // Fleet's per-account size cap refuses a bigger sandbox: the caller
- // gets the typed denial with Fleet's own message, in every topology.
- w.fake.faults.lock().unwrap().size_cap = Some((8, 32 * 1024));
- let mut big = direct("", "", None);
- big.on = Some("cloud".into());
- big.name = None;
- big.image = "ghcr.io/trycua/cua-desktop-linux:test".into();
- big.cpus = Some(16);
- big.memory_mb = Some(64 * 1024);
- match sbx.create(big).await {
- Err(CuaError::FleetAdmissionDenied(m)) => {
- assert!(m.contains(cua_fleet::testing::SIZE_LIMIT_MESSAGE), "{m}");
- }
- Err(e) => panic!("{t:?}: expected FleetAdmissionDenied, got {e:?}"),
- Ok(_) => panic!("{t:?}: a 16 vCPU sandbox was admitted over the size cap"),
- }
- w.fake.faults.lock().unwrap().size_cap = None;
- if matches!(t, Topology::Embedded) {
- let pools = cua.fleet().unwrap().pools();
- let listed = pools.list().await.unwrap();
- assert_eq!(listed.len(), 1);
- assert_eq!(&listed[0].name, mp);
- assert!(listed[0].managed);
- let r = pools.gc(Some(0)).await.unwrap();
- assert_eq!(r.deleted_pools, vec![mp.clone()]);
- assert!(!w.fake.exists("pool", mp, mp));
- }
+ let e = sbx.create(o).await.err().expect("cloud create fails");
+ assert!(e.to_string().contains("Cua Cloud has ended"), "{t:?}: {e}");
// ---------------------------------------------------------- errors
assert!(matches!(
diff --git a/libs/cua/crates/cua-spaces-contract/src/lib.rs b/libs/cua/crates/cua-spaces-contract/src/lib.rs
index 45ca2d01a4..f4975d6d5e 100644
--- a/libs/cua/crates/cua-spaces-contract/src/lib.rs
+++ b/libs/cua/crates/cua-spaces-contract/src/lib.rs
@@ -362,18 +362,18 @@ pub const ERROR_KINDS: &[ErrorKind] = &[
},
ErrorKind {
kind: "fleet",
- meaning: "The Fleet control plane failed a cloud Space call.",
- fix: "See the Fleet errors reference for the HTTP status in the message.",
+ meaning: "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The Fleet control plane failed a cloud Space call.",
+ fix: "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.",
},
ErrorKind {
kind: "fleet_admission_denied",
- meaning: "Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit. The message is Fleet's and names the limit.",
- fix: "Pick a size within the limit the message names (most accounts run 1-8 vCPUs and 1-32 GiB), or contact Cua support to raise the account's limits.",
+ meaning: "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit.",
+ fix: "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.",
},
ErrorKind {
kind: "cloud_credit_exhausted",
- meaning: "The account is out of Cua Cloud credit (no credit left, and no card or plan): Fleet refused the new cloud Space. Running Spaces keep running; local Spaces are never affected. The message ends with the billing page's URL.",
- fix: "Add credit on the billing page the message names (a plan, or a card for pay as you go), or create the Space locally.",
+ meaning: "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The account was out of Cua Cloud credit and Fleet refused the new cloud Space.",
+ fix: "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended.",
},
ErrorKind {
kind: "invalid_placement",
@@ -679,7 +679,7 @@ pub fn tools() -> Vec<Tool> {
"ambiguous_host",
"limit_exceeded",
],
- instructions: "Creates a new sandbox where `on` says (local: this machine, free; cloud: Cua cloud, metered; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:<name> or cloud:<name>. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on=\"host:<machine>\" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example \"spin up 2 macOS Spaces on my spare Mac mini\" is on=\"host:spare mac mini\", image=\"macos\", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on=\"host:<id>\"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:<machine> with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on=\"direct:<addr>\" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.",
+ instructions: "Creates a new sandbox where `on` says (local: this machine, free; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:<name>. Cua Cloud (on=\"cloud\") has ended and fails with an error that says so. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on=\"host:<machine>\" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example \"spin up 2 macOS Spaces on my spare Mac mini\" is on=\"host:spare mac mini\", image=\"macos\", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on=\"host:<id>\"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:<machine> with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on=\"direct:<addr>\" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.",
providers: &CREATE_PROVIDERS,
metering: Metering::Cloud,
capabilities: &["space.create"],
diff --git a/libs/cua/crates/cua-spaces-ffi/tests/fleet_billing_app.rs b/libs/cua/crates/cua-spaces-ffi/tests/fleet_billing_app.rs
index 532225a4ae..7b85c07dab 100644
--- a/libs/cua/crates/cua-spaces-ffi/tests/fleet_billing_app.rs
+++ b/libs/cua/crates/cua-spaces-ffi/tests/fleet_billing_app.rs
@@ -25,6 +25,7 @@ fn cua(fake: &FakeFleet, dirs: &tempfile::TempDir) -> std::sync::Arc<Cua> {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn the_status_carries_the_credit_and_the_billing_page() {
let fake = FakeFleet::new();
fake.faults.lock().unwrap().billing = Some(json!({
@@ -52,6 +53,7 @@ async fn the_status_carries_the_credit_and_the_billing_page() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_cloud_create_out_of_credit_is_a_typed_error_with_the_billing_page() {
let fake = FakeFleet::new();
fake.faults.lock().unwrap().credit_exhausted = Some("https://run.cua.ai/billing".into());
diff --git a/libs/cua/crates/cua-spaces/src/spaces.rs b/libs/cua/crates/cua-spaces/src/spaces.rs
index 280adc14e4..1a98d7d060 100644
--- a/libs/cua/crates/cua-spaces/src/spaces.rs
+++ b/libs/cua/crates/cua-spaces/src/spaces.rs
@@ -734,13 +734,10 @@ impl Spaces {
&self.inner.namespace
}
+ /// Cua Cloud has ended: every cloud Space call fails with
+ /// [`cua_sandbox_core::CLOUD_ENDED`] instead of reaching Fleet.
fn fleet_client(&self) -> Result<&FleetClient> {
- self.inner.fleet.as_ref().ok_or_else(|| {
- Error::host(
- cua_spaces_contract::host::FLEET,
- "set CUA_CLIENT_ID/CUA_CLIENT_SECRET (or CUA_TOKEN) to use cloud Spaces",
- )
- })
+ Err(cua_sandbox_core::Error::CloudEnded.into())
}
// ------------------------------------------------------------ registry
@@ -2117,6 +2114,9 @@ impl Spaces {
.0
}
};
+ if on == On::Cloud {
+ return Err(cua_sandbox_core::Error::CloudEnded.into());
+ }
let create_id = opts.create_id.clone().filter(|c| !c.trim().is_empty());
// A name in the SDK's own form counts as generated: an app that
// shows the name before creating picks it the same way
diff --git a/libs/cua/crates/cua-spaces/tests/cancel.rs b/libs/cua/crates/cua-spaces/tests/cancel.rs
index 78dfdab8dd..16856494f7 100644
--- a/libs/cua/crates/cua-spaces/tests/cancel.rs
+++ b/libs/cua/crates/cua-spaces/tests/cancel.rs
@@ -306,6 +306,7 @@ async fn a_cancel_after_a_restart_undoes_the_journal() {
/// A cloud create cancelled while its claim waits to bind releases the
/// claim it made.
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_cancelled_cloud_create_releases_its_claim() {
let reg = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
diff --git a/libs/cua/crates/cua-spaces/tests/cloud_ended.rs b/libs/cua/crates/cua-spaces/tests/cloud_ended.rs
new file mode 100644
index 0000000000..a5d025788d
--- /dev/null
+++ b/libs/cua/crates/cua-spaces/tests/cloud_ended.rs
@@ -0,0 +1,20 @@
+//! Cua Cloud has ended: `create_space(on="cloud")` fails with the one
+//! message and never reaches Fleet.
+
+use cua_sandbox_core::placement::On;
+use cua_spaces::{SpaceCreate, Spaces};
+
+#[tokio::test]
+async fn creating_a_cloud_space_fails_with_the_ended_message() {
+ let home = tempfile::tempdir().unwrap();
+ let spaces = Spaces::builder().home(home.path()).build();
+ let e = spaces
+ .create(SpaceCreate {
+ on: Some(On::Cloud),
+ image: Some("linux".into()),
+ ..Default::default()
+ })
+ .await
+ .expect_err("a cloud create fails");
+ assert_eq!(e.to_string(), cua_sandbox_core::CLOUD_ENDED);
+}
diff --git a/libs/cua/crates/cua-spaces/tests/generic.rs b/libs/cua/crates/cua-spaces/tests/generic.rs
index cac430535c..99e32d0623 100644
--- a/libs/cua/crates/cua-spaces/tests/generic.rs
+++ b/libs/cua/crates/cua-spaces/tests/generic.rs
@@ -375,6 +375,7 @@ async fn an_spacesd_space_also_reaches_its_declared_services() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn claim_fleet_plain_image_is_ready_without_spacesd() {
{
let reg = tempfile::tempdir().unwrap();
@@ -449,6 +450,7 @@ async fn claim_fleet_plain_image_is_ready_without_spacesd() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_env_and_commands_run_on_both_runtimes() {
let reg = tempfile::tempdir().unwrap();
let fleet = FakeFleet::new();
diff --git a/libs/cua/crates/cua-spaces/tests/providers.rs b/libs/cua/crates/cua-spaces/tests/providers.rs
index 6e68969885..b4216570d7 100644
--- a/libs/cua/crates/cua-spaces/tests/providers.rs
+++ b/libs/cua/crates/cua-spaces/tests/providers.rs
@@ -19,6 +19,7 @@ use std::time::Duration;
const IMAGE: &str = "ghcr.io/trycua/linux:24.04-disk";
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn create_in_the_cloud_binds_connects_through_the_gateway_and_registers() {
let reg = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -166,6 +167,7 @@ async fn create_in_the_cloud_binds_connects_through_the_gateway_and_registers()
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_runtime_image_mismatch_is_refused_before_any_request() {
let reg = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -193,6 +195,7 @@ async fn a_runtime_image_mismatch_is_refused_before_any_request() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn fleet_tools_without_credentials_name_the_missing_host_capability() {
let reg = tempfile::tempdir().unwrap();
let spaces = Spaces::builder().home(reg.path()).build();
@@ -760,6 +763,7 @@ async fn a_stopped_local_space_deletes() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_cloud_space_gets_the_size_asked_for_within_the_absolute_ceiling() {
let reg = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
@@ -865,6 +869,7 @@ async fn a_cloud_space_gets_the_size_asked_for_within_the_absolute_ceiling() {
}
#[tokio::test]
+#[ignore = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"]
async fn a_cloud_space_out_of_credit_fails_typed_and_leaves_local_alone() {
let reg = tempfile::tempdir().unwrap();
let fake = FakeFleet::new();
diff --git a/libs/cua/crates/cua-telemetry/src/events.rs b/libs/cua/crates/cua-telemetry/src/events.rs
index 3d4fffd7cd..9895711985 100644
--- a/libs/cua/crates/cua-telemetry/src/events.rs
+++ b/libs/cua/crates/cua-telemetry/src/events.rs
@@ -153,6 +153,11 @@ pub fn location(on: &str) -> &'static str {
.next()
.unwrap_or("")
.to_ascii_lowercase();
+ // Cua Cloud has ended: an attempt there reports `other`. `cloud` stays
+ // in the schema for the events recorded before.
+ if word == "cloud" {
+ return "other";
+ }
pick(schema::LOCATIONS, &word, "other")
}
diff --git a/libs/cua/crates/cua-telemetry/src/schema.rs b/libs/cua/crates/cua-telemetry/src/schema.rs
index ff241efab7..8aab946428 100644
--- a/libs/cua/crates/cua-telemetry/src/schema.rs
+++ b/libs/cua/crates/cua-telemetry/src/schema.rs
@@ -198,6 +198,7 @@ pub const DURATIONS: &[&str] = &[
];
pub const UPTIMES: &[&str] = &["lt_1h", "1_5h", "6_23h", "1_6d", "gte_7d"];
pub const COUNTS: &[&str] = &["0", "1", "2_4", "5_9", "10_49", "50_99", "gte_100"];
+// `cloud` (Cua Cloud, ended) is only in events recorded before cua 0.4.2.
pub const LOCATIONS: &[&str] = &[
"local", "cloud", "direct", "relay", "e2b", "daytona", "modal", "other",
];
diff --git a/libs/cua/crates/cua-telemetry/tests/privacy.rs b/libs/cua/crates/cua-telemetry/tests/privacy.rs
index 26c37d65e5..adf211f62c 100644
--- a/libs/cua/crates/cua-telemetry/tests/privacy.rs
+++ b/libs/cua/crates/cua-telemetry/tests/privacy.rs
@@ -975,7 +975,8 @@ fn activation_builders_keep_vocabulary_and_coarsen_the_rest() {
assert_eq!(e.props["failed_phase"], "other");
assert_eq!(e.props["error_kind"], "other");
assert_eq!(e.props["time_bucket"], "gte_30m");
- assert_eq!(e.props["location"], "cloud");
+ // Cua Cloud has ended: never reported as `cloud` any more.
+ assert_eq!(e.props["location"], "other");
assert_eq!(e.props["gpu"], true);
let disk = events::space_create(
&events::SpaceCreate {
@@ -1088,7 +1089,7 @@ fn activation_builders_keep_vocabulary_and_coarsen_the_rest() {
let s = events::space_create_started("cloud", "windows", "vm", true);
assert_eq!(
(&s.props["location"], &s.props["gpu"]),
- (&serde_json::json!("cloud"), &serde_json::json!(true))
+ (&serde_json::json!("other"), &serde_json::json!(true))
);
let v = events::volume_setup(
&events::VolumeSetup {
diff --git a/libs/cua/python/tests/test_facade.py b/libs/cua/python/tests/test_facade.py
index a3c01f862e..f5410002e9 100644
--- a/libs/cua/python/tests/test_facade.py
+++ b/libs/cua/python/tests/test_facade.py
@@ -83,8 +83,9 @@ def test_listing_and_lookup_use_refs(tmp_path):
async def go():
sbx = c.sandboxes()
- # A cloud ref needs Fleet; a bare name searches what is configured.
- with pytest.raises(cua.CuaError.ProviderNotConfigured):
+ # A cloud ref parses, but Cua Cloud has ended; a bare name searches
+ # what is configured.
+ with pytest.raises(cua.CuaError.Unsupported, match="Cua Cloud has ended"):
await sbx.get("cloud:nope")
with pytest.raises(cua.CuaError.NotFound):
await sbx.get("nope")
diff --git a/libs/cua/python/tests/test_live_fleet.py b/libs/cua/python/tests/test_live_fleet.py
index 951075de9e..e656cb220a 100644
--- a/libs/cua/python/tests/test_live_fleet.py
+++ b/libs/cua/python/tests/test_live_fleet.py
@@ -1,7 +1,8 @@
-"""Live Fleet smoke through the Python binding. Gated: set CUA_E2E_FLEET=1
-and CUA_CLIENT_ID/CUA_CLIENT_SECRET (or FLEETS_TOKEN). Creates an
-ephemeral `cua-e2e-*` pool, claims it, calls the `server` service and
-deletes everything in `finally`."""
+"""Live Fleet smoke through the Python binding. Skipped: Cua Cloud has ended
+(CUA-1854), so `fleet()` fails; removed with the Fleet provider. It was gated
+on CUA_E2E_FLEET=1 and CUA_CLIENT_ID/CUA_CLIENT_SECRET (or FLEETS_TOKEN),
+created an ephemeral `cua-e2e-*` pool, claimed it, called the `server`
+service and deleted everything in `finally`."""
from __future__ import annotations
@@ -18,8 +19,8 @@ IMAGE = os.environ.get(
"public.ecr.aws/k5j5w0x5/cua-ubuntu-24.04:docker-main-809e3f81",
)
-pytestmark = pytest.mark.skipif(
- os.environ.get("CUA_E2E_FLEET") != "1", reason="set CUA_E2E_FLEET=1 for live Fleet"
+pytestmark = pytest.mark.skip(
+ reason="Cua Cloud has ended (CUA-1854); removed with the Fleet provider"
)
diff --git a/libs/cua/python/tests/test_smoke.py b/libs/cua/python/tests/test_smoke.py
index 7cfa94bed8..d1826fb1f2 100644
--- a/libs/cua/python/tests/test_smoke.py
+++ b/libs/cua/python/tests/test_smoke.py
@@ -108,7 +108,7 @@ async def exercise(c: cua.Cua, fx: dict) -> None:
listing = await sbx.list_with_warnings(None)
rows = {s.name: s for s in listing.sandboxes}
assert rows["py-direct"].location == "direct"
- assert listing.warnings == [] # no Fleet credentials: no cloud, silently
+ assert listing.warnings == [] # Cua Cloud has ended: no cloud, silently
# Local only: a direct URL is not local.
assert "py-direct" not in [s.name for s in await sbx.list("local")]
await sb.delete()
@@ -128,6 +128,42 @@ def test_embedded(fixtures, tmp_path):
run(exercise(c, fixtures))
+def _assert_cloud_ended(info):
+ """Cua Cloud has ended (CUA-1854): the one message, as `Unsupported`."""
+ assert isinstance(info.value, cua.CuaError.Unsupported)
+ assert "Cua Cloud has ended" in str(info.value)
+
+
+def test_cloud_creates_fail_with_the_cloud_ended_error(fixtures, tmp_path):
+ # Even with Fleet credentials (the fake API), nothing reaches Fleet.
+ c = cua.embedded(
+ state_dir=str(tmp_path / "sbx"),
+ fleet_from_env=False,
+ fleet=cua.FleetSettings(base_url=fixtures["fleet_base_url"], token=fixtures["fleet_token"]),
+ )
+
+ with pytest.raises(cua.CuaError.Unsupported) as info:
+ c.fleet()
+ _assert_cloud_ended(info)
+
+ async def body():
+ sbx = c.sandboxes()
+ for opts in (
+ cua.SandboxCreateOptions(on="cloud", image="img:test", kind="vm"),
+ cua.SandboxCreateOptions(image="img:test", warm=True),
+ cua.SandboxCreateOptions(image="img:test", cloud=cua.CloudOptions()),
+ ):
+ with pytest.raises(cua.CuaError.Unsupported) as info:
+ await sbx.create(opts)
+ _assert_cloud_ended(info)
+ # Nothing was created, and cloud is not a listed location.
+ assert (await sbx.list_with_warnings("cloud")).sandboxes == []
+ assert "cloud" not in cua.sandbox_locations()
+
+ run(body())
+
+
[email protected](reason="Cua Cloud has ended (CUA-1854); removed with the Fleet provider")
def test_embedded_fleet_through_fake_api(fixtures, tmp_path):
c = cua.embedded(
state_dir=str(tmp_path / "sbx"),
@@ -157,10 +193,11 @@ def test_embedded_fleet_through_fake_api(fixtures, tmp_path):
run(body())
-def test_unconfigured_fleet_is_a_typed_error(tmp_path):
+def test_fleet_fails_with_the_cloud_ended_error(tmp_path):
c = cua.embedded(state_dir=str(tmp_path), fleet_from_env=False)
- with pytest.raises(cua.CuaError.ProviderNotConfigured):
+ with pytest.raises(cua.CuaError.Unsupported) as info:
c.fleet()
+ _assert_cloud_ended(info)
@pytest.mark.skipif(os.name == "nt", reason="Unix socket")
diff --git a/libs/cua/spaces-contract/manifest.json b/libs/cua/spaces-contract/manifest.json
index 15f430e9c2..a54347e7c5 100644
--- a/libs/cua/spaces-contract/manifest.json
+++ b/libs/cua/spaces-contract/manifest.json
@@ -170,18 +170,18 @@
},
{
"kind": "fleet",
- "meaning": "The Fleet control plane failed a cloud Space call.",
- "fix": "See the Fleet errors reference for the HTTP status in the message."
+ "meaning": "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The Fleet control plane failed a cloud Space call.",
+ "fix": "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended."
},
{
"kind": "fleet_admission_denied",
- "meaning": "Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit. The message is Fleet's and names the limit.",
- "fix": "Pick a size within the limit the message names (most accounts run 1-8 vCPUs and 1-32 GiB), or contact Cua support to raise the account's limits."
+ "meaning": "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). Fleet's admission refused the cloud Space: a size over this account's limits, or a template its policy does not admit.",
+ "fix": "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended."
},
{
"kind": "cloud_credit_exhausted",
- "meaning": "The account is out of Cua Cloud credit (no credit left, and no card or plan): Fleet refused the new cloud Space. Running Spaces keep running; local Spaces are never affected. The message ends with the billing page's URL.",
- "fix": "Add credit on the billing page the message names (a plan, or a card for pay as you go), or create the Space locally."
+ "meaning": "Retired: no longer returned since Cua Cloud ended (cua 0.4.2). The account was out of Cua Cloud credit and Fleet refused the new cloud Space.",
+ "fix": "Create the Space locally or on one of your machines; see https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended."
},
{
"kind": "invalid_placement",
@@ -401,7 +401,7 @@
"name": "create_space",
"category": "lifecycle",
"description": "Create a Space: a new sandbox on this machine, on one of your machines, or in the cloud.",
- "instructions": "Creates a new sandbox where `on` says (local: this machine, free; cloud: Cua cloud, metered; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:<name> or cloud:<name>. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on=\"host:<machine>\" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example \"spin up 2 macOS Spaces on my spare Mac mini\" is on=\"host:spare mac mini\", image=\"macos\", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on=\"host:<id>\"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:<machine> with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on=\"direct:<addr>\" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.",
+ "instructions": "Creates a new sandbox where `on` says (local: this machine, free; aws, gcp or modal: the user's own cloud account, connected with cloud_connect, billed there; default: the user's default location, else local), waits until it is ready (its spacesd when the image runs one, else its declared services), and registers it as local:<name>. Cua Cloud (on=\"cloud\") has ended and fails with an error that says so. `kind` (auto, container, vm) and `runtime` (auto, or an engine the location offers for the kind) are chosen automatically by default: the canonical Linux image runs as a gVisor container, macOS images as Lume VMs, Windows and disk-only images as VMs (QEMU locally, KubeVirt in the cloud). An impossible combination fails with invalid_placement and lists the valid values. Any image works; without cua-spacesd the capability set is empty. reuse=true returns a reachable registered Space in the same location with the requested services instead of creating one. On the user's own machines: on=\"host:<machine>\" creates the Space on a machine set up with `cua host setup --provide-spaces` (for example \"spin up 2 macOS Spaces on my spare Mac mini\" is on=\"host:spare mac mini\", image=\"macos\", count=2). The machine is matched by id, exact name, or the words of its name; when several fit equally the call fails with ambiguous_host listing them (ask the user which, then pass on=\"host:<id>\"). The host runs it with its own runtimes (Lume for macOS VMs on a Mac, Docker for Linux), the Space joins the relay and is returned as relay:<machine> with `host` set. A Mac runs at most two macOS VMs (Apple's macOS license, enforced by Apple Virtualization); a host at a limit fails with limit_exceeded. Only the machine's owner and the accounts it is shared with as editors can create there, from an enrolled device. on=\"direct:<addr>\" is not accepted here: a direct address is one already-running Space, attached with add_space, not a host this call can create on.",
"platforms": [
"macos",
"windows",
diff --git a/libs/cua/swift/Tests/CuaTests/PoolTests.swift b/libs/cua/swift/Tests/CuaTests/PoolTests.swift
index e2c93a2cb2..e80fbf3670 100644
--- a/libs/cua/swift/Tests/CuaTests/PoolTests.swift
+++ b/libs/cua/swift/Tests/CuaTests/PoolTests.swift
@@ -1,5 +1,6 @@
-// The shared sandbox model (SandboxSpec + PoolOptions) and the one pool
-// writer against the fixtures' fake Fleet (loopback only).
+// The shared sandbox model (SandboxSpec + PoolOptions). The one pool writer
+// needed a Fleet; Cua Cloud has ended, so `fleet()` fails and that test is
+// disabled until it is removed with the Fleet provider.
import Foundation
import Testing
@@ -32,7 +33,19 @@ import Testing
#expect(CuaError.NotFound(message: "x").ambiguousCandidates.isEmpty)
}
- @Test(.enabled(if: Fixtures.binary() != nil, "cua-test-fixtures is not built"))
+ @Test func fleetFailsBecauseCuaCloudHasEnded() throws {
+ let dir = FileManager.default.temporaryDirectory
+ .appendingPathComponent("cua-swift-pool-\(UUID().uuidString)")
+ let cua = try Cua.embedded(stateDir: dir.path, fleetFromEnv: false)
+ do {
+ _ = try cua.fleet()
+ Issue.record("expected Unsupported (Cua Cloud has ended)")
+ } catch CuaError.Unsupported(let message) {
+ #expect(message.contains("Cua Cloud has ended"))
+ }
+ }
+
+ @Test(.disabled("Cua Cloud has ended (CUA-1854); removed with the Fleet provider"))
func applyMismatchReconcileExport() async throws {
let fx = try #require(try Fixtures.start())
defer { fx.stop() }
diff --git a/libs/cua/swift/Tests/CuaTests/SmokeTests.swift b/libs/cua/swift/Tests/CuaTests/SmokeTests.swift
index c4031f77eb..63ecc3f344 100644
--- a/libs/cua/swift/Tests/CuaTests/SmokeTests.swift
+++ b/libs/cua/swift/Tests/CuaTests/SmokeTests.swift
@@ -79,10 +79,13 @@ struct Fixtures {
.appendingPathComponent("cua-swift-\(UUID().uuidString)")
let cua = try Cua.embedded(stateDir: dir.path, fleetFromEnv: false)
#expect(cua.mode() == .embedded)
+ // Cua Cloud has ended: `fleet()` fails with the one message, as
+ // `Unsupported`, and never connects.
do {
_ = try cua.fleet()
- Issue.record("expected ProviderNotConfigured")
- } catch CuaError.ProviderNotConfigured {
+ Issue.record("expected Unsupported (Cua Cloud has ended)")
+ } catch CuaError.Unsupported(let message) {
+ #expect(message.contains("Cua Cloud has ended"))
}
}
diff --git a/libs/cua/typescript/test/browser.test.mjs b/libs/cua/typescript/test/browser.test.mjs
index 231bb51b1b..ff27ce92ff 100644
--- a/libs/cua/typescript/test/browser.test.mjs
+++ b/libs/cua/typescript/test/browser.test.mjs
@@ -41,6 +41,11 @@ test(
await assert.rejects(cua.spacesd(fx.env_url, "wrong"), (e) =>
sdk.CuaError.Unauthenticated.instanceOf(e),
)
- assert.throws(() => cua.fleet(), (e) => sdk.CuaError.ProviderNotConfigured.instanceOf(e))
+ // Cua Cloud has ended: the browser Fleet client never connects.
+ assert.throws(() => cua.fleet(), (e) => {
+ assert.ok(sdk.CuaError.Unsupported.instanceOf(e), String(e))
+ assert.match(e.message, /Cua Cloud has ended/)
+ return true
+ })
},
)
diff --git a/libs/cua/typescript/test/pool.test.mjs b/libs/cua/typescript/test/pool.test.mjs
index 6c322e7556..7fe010c011 100644
--- a/libs/cua/typescript/test/pool.test.mjs
+++ b/libs/cua/typescript/test/pool.test.mjs
@@ -1,6 +1,7 @@
-// The shared sandbox model (SandboxSpec + PoolOptions) and the one pool
-// writer against the fixtures' fake Fleet: apply, the named-pool mismatch
-// check (a typed error with a diff), template reconcile and Terraform export.
+// The shared sandbox model (SandboxSpec + PoolOptions). The one pool writer
+// (apply, the named-pool mismatch check, template reconcile, Terraform
+// export) needed a Fleet; Cua Cloud has ended, so `fleet()` fails and that
+// test is skipped until it is removed with the Fleet provider.
import assert from "node:assert/strict"
import { mkdtempSync } from "node:fs"
import { tmpdir } from "node:os"
@@ -8,7 +9,7 @@ import { join } from "node:path"
import { after, before, test } from "node:test"
import * as cua from "../dist/index.js"
-import { binary, startFixtures } from "./fixtures.mjs"
+import { startFixtures } from "./fixtures.mjs"
let fx
before(async () => {
@@ -40,7 +41,19 @@ test("sandboxSpec / poolOptions build the native records", () => {
assert.equal(cua.fleetGenerateClaimToken().length, 64)
})
-test("Pool.apply, checkPoolSpec, applyPoolTemplate and exportPool on the fake Fleet", { skip: !binary("CUA_TEST_FIXTURES", "cua-test-fixtures") }, async () => {
+test("fleet() fails with the cloud-ended error, so there is no pool writer", () => {
+ const c = cua.embedded({
+ stateDir: join(mkdtempSync(join(tmpdir(), "cua-ts-pool-")), "sandboxes"),
+ fleetFromEnv: false,
+ })
+ assert.throws(() => c.fleet(), (e) => {
+ assert.ok(cua.CuaError.Unsupported.instanceOf(e), String(e))
+ assert.match(e.message, /Cua Cloud has ended/)
+ return true
+ })
+})
+
+test("Pool.apply, checkPoolSpec, applyPoolTemplate and exportPool on the fake Fleet", { skip: "Cua Cloud has ended (CUA-1854); removed with the Fleet provider" }, async () => {
const c = cua.embedded({
stateDir: join(mkdtempSync(join(tmpdir(), "cua-ts-pool-")), "sandboxes"),
fleetFromEnv: false,
diff --git a/libs/cua/typescript/test/refs.test.mjs b/libs/cua/typescript/test/refs.test.mjs
index 40e1ad55f7..b3d6b7a070 100644
--- a/libs/cua/typescript/test/refs.test.mjs
+++ b/libs/cua/typescript/test/refs.test.mjs
@@ -1,6 +1,7 @@
// Unified sandbox refs through the native binding: parse, narrow, the typed
-// ambiguity error, and a lookup against an embedded runtime with no Fleet
-// credentials (temp state; nothing reaches a cloud or the host).
+// ambiguity error, and lookups against an embedded runtime (temp state;
+// nothing reaches a cloud or the host). A `cloud:` ref parses, but looking
+// it up fails: Cua Cloud has ended.
import assert from "node:assert/strict"
import { mkdtempSync } from "node:fs"
import { tmpdir } from "node:os"
@@ -51,6 +52,10 @@ test("lookups take refs", async () => {
})
const sbx = c.sandboxes()
await assert.rejects(sbx.get("nope"), (e) => cua.CuaError.NotFound.instanceOf(e))
- await assert.rejects(sbx.get("cloud:nope"), (e) => cua.CuaError.ProviderNotConfigured.instanceOf(e))
+ await assert.rejects(sbx.get("cloud:nope"), (e) => {
+ assert.ok(cua.CuaError.Unsupported.instanceOf(e), String(e))
+ assert.match(e.message, /Cua Cloud has ended/)
+ return true
+ })
await assert.rejects(sbx.get("moon:x"), (e) => cua.CuaError.InvalidArgument.instanceOf(e))
})
diff --git a/libs/cua/typescript/test/smoke.test.mjs b/libs/cua/typescript/test/smoke.test.mjs
index 6d31e1f3fc..d477bf671c 100644
--- a/libs/cua/typescript/test/smoke.test.mjs
+++ b/libs/cua/typescript/test/smoke.test.mjs
@@ -101,7 +101,16 @@ test("embedded", { skip: !binary("CUA_TEST_FIXTURES", "cua-test-fixtures") }, as
await exercise(c)
})
-test("managed Fleet pools through the fake API", { skip: !binary("CUA_TEST_FIXTURES", "cua-test-fixtures") }, async () => {
+// Cua Cloud has ended (CUA-1854): `fleet()` and every `on: "cloud"` create
+// fail with the one "Cua Cloud has ended" message, and never reach Fleet.
+const CLOUD_REMOVED = "Cua Cloud has ended (CUA-1854); removed with the Fleet provider"
+const cloudEnded = (e) => {
+ assert.ok(cua.CuaError.Unsupported.instanceOf(e), String(e))
+ assert.match(e.message, /Cua Cloud has ended/)
+ return true
+}
+
+test("managed Fleet pools through the fake API", { skip: CLOUD_REMOVED }, async () => {
const dir = mkdtempSync(join(tmpdir(), "cua-ts-"))
const c = cua.embedded({
stateDir: join(dir, "sandboxes"),
@@ -149,9 +158,44 @@ test("managed Fleet pools through the fake API", { skip: !binary("CUA_TEST_FIXTU
assert.deepEqual(await pools.list(), [])
})
-test("unconfigured fleet is a typed error", () => {
- const c = cua.embedded({ stateDir: mkdtempSync(join(tmpdir(), "cua-ts-")), fleetFromEnv: false })
- assert.throws(() => c.fleet(), (e) => cua.CuaError.ProviderNotConfigured.instanceOf(e))
+test("cloud creates fail with the cloud-ended error, even with Fleet credentials", { skip: !binary("CUA_TEST_FIXTURES", "cua-test-fixtures") }, async () => {
+ const dir = mkdtempSync(join(tmpdir(), "cua-ts-"))
+ const c = cua.embedded({
+ stateDir: join(dir, "sandboxes"),
+ fleetFromEnv: false,
+ fleet: cua.FleetSettings.create({ baseUrl: fx.fleet_base_url, token: fx.fleet_token }),
+ })
+ // A digest-pinned image: nothing resolves tags against a registry.
+ const image = "ghcr.io/trycua/cua-e2e-ts@sha256:0123"
+ const sbx = c.sandboxes()
+ await assert.rejects(
+ sbx.create(cua.SandboxCreateOptions.create({ on: "cloud", image, kind: "vm", warm: true, maxPoolSize: 3 })),
+ cloudEnded,
+ )
+ // Cloud options imply the cloud too.
+ await assert.rejects(
+ sbx.create(cua.SandboxCreateOptions.create({ image, warm: true })),
+ cloudEnded,
+ )
+ await assert.rejects(
+ sbx.create(cua.SandboxCreateOptions.create({ image, cloud: cua.CloudOptions.create({}) })),
+ cloudEnded,
+ )
+ // Nothing was created, and cloud is not a listed location.
+ assert.deepEqual((await sbx.listWithWarnings("cloud")).sandboxes, [])
+ assert.ok(!cua.sandboxLocations().includes("cloud"))
+})
+
+test("fleet() fails with the cloud-ended error, with or without credentials", () => {
+ const bare = cua.embedded({ stateDir: mkdtempSync(join(tmpdir(), "cua-ts-")), fleetFromEnv: false })
+ assert.throws(() => bare.fleet(), cloudEnded)
+ if (!fx?.fleet_base_url) return
+ const configured = cua.embedded({
+ stateDir: mkdtempSync(join(tmpdir(), "cua-ts-")),
+ fleetFromEnv: false,
+ fleet: cua.FleetSettings.create({ baseUrl: fx.fleet_base_url, token: fx.fleet_token }),
+ })
+ assert.throws(() => configured.fleet(), cloudEnded)
})
test(
diff --git a/libs/python/cua-sandbox/README.md b/libs/python/cua-sandbox/README.md
index 98ba415bfc..2e20e36afe 100644
--- a/libs/python/cua-sandbox/README.md
+++ b/libs/python/cua-sandbox/README.md
@@ -2,7 +2,7 @@
Sandboxed VM and container environments with a unified Python API. A thin
wrapper over the [cua SDK](../../cua/README.md) (`cua>=0.2.0`, Rust core), which
-handles Fleet claims, local runtimes and the spacesd client.
+handles local runtimes and the spacesd client.
```bash
pip install --extra-index-url https://wheels.cua.ai/simple cua-sandbox
@@ -15,7 +15,7 @@ plane (claims, spacesd, local runtimes) goes through the `cua` SDK.
| Backend | Implementation |
|---|---|
-| Fleet (cloud) | `cua` SDK |
+| Cua Cloud (Fleet) | Ended: raises `CloudEnded` |
| Local containers (Docker/Podman, gVisor when available), QEMU, Lume | `cua` SDK (cua-vmm), zero pre-setup |
| Direct: any reachable cua-spacesd | `Sandbox.connect(url=..., token=...)` |
| Tart, Hyper-V, Android emulator, OSWorld | Legacy Python adapters |
@@ -64,23 +64,23 @@ Shell, files, terminals and the other Sandbox interfaces are unaffected.
See the [wire contract](../../cua-driver/docs/mcp-envelope-carrier.md) for limits.
-## Any image, local or cloud
+## Any image, locally
-The same code runs locally and in the cloud. Three separate choices, each
-optional:
+Cua Cloud has ended; use a local sandbox or your own machine. Three separate
+choices, each optional:
-- `on`: `"local"` or `"cloud"` (`local=True`/`False` is the same switch).
+- `on`: `"local"` (`on="cloud"` and `local=False` raise: Cua Cloud has ended).
- `kind`: `"auto"`, `"container"` or `"vm"`.
- `runtime`: the engine. `"auto"`, or locally `gvisor`/`runc` (containers)
- and `qemu`/`lume` (VMs); in the cloud `gvisor` and `kubevirt`. A combination
+ and `qemu`/`lume` (VMs). A combination
that does not exist raises `InvalidPlacement`, listing the valid values.
Unset values come from `CUA_DEFAULT_ON`/`CUA_DEFAULT_KIND`/`CUA_DEFAULT_RUNTIME`,
-then `~/.cua/config.toml` (`cua config set default.on cloud`), then
+then `~/.cua/config.toml`, then
`local`/`auto`/`auto`.
```python
-from cua_sandbox import CloudOptions, Image, Sandbox, http
+from cua_sandbox import Image, Sandbox, http
async with Sandbox.ephemeral(
Image.from_registry("python:3.12-slim"),
@@ -88,8 +88,7 @@ async with Sandbox.ephemeral(
env={"FOO": "bar"},
services={"web": 8000}, # named guest ports
wait_for=http("web", "/"), # or tcp("web"), or a list
- on="cloud", # or "local"; unset: your default
- cloud=CloudOptions(warm=True), # cloud-only options
+ on="local", # the default
) as sb:
r = await sb.service("web").request("GET", "/")
url = await sb.service("web").url() # usable from this machine
@@ -260,19 +259,6 @@ unless you pass `local=False`. The `cua_sandbox.localhost` module, `Localhost`,
and the `computer_server`, `http`, `local` and `websocket` transports are
removed; control the local machine with cua-driver instead.
-## Cloud credentials
-
-The cloud backend is Cua Fleet at `https://run.cua.ai` (override with
-`configure(fleet_base_url=...)` or `CUA_FLEET_BASE_URL`). Sign in with
-`cua auth login`, or set `CUA_CLIENT_ID` and `CUA_CLIENT_SECRET`. The cloud runs
-amd64 images, does not support snapshots or custom disks, and currently
-supports only `us-east-1`.
-
-A cloud sandbox outlives a crashed process by at most `claim_ttl` (15 minutes
-by default); `await sb.keep_alive(minutes=120)` holds it longer. The first
-start of an image can take a few minutes; `CloudOptions(warm=True)` keeps one
-ready (the default for the canonical images).
-
## Guest services and cua-spacesd
Sandboxes are daemon-agnostic: readiness is the provider's "running" plus your
@@ -281,68 +267,4 @@ Sandboxes are daemon-agnostic: readiness is the provider's "running" plus your
the image has it and raise `SpacesdNotAvailable` otherwise. `await sb.spacesd()`
returns the SDK's typed `SpacesdClient` and is optional.
-## Advanced: dedicated capacity
-
-By default a cloud sandbox comes from shared capacity the SDK manages per image
-and shape. To own a named, sized pool, apply one and claim from it with
-`CloudOptions(pool=...)`. Supplying a pool never changes its configuration.
-
-```python
-from cua_sandbox import CloudOptions, Image, Pool, Sandbox
-
-pool = await Pool.apply(
- Image.linux(),
- name="desktop-workspace",
- replicas=1,
- cpu=4,
- memory_mb=4096,
- services={"env": 3211, "web": 8080},
-)
-
-sb = await Sandbox.create(cloud=CloudOptions(pool="desktop-workspace"), name="workflow-123")
-reference = sb.to_dict()
-await sb.disconnect() # the claim remains held
-
-# A later process re-resolves the live claim.
-sb = await Sandbox.from_dict(reference)
-await sb.keep_alive(minutes=30)
-await sb.close() # idempotently releases the claim
-```
-
-`Pool.claim()` is also awaitable and an async context manager:
-
-```python
-async with pool.claim(name="job-123") as sb:
- await sb.shell.run("echo hello")
-```
-
-A pool can scale with claim demand instead of a static `replicas` count:
-
-```python
-from cua_sandbox import Image, Pool, WarmPoolAutoscaling
-
-pool = await Pool.apply(
- Image.linux(),
- name="desktop-workspace",
- cpu=4,
- memory_mb=4096,
- autoscaling=WarmPoolAutoscaling(min_pool_size=0, initial_pool_size=2, max_pool_size=10),
-)
-```
-
-- Pool names are globally unique across accounts; a name owned by another
- account raises `PoolAccessDeniedError`.
-- A pool's runtime follows the image: a container rootfs runs on gVisor, a
- containerDisk (`kind="vm"`) on KubeVirt. Pass `runtime=` to `Pool.apply`, or
- `Sandbox.create(..., on="cloud", runtime=...)`, to choose; a mismatch raises
- before anything is created.
-- Shared-capacity limits: `CloudOptions(max_pool_size=..., claim_ttl=...)`, or
- `CUA_FLEET_MAX_POOL_SIZE`, `CUA_FLEET_CLAIM_TTL`, `CUA_FLEET_WARM` and
- `CUA_FLEET_POOL_IDLE_GC` (`off` disables automatic GC).
-- The flat `pool=`, `warm=`, `max_pool_size=` and `claim_ttl=` keywords still
- work and warn; pass them in `cloud=`.
-- `Pool.reconcile(CreatePoolRequest(...))` and
- `Template.reconcile(CreateTemplateRequest(...))` remain for generated-schema
- configuration.
-
-Cua Cloud (Fleets) ended on 16 October 2026; see [Cua Cloud (Fleets) has ended](https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended).
+Cua Cloud has ended; see [Cua Cloud has ended](https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended). `on="cloud"`, `local=False`, `CloudOptions`, `Pool` and `cua_sandbox.pools` now raise that error.
diff --git a/libs/python/cua-sandbox/cua_sandbox/_ended.py b/libs/python/cua-sandbox/cua_sandbox/_ended.py
new file mode 100644
index 0000000000..b0d1a68f4f
--- /dev/null
+++ b/libs/python/cua-sandbox/cua_sandbox/_ended.py
@@ -0,0 +1,21 @@
+"""Cua Cloud has ended: the one message every cloud entry point raises."""
+
+from cua_sandbox._sdk import Unsupported
+
+CLOUD_ENDED = (
+ "Cua Cloud has ended; use a local sandbox or your own machine. "
+ "See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended"
+)
+
+
+class CloudEnded(Unsupported):
+ """Raised by every Cua Cloud (Fleet-backed ``on="cloud"``) entry point.
+ A ``NotImplementedError``, like the other unsupported operations."""
+
+ def __init__(self) -> None:
+ super().__init__(CLOUD_ENDED)
+
+
+def cloud_ended() -> CloudEnded:
+ """The exception to ``raise`` at a cloud entry point."""
+ return CloudEnded()
diff --git a/libs/python/cua-sandbox/cua_sandbox/_placement.py b/libs/python/cua-sandbox/cua_sandbox/_placement.py
index e9cf664a8a..b24e6ade5e 100644
--- a/libs/python/cua-sandbox/cua_sandbox/_placement.py
+++ b/libs/python/cua-sandbox/cua_sandbox/_placement.py
@@ -26,6 +26,7 @@ import warnings
from dataclasses import dataclass
from typing import Any, Optional
+from cua_sandbox._ended import CloudEnded
from cua_sandbox._sdk import InvalidArgument, InvalidPlacement, Unsupported
logger = logging.getLogger(__name__)
@@ -171,9 +172,7 @@ def _notice() -> None:
if quiet not in ("1", "true", "yes", "on"):
# Logged from cua_sandbox.sandbox, where users filter it.
logging.getLogger("cua_sandbox.sandbox").warning(
- "defaulting to a local sandbox; pass local=False (or on='cloud') for cloud, "
- "or make it the default with `cua config set default.on cloud` "
- "(CUA_QUIET_DEFAULT=1 hides this notice)"
+ "defaulting to a local sandbox (CUA_QUIET_DEFAULT=1 hides this notice)"
)
@@ -258,6 +257,9 @@ def resolve(
check("local", explicit_kind, None)
return Placement(where, source, origin, explicit_kind or image_kind, None, legacy)
+ if where.partition(":")[0] in ("cloud", "fleet"):
+ raise CloudEnded()
+
# Validate what was asked for before defaults fill the rest.
check(where, explicit_kind, engine)
if where not in LOCATIONS:
diff --git a/libs/python/cua-sandbox/cua_sandbox/_refs.py b/libs/python/cua-sandbox/cua_sandbox/_refs.py
index 39a9024d89..e74109b350 100644
--- a/libs/python/cua-sandbox/cua_sandbox/_refs.py
+++ b/libs/python/cua-sandbox/cua_sandbox/_refs.py
@@ -9,11 +9,11 @@ unique (else :class:`AmbiguousSandbox`). Parsing is the Rust core's
from __future__ import annotations
-import asyncio
import logging
from dataclasses import dataclass
from typing import Callable, Optional
+from cua_sandbox._ended import CloudEnded
from cua_sandbox._sdk import InvalidArgument, Unsupported
logger = logging.getLogger(__name__)
@@ -89,18 +89,8 @@ async def _cloud_has(name: str) -> bool:
"""Whether the account has a live cloud sandbox (Fleet claim) ``name``.
Only asked when cloud credentials can be read without the OS keychain;
bounded, and a failing cloud answers "no"."""
- from cua_sandbox._config import has_fleet_auth, may_have_fleet_session
-
- if not (has_fleet_auth() or may_have_fleet_session()):
- return False
- from cua_sandbox import _autopool
-
- try:
- claims = await asyncio.wait_for(_autopool.list_claims(), timeout=LOOKUP_CLOUD_TIMEOUT)
- except Exception as error: # noqa: BLE001 - the lookup never fails on the cloud
- logger.debug("cloud sandboxes not searched for %r: %s", name, error)
- return False
- return any(getattr(c, "name", None) == name for c in claims)
+ # Cua Cloud has ended (CUA-1854): there is nothing to search.
+ return False
async def resolve(
@@ -118,7 +108,7 @@ async def resolve(
if ref.location == "local":
return ref.name, True, None
if ref.location == "cloud":
- return ref.name, False, None
+ raise CloudEnded()
if ref.location == "direct":
return ref.name, None, f"http://{ref.name}"
if ref.location == "relay":
diff --git a/libs/python/cua-sandbox/cua_sandbox/pool.py b/libs/python/cua-sandbox/cua_sandbox/pool.py
index cc66e19116..47834c581f 100644
--- a/libs/python/cua-sandbox/cua_sandbox/pool.py
+++ b/libs/python/cua-sandbox/cua_sandbox/pool.py
@@ -7,6 +7,7 @@ import warnings
from dataclasses import replace
from typing import Any, Callable, Coroutine, Generic, Optional, TypeVar, cast
+from cua_sandbox._ended import CloudEnded
from cua_sandbox._sdk import ENV_SERVICE
from cua_sandbox.image import Image
from cua_sandbox.sandbox import Sandbox
@@ -149,6 +150,7 @@ class Template:
@classmethod
async def reconcile(cls, request: CreateTemplateRequest) -> "Template":
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
if not isinstance(request, CreateTemplateRequest):
raise TypeError("Template.reconcile requires a CreateTemplateRequest")
client = _FleetClient()
@@ -338,6 +340,7 @@ class Pool:
@classmethod
async def reconcile(cls, request: CreatePoolRequest) -> "Pool":
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
if not isinstance(request, CreatePoolRequest):
raise TypeError("Pool.reconcile requires a CreatePoolRequest")
client = _FleetClient()
@@ -355,6 +358,7 @@ class Pool:
@classmethod
async def get(cls, name: str) -> "Pool":
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
client = _FleetClient()
try:
return cls(await client.get_pool(name))
@@ -379,6 +383,7 @@ class Pool:
runtime=...)`` still works and is converted to the new one, with a
``DeprecationWarning``.
"""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
if (args and isinstance(args[0], Image)) or "image" in kwargs:
warnings.warn(
"Pool.apply(image, name=..., ...) is deprecated; use "
@@ -482,6 +487,7 @@ class Pool:
whose ``spec`` / ``options`` are the native records), or with
``terraform=True`` the equivalent Terraform ``fleets_pool`` block
(attributes the provider lacks yet are commented)."""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
exported = await call_native(native_fleet().export_pool(name))
if terraform:
return cast(str, exported.terraform)
@@ -498,6 +504,7 @@ class Pool:
"""Raise :class:`~cua_sandbox.PoolSpecMismatch` (with a readable diff)
when the set fields of ``spec`` differ from pool ``name``'s
template."""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
await call_native(native_fleet().check_pool_spec(name, spec.native()))
@staticmethod
@@ -505,6 +512,7 @@ class Pool:
"""Lay the set fields of ``spec`` over pool ``name``'s template and
write it (the pool's capacity is kept; a no-op when nothing
differs)."""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
await call_native(native_fleet().apply_pool_template(name, spec.native()))
async def _claim_with_token(
@@ -544,6 +552,7 @@ class Pool:
async def delete(self) -> None:
"""Delete this Fleet pool."""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
client = _FleetClient()
try:
await client.delete_pool(self._resource)
@@ -578,6 +587,7 @@ class Pool:
name: str | None = None,
ttl_seconds_after_created: int | None = None,
) -> _ClaimHandle:
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
spec = self._claim_spec(spec, ttl_seconds_after_created)
request = CreateClaimRequest(pool=self._resource, spec=spec, name=name)
client = _FleetClient()
@@ -611,6 +621,7 @@ class Pool:
spec must set ``claim_secrets=True``. The claim waits (at most 90 s
after it binds) until the sandbox has it, else it is released and
:class:`~cua_sandbox.ClaimSecretsNotDelivered` is raised."""
+ raise CloudEnded() # Cua Cloud has ended (CUA-1854)
claim_agent_type = agent_type or self._agent_type
service = claim_service_for(claim_agent_type, service)
if claim_token is not None:
diff --git a/libs/python/cua-sandbox/cua_sandbox/pools.py b/libs/python/cua-sandbox/cua_sandbox/pools.py
index 3ac56c2fd3..b541977156 100644
--- a/libs/python/cua-sandbox/cua_sandbox/pools.py
+++ b/libs/python/cua-sandbox/cua_sandbox/pools.py
@@ -1,27 +1,35 @@
-"""Managed Fleet pools: list them and garbage-collect them.
+"""Managed Fleet pools: Cua Cloud has ended (CUA-1854).
-``Sandbox.ephemeral(image, local=False)`` claims sandboxes from this
-account's managed pools (``cua-auto-*``), one per image spec, created on
-first use and scaled to zero when idle. Idle pools are deleted automatically
-after ``CUA_FLEET_POOL_IDLE_GC``; these calls inspect them or collect now.
-
- from cua_sandbox import pools
-
- for pool in await pools.list_pools():
- print(pool.name, pool.claims, pool.last_used)
- report = await pools.gc(idle_after=1800)
+Every call raises :class:`~cua_sandbox._ended.CloudEnded`; the module goes
+away in the next minor release.
"""
+from typing import Any
+
from cua_sandbox._autopool import (
ClaimInfo,
GcReport,
ManagedPoolInfo,
- gc,
- gc_pools,
is_managed_pool_name,
- list_claims,
- list_pools,
)
+from cua_sandbox._ended import CloudEnded
+
+
+async def list_pools(*args: Any, **kwargs: Any) -> list[ManagedPoolInfo]:
+ raise CloudEnded()
+
+
+async def list_claims(*args: Any, **kwargs: Any) -> list[ClaimInfo]:
+ raise CloudEnded()
+
+
+async def gc(*args: Any, **kwargs: Any) -> GcReport:
+ raise CloudEnded()
+
+
+async def gc_pools(*args: Any, **kwargs: Any) -> GcReport:
+ raise CloudEnded()
+
__all__ = [
"ClaimInfo",
diff --git a/libs/python/cua-sandbox/cua_sandbox/sandbox.py b/libs/python/cua-sandbox/cua_sandbox/sandbox.py
index ff1da252d5..fc5e2f7f3b 100644
--- a/libs/python/cua-sandbox/cua_sandbox/sandbox.py
+++ b/libs/python/cua-sandbox/cua_sandbox/sandbox.py
@@ -82,6 +82,7 @@ except ImportError:
from cua_sandbox import _placement, _refs
from cua_sandbox._config import has_fleet_access
+from cua_sandbox._ended import CloudEnded
from cua_sandbox._refs import AmbiguousSandbox # noqa: F401 - re-exported
from cua_sandbox._sdk import ( # noqa: F401 - InvalidPlacement is re-exported
ENV_SERVICE,
@@ -260,7 +261,10 @@ async def _lookup(name: str, local: Optional[bool]) -> tuple[str, bool]:
f"{name}: a direct machine is not managed by cua-sandbox; connect to it with "
f"Sandbox.connect({name!r})"
)
- return plain, bool(is_local)
+ if not is_local:
+ # A name that is not a local sandbox was a cloud one.
+ raise CloudEnded()
+ return plain, True
def _fleet_lifecycle_unsupported(name: str, operation: str) -> Unsupported:
@@ -2025,6 +2029,8 @@ class Sandbox:
if local is False:
return await cls._list_cloud(api_key=api_key)
rows = await cls._list_local()
+ # Cua Cloud has ended (CUA-1854): the default listing is local only.
+ return rows
from cua_sandbox._config import (
get_api_key,
has_fleet_auth,
@@ -2148,6 +2154,7 @@ class Sandbox:
@classmethod
async def _list_cloud(cls, *, api_key: Optional[str] = None) -> "list[SandboxInfo]":
+ raise CloudEnded()
if not cls._uses_fleet(api_key):
from cua_sandbox.transport.cloud import cloud_list_vms
@@ -2648,6 +2655,11 @@ class Sandbox:
_record_sandbox_create(sb, image=None, local=local, ephemeral=False, t_start=_t_start)
return sb
+ if not local and not (image and runtime):
+ # Cua Cloud has ended (CUA-1854): a pool claim, a cloud create
+ # and a connect by cloud name all stop here.
+ raise CloudEnded()
+
if pool:
transport = FleetCloudTransport(
image=None,
diff --git a/libs/python/cua-sandbox/tests/test_autopool.py b/libs/python/cua-sandbox/tests/test_autopool.py
index 4069602ecd..a0ef9bc1dc 100644
--- a/libs/python/cua-sandbox/tests/test_autopool.py
+++ b/libs/python/cua-sandbox/tests/test_autopool.py
@@ -164,6 +164,7 @@ def test_managed_key_matches_sandbox_core_defaults():
# ── native manager: acquire / reuse ──────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_create_without_pool_claims_from_a_managed_pool(fleet):
sb = await Sandbox.create(image(), local=False)
@@ -202,6 +203,7 @@ async def test_create_without_pool_claims_from_a_managed_pool(fleet):
assert sandbox_state.load(sb.claim_name) is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_same_spec_reuses_and_different_specs_do_not(fleet):
first = await Sandbox.create(image(), local=False)
second = await Sandbox.create(image(), local=False)
@@ -214,6 +216,7 @@ async def test_same_spec_reuses_and_different_specs_do_not(fleet):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_warm_max_pool_size_and_claim_ttl(fleet):
sb = await Sandbox.create(image(), warm=True, max_pool_size=3, claim_ttl=120, local=False)
pool = await pool_of(fleet, sb.pool_name)
@@ -225,6 +228,7 @@ async def test_warm_max_pool_size_and_claim_ttl(fleet):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_long_time_to_start_raises_the_bind_deadline(fleet):
sb = await Sandbox.create(image(), time_to_start=1800, local=False)
claim = (await claims_in(fleet, sb.pool_name))[sb.claim_name]
@@ -232,6 +236,7 @@ async def test_long_time_to_start_raises_the_bind_deadline(fleet):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_named_create_reattaches_an_existing_claim(fleet):
first = await Sandbox.create(image(), name="job-1", local=False)
await first.disconnect()
@@ -241,6 +246,7 @@ async def test_named_create_reattaches_an_existing_claim(fleet):
await second.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_keep_alive_extends_a_managed_claim(fleet):
sb = await Sandbox.create(image(), keep_alive_minutes=90, local=False)
claim = (await claims_in(fleet, sb.pool_name))[sb.claim_name]
@@ -249,6 +255,7 @@ async def test_keep_alive_extends_a_managed_claim(fleet):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_server_port_publishes_and_waits_for_the_server_service(fleet):
sb = await Sandbox.create(image(), server_port=8000, local=False)
assert sb._claim_handle.service == "server"
@@ -262,6 +269,7 @@ async def test_server_port_publishes_and_waits_for_the_server_service(fleet):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_osworld_image_claims_the_flask_server_through_the_managed_pool(fleet):
"""Legacy OSWorld adapter on Fleet: an ``agent_type="osworld"`` disk has no
spacesd, so the managed pool publishes its Flask server as ``server``
@@ -288,6 +296,7 @@ async def test_osworld_image_claims_the_flask_server_through_the_managed_pool(fl
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_disconnect_detaches_and_keeps_the_claim(fleet):
sb = await Sandbox.create(image(), local=False)
await sb.disconnect()
@@ -298,6 +307,7 @@ async def test_disconnect_detaches_and_keeps_the_claim(fleet):
# ── ephemeral ────────────────────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_releases_the_claim_and_keeps_the_pool(fleet):
async with Sandbox.ephemeral(image(), local=False) as sb:
pool_name, claim_name = sb.pool_name, sb.claim_name
@@ -310,6 +320,7 @@ async def test_ephemeral_releases_the_claim_and_keeps_the_pool(fleet):
assert not await claims_in(fleet, pool_name)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_releases_on_body_error(fleet):
with pytest.raises(RuntimeError, match="body"):
async with Sandbox.ephemeral(image(), local=False) as sb:
@@ -317,6 +328,7 @@ async def test_ephemeral_releases_on_body_error(fleet):
assert not await claims_in(fleet, sb.pool_name)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_keep_pool_is_a_deprecated_no_op(fleet):
with pytest.warns(DeprecationWarning, match="keep_pool"):
async with Sandbox.ephemeral(image(), keep_pool=True, local=False) as sb:
@@ -327,6 +339,7 @@ async def test_keep_pool_is_a_deprecated_no_op(fleet):
# ── list / pools / gc ────────────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_list_pools_and_gc_through_the_native_manager(fleet):
sb = await Sandbox.create(image(), local=False)
[info] = await _autopool.list_pools()
@@ -344,6 +357,7 @@ async def test_list_pools_and_gc_through_the_native_manager(fleet):
assert await managed_pools(fleet) == []
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("operation", ["suspend", "restart"])
async def test_lifecycle_ops_are_unsupported_on_managed_pools(fleet, operation):
sb = await Sandbox.create(image(), local=False)
@@ -352,6 +366,7 @@ async def test_lifecycle_ops_are_unsupported_on_managed_pools(fleet, operation):
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_concurrent_first_use_in_one_process_creates_one_pool(fleet):
import asyncio
@@ -365,6 +380,7 @@ async def test_concurrent_first_use_in_one_process_creates_one_pool(fleet):
# ── sync facade ──────────────────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_facade_create_ephemeral_and_list(fleet):
sb = cua_sync.Sandbox.create(image(), claim_ttl=60, local=False)
assert sb._claim_handle.heartbeat_running
@@ -381,6 +397,7 @@ def test_native_runtime_is_shared_per_pool_home(fleet):
assert _sdk.runtime(fleet=True) is not a
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_resume_of_a_live_cloud_sandbox_reconnects(fleet):
sb = await Sandbox.create(image(), local=False)
again = await Sandbox.resume(sb.claim_name)
@@ -392,6 +409,7 @@ async def test_resume_of_a_live_cloud_sandbox_reconnects(fleet):
# -- the default listing and the session marker (a stand-in keychain) --------
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_default_list_reads_a_keychain_session_only_with_the_marker(
fleet, monkeypatch, tmp_path
):
diff --git a/libs/python/cua-sandbox/tests/test_cloud.py b/libs/python/cua-sandbox/tests/test_cloud.py
index caaec3c409..4637f78a46 100644
--- a/libs/python/cua-sandbox/tests/test_cloud.py
+++ b/libs/python/cua-sandbox/tests/test_cloud.py
@@ -26,6 +26,7 @@ VM_NAME = os.environ.get("CUA_TEST_CLOUD_VM_NAME", "steady-bluebird")
skip_no_key = pytest.mark.skipif(not API_KEY, reason="CUA_API_KEY not set")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize(
"auth_environment",
[
@@ -102,6 +103,7 @@ async def test_cloud_routes_fleet_auth_without_explicit_legacy_key(
]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("legacy_source", ["configured", "environment", "credentials"])
async def test_registry_image_uses_legacy_auth_when_fleet_auth_is_unavailable(
monkeypatch, legacy_source
@@ -151,6 +153,7 @@ async def test_registry_image_uses_legacy_auth_when_fleet_auth_is_unavailable(
assert [route["name"] for route in routes] == ["legacy-demo"]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_registry_image_uses_legacy_auth_selector(monkeypatch):
monkeypatch.setattr(_config, "_global_config", _config._Config(api_key="sk-configured"))
for variable in ("FLEETS_TOKEN", "CUA_CLIENT_ID", "CUA_CLIENT_SECRET"):
@@ -251,6 +254,7 @@ async def test_cloud_environment():
await sb.disconnect()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_no_api_key_errors():
"""Connecting with no credentials names every way to get them."""
old = os.environ.pop("CUA_API_KEY", None)
@@ -262,6 +266,7 @@ async def test_cloud_no_api_key_errors():
os.environ["CUA_API_KEY"] = old
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_no_image_no_name_errors():
"""Creating without an image raises a clear error."""
with pytest.raises((ValueError, TypeError)):
@@ -306,6 +311,7 @@ async def test_cloud_invalid_api_key_errors():
await sb.disconnect()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_backed_create_persists_claim_pool_mapping(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
@@ -332,6 +338,7 @@ async def test_pool_backed_create_persists_claim_pool_mapping(monkeypatch, tmp_p
assert sandbox_state.load("wif-smoke-123")["pool_name"] == "cua-cli-wif-smoke"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_backed_connect_loads_claim_pool_mapping(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
@@ -359,6 +366,7 @@ async def test_pool_backed_connect_loads_claim_pool_mapping(monkeypatch, tmp_pat
assert created[0]["pool_name"] == "cua-cli-wif-smoke"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_backed_delete_removes_mapping_only_after_success(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
@@ -380,6 +388,7 @@ async def test_pool_backed_delete_removes_mapping_only_after_success(monkeypatch
assert sandbox_state.load("wif-smoke-123") is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_backed_delete_keeps_mapping_when_claim_delete_fails(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
diff --git a/libs/python/cua-sandbox/tests/test_cloud_ended.py b/libs/python/cua-sandbox/tests/test_cloud_ended.py
new file mode 100644
index 0000000000..b8c5846c36
--- /dev/null
+++ b/libs/python/cua-sandbox/tests/test_cloud_ended.py
@@ -0,0 +1,66 @@
+"""Cua Cloud has ended (CUA-1854): every cloud entry point raises one message."""
+
+from __future__ import annotations
+
+import pytest
+from cua_sandbox import Image, Pool, Sandbox, pools
+from cua_sandbox._ended import CLOUD_ENDED, CloudEnded
+
+MESSAGE = (
+ "Cua Cloud has ended; use a local sandbox or your own machine. "
+ "See https://cua.ai/docs/cua-sdk/guides/cua-cloud-ended"
+)
+
+
+def test_the_message_is_exact():
+ assert CLOUD_ENDED == MESSAGE
+ assert str(CloudEnded()) == MESSAGE
+ assert isinstance(CloudEnded(), NotImplementedError)
+
+
[email protected]("kwargs", [{"on": "cloud"}, {"local": False}])
+async def test_create_and_ephemeral_fail_fast(kwargs):
+ with pytest.raises(CloudEnded, match="Cua Cloud has ended"):
+ await Sandbox.create(Image.linux(), **kwargs)
+ with pytest.raises(CloudEnded, match="Cua Cloud has ended"):
+ async with Sandbox.ephemeral(Image.linux(), **kwargs):
+ pass
+
+
+async def test_the_default_location_set_to_cloud_fails(monkeypatch):
+ monkeypatch.setenv("CUA_DEFAULT_ON", "cloud")
+ with pytest.raises(CloudEnded):
+ await Sandbox.create(Image.linux())
+
+
+async def test_references_to_cloud_sandboxes_fail():
+ for call in (
+ lambda: Sandbox.connect("cloud:box"),
+ lambda: Sandbox.connect("box", local=False),
+ lambda: Sandbox.get_info("cloud:box"),
+ lambda: Sandbox.suspend("cloud:box"),
+ lambda: Sandbox.resume("cloud:box"),
+ lambda: Sandbox.delete("cloud:box"),
+ lambda: Sandbox.list(local=False),
+ lambda: Sandbox.list(location="cloud"),
+ ):
+ with pytest.raises(CloudEnded) as error:
+ await call()
+ assert str(error.value) == MESSAGE
+
+
+async def test_pools_fail():
+ with pytest.raises(CloudEnded):
+ await Pool.get("p")
+ with pytest.raises(CloudEnded):
+ await pools.list_pools()
+ with pytest.raises(CloudEnded):
+ await pools.gc()
+
+
+async def test_the_default_listing_is_local_only(monkeypatch):
+ async def local():
+ return []
+
+ monkeypatch.setattr(Sandbox, "_list_local", classmethod(lambda cls: local()))
+ assert await Sandbox.list() == []
diff --git a/libs/python/cua-sandbox/tests/test_image_resolve.py b/libs/python/cua-sandbox/tests/test_image_resolve.py
index 0b81b23cde..e7dddde1a5 100644
--- a/libs/python/cua-sandbox/tests/test_image_resolve.py
+++ b/libs/python/cua-sandbox/tests/test_image_resolve.py
@@ -170,6 +170,7 @@ async def test_request_service_passes_headers():
# ── Missing Fleet credentials and the `cua auth login` session ─────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_no_credentials_names_every_way_out():
with pytest.raises(Exception) as info:
await Sandbox.create(Image.from_registry("python:3.12-slim"), local=False)
diff --git a/libs/python/cua-sandbox/tests/test_network.py b/libs/python/cua-sandbox/tests/test_network.py
index dd22e584f7..1498995e3b 100644
--- a/libs/python/cua-sandbox/tests/test_network.py
+++ b/libs/python/cua-sandbox/tests/test_network.py
@@ -51,6 +51,7 @@ def test_android_cmd_has_egress_unless_restricted():
assert net(none).startswith("user,id=net0,restrict=on,hostfwd=")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_cloud_sandboxes_refuse_network_none():
with pytest.raises(Unsupported, match="network='none'"):
asyncio.run(Sandbox.create(Image.linux(), local=False, network="none"))
diff --git a/libs/python/cua-sandbox/tests/test_p2_parity.py b/libs/python/cua-sandbox/tests/test_p2_parity.py
index c235c92681..9433038f4b 100644
--- a/libs/python/cua-sandbox/tests/test_p2_parity.py
+++ b/libs/python/cua-sandbox/tests/test_p2_parity.py
@@ -139,6 +139,7 @@ def _capture(monkeypatch) -> list:
return seen
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_cloud_create_hands_sidecars_secret_and_layers_to_the_sdk(monkeypatch):
pytest.importorskip("cua")
seen = _capture(monkeypatch)
@@ -163,6 +164,7 @@ def test_cloud_create_hands_sidecars_secret_and_layers_to_the_sdk(monkeypatch):
assert (o.on, o.runtime) == ("cloud", "gvisor"), "a build's output is a container rootfs"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_cloud_create_passes_an_explicit_warm(monkeypatch):
pytest.importorskip("cua")
seen = _capture(monkeypatch)
@@ -172,6 +174,7 @@ def test_cloud_create_passes_an_explicit_warm(monkeypatch):
assert seen[0].sidecars == [] and seen[0].registry_secret is None and seen[0].build is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_an_existing_pool_compares_sidecars_with_its_template(monkeypatch):
from cua_sandbox import Pool, PoolSpecMismatch
@@ -192,6 +195,7 @@ def test_an_existing_pool_compares_sidecars_with_its_template(monkeypatch):
# ── end to end on the fake Fleet ─────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_vm_images_take_sidecars(fleet): # noqa: F811
# IMAGE is a KubeVirt containerDisk in the fake registry: Fleet runs its
# sidecars in a companion pod, addressed by name like on gVisor.
@@ -213,9 +217,11 @@ async def test_cloud_vm_images_take_sidecars(fleet): # noqa: F811
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("reserved", ["main", "sidecars", "sc"])
async def test_sidecars_reserve_service_names_before_creating_anything(
- fleet, reserved # noqa: F811 - fixture
+ fleet, # noqa: F811 - fixture
+ reserved,
):
with pytest.raises(Exception, match="reserved"):
await Sandbox.create(
@@ -232,6 +238,7 @@ async def test_sidecars_reserve_service_names_before_creating_anything(
assert not [n for n in names if n.startswith("cua-auto-")], "nothing was created"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_layers_fail_clearly_until_fleet_builds_them(fleet): # noqa: F811
with pytest.raises(Exception, match="not deployed yet"):
await Sandbox.create(Image.from_registry(IMAGE).pip_install("mcp"), local=False)
diff --git a/libs/python/cua-sandbox/tests/test_placement.py b/libs/python/cua-sandbox/tests/test_placement.py
index 561ad18f72..dd5151d87e 100644
--- a/libs/python/cua-sandbox/tests/test_placement.py
+++ b/libs/python/cua-sandbox/tests/test_placement.py
@@ -100,9 +100,10 @@ async def test_builtin_default_is_local_with_the_notice(local_sdk, cloud, notice
await Sandbox.create(ROOTFS, telemetry_enabled=False)
assert local_sdk[0].on == "local" and not cloud
[message] = notice()
- assert "cua config set default.on" in message and "local=False" in message
+ assert "defaulting to a local sandbox" in message and "CUA_QUIET_DEFAULT=1" in message
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_config_default_on_cloud_sends_create_to_the_cloud(local_sdk, cloud, notice):
cua.config_set("default.on", "cloud")
with warnings.catch_warnings():
@@ -114,6 +115,7 @@ async def test_config_default_on_cloud_sends_create_to_the_cloud(local_sdk, clou
assert not notice(), "no local notice when the default was chosen"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_env_beats_config(monkeypatch, local_sdk, cloud, notice):
cua.config_set("default.on", "cloud")
monkeypatch.setenv("CUA_DEFAULT_ON", "local")
@@ -127,6 +129,7 @@ async def test_env_beats_config(monkeypatch, local_sdk, cloud, notice):
assert "CUA_DEFAULT_ON" in cloud[0]["hint"]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_explicit_beats_env(monkeypatch, local_sdk, cloud):
monkeypatch.setenv("CUA_DEFAULT_ON", "cloud")
with pytest.raises(_Captured):
@@ -177,11 +180,13 @@ async def test_on_and_a_contradicting_local_is_invalid(local_sdk, cloud):
await Sandbox.create(ROOTFS, on="local", local=True, telemetry_enabled=False)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_unknown_locations_list_the_valid_ones():
with pytest.raises(InvalidPlacement, match="valid on: local, cloud"):
await Sandbox.create(ROOTFS, on="fleet")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_only_arguments_imply_the_cloud(local_sdk, cloud):
with pytest.warns(DeprecationWarning, match="local=False"):
with pytest.raises(_Captured):
@@ -217,6 +222,7 @@ async def test_ephemeral_takes_the_same_placement(local_sdk):
assert (local_sdk[0].kind, local_sdk[0].runtime) == ("container", "gvisor")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_kind_and_runtime_reach_the_managed_pool(cloud):
with pytest.raises(_Captured):
await Sandbox.create(Image.linux(), on="cloud", kind="vm", telemetry_enabled=False)
@@ -250,6 +256,7 @@ async def test_autopool_hands_kind_and_runtime_to_the_sdk(monkeypatch):
# ── InvalidPlacement ─────────────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_invalid_combinations_list_the_valid_values(local_sdk, cloud):
with pytest.raises(InvalidPlacement, match="valid runtime: auto, gvisor, runc"):
await Sandbox.create(ROOTFS, on="local", kind="container", runtime="qemu")
@@ -280,6 +287,7 @@ async def test_an_sdk_placement_error_surfaces_as_invalid_placement(monkeypatch)
await Sandbox.create(ROOTFS, on="local", telemetry_enabled=False)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_missing_cloud_credentials_from_a_default_say_how_to_switch_back(monkeypatch):
n = cua._native
diff --git a/libs/python/cua-sandbox/tests/test_pool.py b/libs/python/cua-sandbox/tests/test_pool.py
index 26fe709949..162617513b 100644
--- a/libs/python/cua-sandbox/tests/test_pool.py
+++ b/libs/python/cua-sandbox/tests/test_pool.py
@@ -376,6 +376,7 @@ async def test_fleet_client_manages_signed_service_urls(monkeypatch) -> None:
assert calls[2][1].id == created.id
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_reconcile_creates_pool_referencing_a_template(monkeypatch):
client = FakeFleetClient()
@@ -393,6 +394,7 @@ async def test_reconcile_creates_pool_referencing_a_template(monkeypatch):
assert request.spec.replicas == 1
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_delete_deletes_resource_and_closes_client(monkeypatch):
client = FakeFleetClient()
@@ -404,6 +406,7 @@ async def test_pool_delete_deletes_resource_and_closes_client(monkeypatch):
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_template_reconcile_creates_template_from_registry_image(monkeypatch):
client = FakeFleetClient()
@@ -427,6 +430,7 @@ async def test_template_reconcile_creates_template_from_registry_image(monkeypat
]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_template_reconcile_closes_temporary_client_when_reconciliation_fails(monkeypatch):
client = FakeFleetClient(reconcile_error=RuntimeError("reconcile failed"))
@@ -438,6 +442,7 @@ async def test_template_reconcile_closes_temporary_client_when_reconciliation_fa
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("invalid_value", [None, {}, "not-a-request", pool_request()])
@pytest.mark.asyncio
async def test_template_reconcile_rejects_non_request(invalid_value):
@@ -445,6 +450,7 @@ async def test_template_reconcile_rejects_non_request(invalid_value):
await Template.reconcile(invalid_value)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_template_reconcile_matches_async_facade(monkeypatch):
client = FakeFleetClient()
monkeypatch.setattr("cua_sandbox.pool._FleetClient", lambda: client)
@@ -455,6 +461,7 @@ def test_sync_template_reconcile_matches_async_facade(monkeypatch):
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_reconcile_closes_temporary_client_when_reconciliation_fails(monkeypatch):
client = FakeFleetClient(reconcile_error=RuntimeError("reconcile failed"))
@@ -466,6 +473,7 @@ async def test_reconcile_closes_temporary_client_when_reconciliation_fails(monke
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_reconcile_updates_existing_pool_idempotently(monkeypatch):
existing = fleet_pool()
@@ -480,6 +488,7 @@ async def test_reconcile_updates_existing_pool_idempotently(monkeypatch):
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_releases_claim_and_client_after_block_exception(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -499,6 +508,7 @@ async def test_claim_releases_claim_and_client_after_block_exception(monkeypatch
assert claim_client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_preserves_block_exception_when_release_fails(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -515,6 +525,7 @@ async def test_claim_preserves_block_exception_when_release_fails(monkeypatch):
assert claim_client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_raises_release_failure_without_block_exception(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -530,6 +541,7 @@ async def test_claim_raises_release_failure_without_block_exception(monkeypatch)
assert claim_client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("invalid_value", [None, {}, "not-a-request"])
@pytest.mark.asyncio
async def test_reconcile_rejects_non_request(invalid_value):
@@ -537,6 +549,7 @@ async def test_reconcile_rejects_non_request(invalid_value):
await Pool.reconcile(invalid_value)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_pool_delete_matches_async_facade(monkeypatch):
client = FakeFleetClient()
monkeypatch.setattr("cua_sandbox.pool._FleetClient", lambda: client)
@@ -547,6 +560,7 @@ def test_sync_pool_delete_matches_async_facade(monkeypatch):
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_pool_matches_blocking_context_manager(monkeypatch):
reconcile_client = FakeFleetClient()
claim_client = FakeFleetClient()
@@ -568,6 +582,7 @@ def test_sync_pool_matches_blocking_context_manager(monkeypatch):
assert claim_client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_reconcile_preserves_replicas_and_template_reference(monkeypatch):
client = FakeFleetClient()
@@ -580,6 +595,7 @@ async def test_reconcile_preserves_replicas_and_template_reference(monkeypatch):
assert request.spec.sandbox_template_ref.name == "workspace"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_template_reconcile_preserves_named_services(monkeypatch):
client = FakeFleetClient()
@@ -599,6 +615,7 @@ async def test_template_reconcile_preserves_named_services(monkeypatch):
]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_reconcile_forwards_native_create_pool_request_unchanged(monkeypatch):
client = FakeFleetClient()
@@ -610,6 +627,7 @@ async def test_reconcile_forwards_native_create_pool_request_unchanged(monkeypat
assert client.reconciled == [request]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_template_reconcile_forwards_native_request_unchanged(monkeypatch):
client = FakeFleetClient()
@@ -641,6 +659,7 @@ async def test_template_reconcile_forwards_native_request_unchanged(monkeypatch)
assert client.reconciled_templates == [request]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_exposes_named_service_requests(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -663,6 +682,7 @@ async def test_claim_exposes_named_service_requests(monkeypatch):
assert request.body == b'{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_manages_signed_service_urls(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -692,6 +712,7 @@ async def test_claim_manages_signed_service_urls(monkeypatch):
assert claim_client.signed_url_revocations == [created]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_forwards_native_claim_spec_unchanged(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -715,6 +736,7 @@ async def test_claim_forwards_native_claim_spec_unchanged(monkeypatch):
assert request.spec is spec
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_claim_without_spec_uses_operator_default(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -733,6 +755,7 @@ async def test_claim_without_spec_uses_operator_default(monkeypatch):
assert claim_client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_get_fetches_without_reconciling(monkeypatch):
client = FakeFleetClient()
@@ -745,6 +768,7 @@ async def test_pool_get_fetches_without_reconciling(monkeypatch):
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_claim_returns_a_serializable_lease(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -771,6 +795,7 @@ async def test_create_claim_returns_a_serializable_lease(monkeypatch):
assert _ClaimHandle.from_dict(lease.to_dict()).to_dict() == lease.to_dict()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_claim_forwards_creation_ttl_in_a_derived_spec(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -789,6 +814,7 @@ async def test_create_claim_forwards_creation_ttl_in_a_derived_spec(monkeypatch)
assert spec.lifecycle is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_claim_rejects_ttl_alongside_an_explicit_spec(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -800,6 +826,7 @@ async def test_create_claim_rejects_ttl_alongside_an_explicit_spec(monkeypatch):
await pool.create_claim(spec=SimpleNamespace(), ttl_seconds_after_created=1800)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_claim_forwards_creation_ttl_in_a_derived_spec(monkeypatch):
reconcile_client = FakeFleetClient()
@@ -943,6 +970,7 @@ async def test_fleet_client_renew_claim_delegates_when_supported():
assert calls == [("claim", "2026-01-01T00:10:00Z")]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_named_claim_retry_reattaches_without_creating(monkeypatch):
client = FakeFleetClient()
@@ -963,6 +991,7 @@ async def test_named_claim_retry_reattaches_without_creating(monkeypatch):
await sandbox.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_named_claim_reattach_failure_does_not_release_existing_claim(monkeypatch):
client = FakeFleetClient()
@@ -987,6 +1016,7 @@ async def test_named_claim_reattach_failure_does_not_release_existing_claim(monk
assert client.closed is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_new_claim_acquisition_failure_releases_created_claim(monkeypatch):
client = FakeFleetClient()
@@ -1039,6 +1069,7 @@ def _capture_native_apply(monkeypatch) -> list:
return seen
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_goes_through_the_one_native_writer(monkeypatch):
seen = _capture_native_apply(monkeypatch)
@@ -1058,6 +1089,7 @@ async def test_pool_apply_goes_through_the_one_native_writer(monkeypatch):
assert pool._owned_template is not None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_delete_removes_owned_pool_and_template(monkeypatch):
_capture_native_apply(monkeypatch)
@@ -1073,6 +1105,7 @@ async def test_pool_apply_delete_removes_owned_pool_and_template(monkeypatch):
assert client.deleted_templates == ["workspace"]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_forwards_autoscaling_to_the_pool_options(monkeypatch):
seen = _capture_native_apply(monkeypatch)
@@ -1088,6 +1121,7 @@ async def test_pool_apply_forwards_autoscaling_to_the_pool_options(monkeypatch):
assert (options.min_pool_size, options.replicas, options.max_pool_size) == (0, 2, 10)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_without_autoscaling_leaves_the_pool_static(monkeypatch):
seen = _capture_native_apply(monkeypatch)
@@ -1102,6 +1136,7 @@ async def test_pool_apply_without_autoscaling_leaves_the_pool_static(monkeypatch
assert options.warm is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_requires_an_explicit_name():
image = Image.from_registry("registry.example/workspace:latest")
@@ -1123,6 +1158,7 @@ async def _applied_runtime(monkeypatch, image, **kwargs):
DESKTOP = "ghcr.io/trycua/cua-desktop-linux"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
@pytest.mark.parametrize(
("reference", "kind", "runtime", "expected"),
@@ -1145,6 +1181,7 @@ async def test_pool_apply_sets_the_template_runtime(
assert await _applied_runtime(monkeypatch, image, runtime=runtime) == expected
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
@pytest.mark.parametrize(
("reference", "runtime", "hint"),
@@ -1168,6 +1205,7 @@ async def test_pool_apply_refuses_a_crossed_runtime_before_creating_anything(
await Pool.apply(Image.from_registry(reference), name="workspace", runtime="firecracker")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_pool_apply_forwards_the_runtime(monkeypatch):
seen = _capture_native_apply(monkeypatch)
SyncPool.apply(
@@ -1178,6 +1216,7 @@ def test_sync_pool_apply_forwards_the_runtime(monkeypatch):
assert seen[0][2].runtime == "gvisor"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
def test_sync_pool_apply_forwards_autoscaling(monkeypatch):
seen = _capture_native_apply(monkeypatch)
autoscaling = WarmPoolAutoscaling(min_pool_size=1, initial_pool_size=1, max_pool_size=5)
@@ -1193,6 +1232,7 @@ def test_sync_pool_apply_forwards_autoscaling(monkeypatch):
assert (options.min_pool_size, options.replicas, options.max_pool_size) == (1, 1, 5)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_forwards_creation_ttl_to_the_pool_options(monkeypatch):
seen = _capture_native_apply(monkeypatch)
@@ -1206,6 +1246,7 @@ async def test_pool_apply_forwards_creation_ttl_to_the_pool_options(monkeypatch)
assert seen[0][2].pool_ttl_seconds == 86400
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_without_creation_ttl_leaves_the_pool_unreaped(monkeypatch):
seen = _capture_native_apply(monkeypatch)
@@ -1218,6 +1259,7 @@ async def test_pool_apply_without_creation_ttl_leaves_the_pool_unreaped(monkeypa
assert seen[0][2].pool_ttl_seconds is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_rejects_invalid_creation_ttl(monkeypatch):
monkeypatch.setattr("cua_sandbox.pool._FleetClient", FakeFleetClient)
@@ -1230,6 +1272,7 @@ async def test_pool_apply_rejects_invalid_creation_ttl(monkeypatch):
)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_apply_maps_a_taken_name_to_access_denied(monkeypatch):
import cua
@@ -1252,6 +1295,7 @@ async def test_pool_apply_maps_a_taken_name_to_access_denied(monkeypatch):
assert "https://discord.gg/mVnXXpdE85" in str(error.value)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_close_after_disconnect_reopens_client_for_release(monkeypatch):
claim_client = FakeFleetClient()
diff --git a/libs/python/cua-sandbox/tests/test_pool_image_info.py b/libs/python/cua-sandbox/tests/test_pool_image_info.py
index 6284376c6c..6364d36e6c 100644
--- a/libs/python/cua-sandbox/tests/test_pool_image_info.py
+++ b/libs/python/cua-sandbox/tests/test_pool_image_info.py
@@ -10,6 +10,7 @@ from __future__ import annotations
from types import SimpleNamespace
+import pytest
from cua_sandbox import (
CloudOptions,
Image,
@@ -64,6 +65,7 @@ async def test_an_unreadable_pool_leaves_image_info_unset(monkeypatch):
assert sb.image_info is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_the_native_fleet_reports_a_named_pool_template_image(fleet): # noqa: F811
await Pool.apply(
"cua-e2e-py-digest",
@@ -79,6 +81,7 @@ async def test_the_native_fleet_reports_a_named_pool_template_image(fleet): # n
assert await _sdk.pool_image_info("cua-e2e-py-missing") is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_a_claim_on_a_named_pool_reports_its_image(fleet): # noqa: F811
await Pool.apply(
"cua-e2e-py-claim",
diff --git a/libs/python/cua-sandbox/tests/test_pool_spec.py b/libs/python/cua-sandbox/tests/test_pool_spec.py
index 04fa0954e1..cf01af8e27 100644
--- a/libs/python/cua-sandbox/tests/test_pool_spec.py
+++ b/libs/python/cua-sandbox/tests/test_pool_spec.py
@@ -126,6 +126,7 @@ def _capture(monkeypatch, name="workspace"):
return seen
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_apply_writes_through_the_native_fleet_apply(monkeypatch):
seen = _capture(monkeypatch)
image = Image.from_registry(ROOTFS, kind="container")
@@ -148,6 +149,7 @@ async def test_pool_apply_writes_through_the_native_fleet_apply(monkeypatch):
await Pool.apply("workspace", {"image": ROOTFS})
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_the_old_signature_is_a_deprecated_wrapper(monkeypatch):
seen = _capture(monkeypatch)
image = Image.from_registry(ROOTFS, kind="container")
@@ -185,6 +187,7 @@ async def test_the_old_signature_is_a_deprecated_wrapper(monkeypatch):
await Pool.apply(image, name="workspace", ttl_seconds_after_created=-1)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_a_taken_pool_name_is_access_denied(monkeypatch):
n = _native()
@@ -203,6 +206,7 @@ async def test_a_taken_pool_name_is_access_denied(monkeypatch):
)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_apply_true_needs_a_pool():
with pytest.raises(ValueError, match="pass pool="):
await Sandbox.create(
@@ -228,6 +232,7 @@ async def _apply(name: str) -> Pool:
)
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_apply_export_and_terraform_against_the_fake_fleet(fleet): # noqa: F811
pool = await _apply("cua-e2e-py-spec")
assert pool.name == "cua-e2e-py-spec"
@@ -251,6 +256,7 @@ async def test_apply_export_and_terraform_against_the_fake_fleet(fleet): # noqa
await pool.delete()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_a_named_pool_is_compared_and_applied(fleet): # noqa: F811
await _apply("cua-e2e-py-mm")
await Pool.check("cua-e2e-py-mm", SandboxSpec(command=["python", "-m", "srv"]))
diff --git a/libs/python/cua-sandbox/tests/test_refs.py b/libs/python/cua-sandbox/tests/test_refs.py
index e66c18e8fe..ddc7b7ee51 100644
--- a/libs/python/cua-sandbox/tests/test_refs.py
+++ b/libs/python/cua-sandbox/tests/test_refs.py
@@ -25,6 +25,7 @@ def test_refs_parse_with_the_legacy_spellings():
_refs.parse("moon:x")
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_resolve_qualified_narrowed_and_ambiguous(monkeypatch):
local_names = {"box", "only-local"}
is_local = local_names.__contains__
diff --git a/libs/python/cua-sandbox/tests/test_sandbox_fleet_lifecycle.py b/libs/python/cua-sandbox/tests/test_sandbox_fleet_lifecycle.py
index 884bdb5f59..7b0c35b6cd 100644
--- a/libs/python/cua-sandbox/tests/test_sandbox_fleet_lifecycle.py
+++ b/libs/python/cua-sandbox/tests/test_sandbox_fleet_lifecycle.py
@@ -42,6 +42,7 @@ class FakePool:
self.deletes += 1
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_with_pool_name_uses_read_only_pool_lookup(monkeypatch):
pool = FakePool()
@@ -62,6 +63,7 @@ async def test_create_with_pool_name_uses_read_only_pool_lookup(monkeypatch):
assert sandbox.claim_name == "job-123"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_with_fleet_image_claims_from_managed_pool(monkeypatch, tmp_path):
# Was test_create_with_fleet_image_requires_explicit_pool: a Fleet image
@@ -86,6 +88,7 @@ async def test_create_with_fleet_image_claims_from_managed_pool(monkeypatch, tmp
assert sandbox_state.load("job-123")["managed"] is True
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_pool_create_persists_generated_claim_pool_mapping(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
@@ -112,6 +115,7 @@ async def test_pool_create_persists_generated_claim_pool_mapping(monkeypatch, tm
assert sandbox_state.load("generated-claim-1")["pool_name"] == "workspace"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize("source", ["existing-pool", "pool-object"])
@pytest.mark.asyncio
async def test_keep_alive_failure_releases_claim_without_persisting_state(
@@ -145,6 +149,7 @@ async def test_keep_alive_failure_releases_claim_without_persisting_state(
assert sandbox_state.load("job-123") is None
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_state_persistence_failure_releases_acquired_claim(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
@@ -171,6 +176,7 @@ async def test_state_persistence_failure_releases_acquired_claim(monkeypatch, tm
claimed.close.assert_awaited_once()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_keep_alive_failure_preserves_error_when_claim_close_fails(monkeypatch):
claimed = SimpleNamespace(
@@ -190,6 +196,7 @@ async def test_keep_alive_failure_preserves_error_when_claim_close_fails(monkeyp
assert str(error.value.__cause__) == "close failed"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_compares_an_image_given_with_a_pool(monkeypatch):
from cua_sandbox import Pool, PoolSpecMismatch
@@ -208,6 +215,7 @@ async def test_create_compares_an_image_given_with_a_pool(monkeypatch):
assert seen == [("pool", "registry.example/workspace:latest")]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_create_rejects_pool_configuration_for_existing_pool():
with pytest.raises(ValueError, match="existing pool"):
@@ -304,6 +312,7 @@ def test_to_dict_serializes_claim_not_bound_transport():
assert "sandbox-1" not in str(sandbox.to_dict())
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_pool_closes_claim(monkeypatch):
closed: list[bool] = []
@@ -323,6 +332,7 @@ async def test_ephemeral_pool_closes_claim(monkeypatch):
assert closed == [True]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_image_uses_name_for_the_claim_on_a_managed_pool(monkeypatch):
# Was test_ephemeral_image_uses_name_for_owned_pool_and_claim: name= now
@@ -351,6 +361,7 @@ async def test_ephemeral_image_uses_name_for_the_claim_on_a_managed_pool(monkeyp
claimed.close.assert_awaited_once()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.parametrize(
"kwargs",
[
@@ -381,6 +392,7 @@ async def test_keep_pool_is_a_deprecated_no_op(monkeypatch, kwargs):
pass
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_image_without_name_never_creates_a_disposable_pool(monkeypatch):
# Was test_ephemeral_image_without_name_applies_random_disposable_pool:
@@ -403,6 +415,7 @@ async def test_ephemeral_image_without_name_never_creates_a_disposable_pool(monk
claimed.close.assert_awaited_once()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_image_propagates_acquire_failure(monkeypatch):
# Was test_ephemeral_image_deletes_owned_pool_when_claim_fails: the
@@ -416,6 +429,7 @@ async def test_ephemeral_image_propagates_acquire_failure(monkeypatch):
pass
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_image_preserves_body_error_when_claim_cleanup_fails(monkeypatch):
# Was ..._when_owned_pool_cleanup_fails.
@@ -434,6 +448,7 @@ async def test_ephemeral_image_preserves_body_error_when_claim_cleanup_fails(mon
claimed.close.assert_awaited_once()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_ephemeral_forwards_the_fleet_runtime_to_the_managed_pool(monkeypatch):
# Was ..._to_the_owned_pool: the runtime is part of the managed pool key.
@@ -448,6 +463,7 @@ async def test_ephemeral_forwards_the_fleet_runtime_to_the_managed_pool(monkeypa
assert acquire.await_args.kwargs["runtime"] == "gvisor"
[email protected](reason="Cua Cloud has ended (CUA-1854)")
@pytest.mark.asyncio
async def test_a_fleet_runtime_belongs_to_the_pool_not_the_claim(monkeypatch, tmp_path):
from cua_sandbox import sandbox_state
diff --git a/libs/python/cua-sandbox/tests/test_typed_driver.py b/libs/python/cua-sandbox/tests/test_typed_driver.py
index c7774e08b6..df4d7e1ae4 100644
--- a/libs/python/cua-sandbox/tests/test_typed_driver.py
+++ b/libs/python/cua-sandbox/tests/test_typed_driver.py
@@ -191,6 +191,7 @@ async def test_claim_close_orders_driver_release_transport(sandbox):
assert driver.shutdowns == 1
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_pool_claim_context_closes_driver_before_claim_and_client(native, monkeypatch):
from cua_sandbox import Pool
diff --git a/libs/python/cua-sandbox/tests/test_unified_api.py b/libs/python/cua-sandbox/tests/test_unified_api.py
index fa9a8c137f..995c1f6867 100644
--- a/libs/python/cua-sandbox/tests/test_unified_api.py
+++ b/libs/python/cua-sandbox/tests/test_unified_api.py
@@ -144,7 +144,7 @@ async def test_local_is_the_default_with_a_one_time_notice(monkeypatch, fresh_no
assert len(calls) == 2, "both went to the local runtime"
notices = [r for r in caplog.records if "defaulting to a local sandbox" in r.message]
assert len(notices) == 1, "the notice is shown once"
- assert "local=False" in notices[0].message
+ assert "CUA_QUIET_DEFAULT=1" in notices[0].message
async def test_quiet_default_hides_the_notice(monkeypatch, fresh_notice, caplog):
@@ -156,6 +156,7 @@ async def test_quiet_default_hides_the_notice(monkeypatch, fresh_notice, caplog)
assert not [r for r in caplog.records if "defaulting to a local" in r.message]
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_only_arguments_keep_the_cloud_with_a_deprecation(monkeypatch, fresh_notice):
seen: list = []
@@ -202,6 +203,7 @@ async def test_local_true_with_cloud_options_is_a_typed_error():
pass
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_suspend_is_unsupported_and_never_scales_a_pool(monkeypatch, tmp_path):
from cua_sandbox import Unsupported, sandbox_state
@@ -382,6 +384,7 @@ async def test_non_sdk_runtimes_refuse_the_portable_options():
# ── deprecated keywords ─────────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_flat_cloud_keywords_are_deprecated_and_conflicts_refused(monkeypatch):
calls: list = []
monkeypatch.setattr("cua_sandbox.runtime.docker.DockerRuntime", _native_recorder(calls))
@@ -416,6 +419,7 @@ async def test_flat_cloud_keywords_are_deprecated_and_conflicts_refused(monkeypa
# ── cloud: the fake Fleet API ────────────────────────────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_command_services_info_urls_and_progress(fleet, rootfs_variant):
events: list = []
sb = await Sandbox.create(
@@ -467,6 +471,7 @@ async def test_cloud_command_services_info_urls_and_progress(fleet, rootfs_varia
await sb.close()
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_cloud_env_is_created_and_keys_its_own_pool(fleet, rootfs_variant):
# Cloud env= is the template's env (processMode Run on every runtime).
plain = await Sandbox.create(Image.from_registry(ROOTFS), telemetry_enabled=False, local=False)
@@ -484,6 +489,7 @@ async def test_cloud_env_is_created_and_keys_its_own_pool(fleet, rootfs_variant)
# ── listing: local by default, all=True merges cloud ────────────────────
[email protected](reason="Cua Cloud has ended (CUA-1854)")
async def test_list_is_everything_by_default_and_the_cloud_never_fails_it(monkeypatch):
import asyncio
import sys
diff --git a/libs/python/cua-sandbox/tests/test_vm_cleanup.py b/libs/python/cua-sandbox/tests/test_vm_cleanup.py
index 4ea3c3e399..a682167f52 100644
--- a/libs/python/cua-sandbox/tests/test_vm_cleanup.py
+++ b/libs/python/cua-sandbox/tests/test_vm_cleanup.py
@@ -64,6 +64,7 @@ def _make_sandbox(transport: FleetCloudTransport, **kwargs) -> Sandbox:
# ===================================================================
[email protected](reason="Cua Cloud has ended (CUA-1854)")
class TestCreateCleansUpOnConnectFailure:
"""Sandbox._create() releases a managed Fleet claim when attaching fails.
@@ -239,6 +240,7 @@ class TestFleetServerPortForwarding:
def _select_fleet(self, monkeypatch):
monkeypatch.setattr(Sandbox, "_uses_fleet", staticmethod(lambda api_key: api_key is None))
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_create_forwards_server_port_to_the_managed_pool(self):
# Was test_create_with_fleet_image_requires_explicit_pool.
apply = AsyncMock()
@@ -259,6 +261,7 @@ class TestFleetServerPortForwarding:
apply.assert_not_awaited()
assert acquire.await_args.kwargs["server_port"] == 5000
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_forwards_server_port(self):
claimed = _managed_sandbox()
acquire = AsyncMock(return_value=claimed)
@@ -275,6 +278,7 @@ class TestFleetServerPortForwarding:
assert acquire.await_args.kwargs["server_port"] == 5000
claimed.close.assert_awaited_once()
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_create_passes_server_port_to_fleet_transport(self):
# _create (the sandbox() helper path) routes to the managed pool too.
acquire = AsyncMock(return_value=_managed_sandbox())
@@ -292,6 +296,7 @@ class TestFleetServerPortForwarding:
assert acquire.await_args.kwargs["server_port"] == 5000
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_existing_pool_does_not_pass_server_port_to_fleet_transport(self):
transport = _make_cloud_transport(name="existing-pool")
@@ -368,6 +373,7 @@ class TestEphemeralCleanup:
def _select_fleet(self, monkeypatch):
monkeypatch.setattr(Sandbox, "_uses_fleet", staticmethod(lambda api_key: api_key is None))
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_destroys_on_normal_exit(self):
claimed = _managed_sandbox()
with patch("cua_sandbox._autopool.acquire", new=AsyncMock(return_value=claimed)):
@@ -380,6 +386,7 @@ class TestEphemeralCleanup:
claimed.close.assert_awaited_once()
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_destroys_on_test_failure(self):
claimed = _managed_sandbox()
with patch("cua_sandbox._autopool.acquire", new=AsyncMock(return_value=claimed)):
@@ -393,6 +400,7 @@ class TestEphemeralCleanup:
claimed.close.assert_awaited_once()
+ @pytest.mark.skip(reason="Cua Cloud has ended (CUA-1854)")
async def test_ephemeral_propagates_claim_failure(self):
acquire = AsyncMock(side_effect=httpx.ReadTimeout("poll timed out"))
with patch("cua_sandbox._autopool.acquire", new=acquire):
diff --git a/samples/openkoalabot-example-tauri/README.md b/samples/openkoalabot-example-tauri/README.md
index b900f98be3..61db097fa0 100644
--- a/samples/openkoalabot-example-tauri/README.md
+++ b/samples/openkoalabot-example-tauri/README.md
@@ -55,7 +55,7 @@ SDK call, `Spaces::create(SpaceCreate { on, image, kind, runtime, name, .. })`:
| Where | `on` | `kind` / `runtime` |
|---|---|---|
| This machine | `local` | container / `auto` (gVisor when available), vm / `qemu`, vm / `lume`; plus `cpus`, `memory_mb` |
-| Cua Cloud | `cloud` | container / `gvisor`, vm / `kubevirt`. Needs `cua auth login` (or `CUA_CLIENT_ID`/`CUA_CLIENT_SECRET`); metered until deleted. |
+| Cua Cloud | `cloud` | Ended: a cloud plan fails with "Cua Cloud has ended; use a local sandbox or your own machine". Create the Space on This machine instead. |
**Add by address** (in the wizard footer or the empty state) registers a
machine that already runs cua-spacesd, for example a local container:
diff --git a/samples/openkoalabot-example-tauri/src-tauri/core/src/error.rs b/samples/openkoalabot-example-tauri/src-tauri/core/src/error.rs
index 137799be57..260ad7d9ba 100644
--- a/samples/openkoalabot-example-tauri/src-tauri/core/src/error.rs
+++ b/samples/openkoalabot-example-tauri/src-tauri/core/src/error.rs
@@ -10,7 +10,8 @@ pub enum Error {
/// teleport refused, timeout, transport, ...).
#[error(transparent)]
Spaces(#[from] cua_spaces::Error),
- /// Cua Cloud could not be configured (credentials; see `cua auth login`).
+ /// The Cua Cloud client could not be configured. Cua Cloud has ended, so
+ /// nothing in the app creates on it any more.
#[error("Cua Cloud: {0}")]
Cloud(#[from] cua_fleet::Error),
/// Local I/O.
diff --git a/samples/openkoalabot-example-tauri/src-tauri/core/src/lib.rs b/samples/openkoalabot-example-tauri/src-tauri/core/src/lib.rs
index 4aa70cd7a6..558d6a5535 100644
--- a/samples/openkoalabot-example-tauri/src-tauri/core/src/lib.rs
+++ b/samples/openkoalabot-example-tauri/src-tauri/core/src/lib.rs
@@ -55,9 +55,10 @@ pub struct CoreConfig {
pub spaces_home: PathBuf,
/// Where `download` lands.
pub download_dir: PathBuf,
- /// Connect to Cua Cloud with credentials from the environment
- /// (`CUA_CLIENT_ID`/`SECRET` or `FLEETS_TOKEN`), which enables
- /// [`Core::create_cloud_space`].
+ /// Connect a Cua Cloud client from the environment
+ /// (`CUA_CLIENT_ID`/`SECRET` or `FLEETS_TOKEN`). Cua Cloud has ended, so
+ /// [`Core::create_cloud_space`] still fails with
+ /// [`cua_sandbox_core::CLOUD_ENDED`] whatever the credentials.
pub cloud_from_env: bool,
/// spacesd handshake timeout.
pub probe_timeout: Duration,
@@ -104,7 +105,8 @@ impl CoreConfig {
self
}
- /// Enable Cua Cloud with credentials from the environment.
+ /// Read Cua Cloud credentials from the environment. Cua Cloud has ended:
+ /// cloud creates fail with [`cua_sandbox_core::CLOUD_ENDED`] either way.
pub fn with_cloud_from_env(mut self, on: bool) -> Self {
self.cloud_from_env = on;
self
@@ -182,8 +184,9 @@ impl Core {
}
// #endregion docs:rs-add
- /// Creates a Space in the cloud (metered): the image's registry
- /// manifest decides the kind and engine.
+ /// Creates a Space in the cloud. Cua Cloud has ended: this always fails
+ /// with [`cua_sandbox_core::CLOUD_ENDED`]; create it on this machine
+ /// instead ([`Core::create_space`] with [`plan::Target::Local`]).
pub async fn create_cloud_space(
&self,
image: Option<String>,
@@ -203,7 +206,8 @@ impl Core {
}
/// Creates a Space from the New Space wizard's plan: one
- /// `Spaces::create` call, locally (free) or in the cloud (metered); see
+ /// `Spaces::create` call. A local plan creates the Space on this machine;
+ /// a cloud plan fails with [`cua_sandbox_core::CLOUD_ENDED`]; see
/// [`plan::plan_call`].
pub async fn create_space(&self, plan: &plan::SpacePlan) -> Result<SpaceInfo> {
let create = plan::plan_call(plan)?;
diff --git a/samples/openkoalabot-example-tauri/src-tauri/core/src/plan.rs b/samples/openkoalabot-example-tauri/src-tauri/core/src/plan.rs
index 22b4191fcc..603b76e797 100644
--- a/samples/openkoalabot-example-tauri/src-tauri/core/src/plan.rs
+++ b/samples/openkoalabot-example-tauri/src-tauri/core/src/plan.rs
@@ -11,7 +11,7 @@
//! | Where | Call |
//! |---|---|
//! | This machine | `Spaces::create(SpaceCreate { on: local, image, kind, runtime, name, cpus, memory_mb, spacesd })` |
-//! | Cua Cloud | `Spaces::create(SpaceCreate { on: cloud, image, kind, runtime, name, spacesd })` |
+//! | Cua Cloud | `Spaces::create(SpaceCreate { on: cloud, image, kind, runtime, name, spacesd })`; Cua Cloud has ended, so it fails with `CLOUD_ENDED` |
//!
//! `kind` comes from the entry's `variant` (container or vm) and `runtime`
//! from its `local` (container: auto, gVisor when available; qemu; lume) or
diff --git a/samples/openkoalabot-example-tauri/src-tauri/core/tests/plan.rs b/samples/openkoalabot-example-tauri/src-tauri/core/tests/plan.rs
index b343cae896..b8b6872978 100644
--- a/samples/openkoalabot-example-tauri/src-tauri/core/tests/plan.rs
+++ b/samples/openkoalabot-example-tauri/src-tauri/core/tests/plan.rs
@@ -3,13 +3,13 @@
//! `Core::create_space` reaches the SDK with the call the wizard planned:
//! a recording fake `LocalRuntime` (no container, VM or network) sees the
-//! prefixed image and the resources, and a cloud plan without cloud
-//! credentials names the missing capability instead of creating anything.
+//! prefixed image and the resources, and a cloud plan fails with the one
+//! "Cua Cloud has ended" message instead of creating anything.
use async_trait::async_trait;
use cua_sandbox_core::{
- InstanceStatus, LocalEndpoints, LocalInstance, LocalRuntime, LocalStartSpec, LocalSummary,
- RuntimeError,
+ CLOUD_ENDED, InstanceStatus, LocalEndpoints, LocalInstance, LocalRuntime, LocalStartSpec,
+ LocalSummary, RuntimeError,
};
use openkoalabot_example_core::plan::{SpacePlan, Target};
use openkoalabot_example_core::{Core, CoreConfig};
@@ -107,14 +107,15 @@ async fn a_local_plan_without_a_local_runtime_is_refused() {
}
#[tokio::test]
-async fn a_cloud_plan_without_credentials_names_the_missing_credentials() {
+async fn a_cloud_plan_fails_because_cua_cloud_has_ended() {
let dir = tempfile::tempdir().unwrap();
let core = Core::new(CoreConfig::in_dir(dir.path())).unwrap();
let err = core
.create_space(&plan("ghcr.io/trycua/linux:24.04", Target::Cloud))
.await
.unwrap_err();
- assert!(err.to_string().contains("CUA_CLIENT_ID"), "{err}");
+ assert_eq!(err.to_string(), CLOUD_ENDED, "{err}");
+ assert!(core.list_spaces().unwrap().is_empty(), "nothing registered");
}
#[tokio::test]
diff --git a/samples/openkoalabot-example-tauri/ui/src/Wizard.tsx b/samples/openkoalabot-example-tauri/ui/src/Wizard.tsx
index dcc1fb6c2b..7309b9a9dc 100644
--- a/samples/openkoalabot-example-tauri/ui/src/Wizard.tsx
+++ b/samples/openkoalabot-example-tauri/ui/src/Wizard.tsx
@@ -164,7 +164,7 @@ export function Wizard(props: {
{!props.cloud && (
<div className="note warn">
<Alert />
- <span>Cua Cloud is not signed in. Run `cua auth login` (or set CUA_CLIENT_ID and CUA_CLIENT_SECRET) and restart the app.</span>
+ <span>Cua Cloud has ended. Create this Space on This machine instead.</span>
</div>
)}
</>
diff --git a/scripts/docs-generators/cli-specs/cb.json b/scripts/docs-generators/cli-specs/cb.json
index 470becc5f0..f3414585fc 100644
--- a/scripts/docs-generators/cli-specs/cb.json
+++ b/scripts/docs-generators/cli-specs/cb.json
@@ -15,7 +15,7 @@
"subcommands": [
{
"abstract": "Run one task variant",
- "after_help": "Examples:\n # Run variant 0 with the oracle solution\n cb run task ./tasks/hello_file_env\n\n # Run variant 2 with an agent in the cloud\n cb run task ./tasks/hello_file_env --variant-id 2 --agent cua-agent --model anthropic/claude-sonnet-4-20250514 --on cloud\n\n # Show what would run without starting a sandbox\n cb run ./tasks/hello_file_env --dry-run",
+ "after_help": "Examples:\n # Run variant 0 with the oracle solution\n cb run task ./tasks/hello_file_env\n\n # Run variant 2 with an agent on this machine\n cb run task ./tasks/hello_file_env --variant-id 2 --agent cua-agent --model anthropic/claude-sonnet-4-20250514 --on local\n\n # Show what would run without starting a sandbox\n cb run ./tasks/hello_file_env --dry-run",
"arguments": [
{
"default_value": null,
@@ -199,7 +199,7 @@
"aliases": [],
"default_value": null,
"env": null,
- "help": "Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
+ "help": "Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
"hidden": false,
"is_optional": true,
"multiple_values": false,
@@ -704,7 +704,7 @@
"aliases": [],
"default_value": null,
"env": null,
- "help": "Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
+ "help": "Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
"hidden": false,
"is_optional": true,
"multiple_values": false,
@@ -1307,7 +1307,7 @@
"aliases": [],
"default_value": null,
"env": null,
- "help": "Where sandboxes run: local (this machine), cloud, your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
+ "help": "Where sandboxes run: local (this machine), your own cloud account (aws, gcp, modal; connect it first with `cua cloud connect <provider>`), or a contrib provider (e2b, daytona; needs a cua SDK built with contrib and the provider's key). Default: CUA_DEFAULT_ON, else `cua config set default.on`, else local",
"hidden": false,
"is_optional": true,
"multiple_values": false,
@@ -2728,7 +2728,7 @@
]
},
{
- "abstract": "Sign in for --on cloud (runs `cua auth login`)",
+ "abstract": "Removed: Cua Cloud has ended",
"after_help": "Examples:\n # Sign in with a browser\n cb login\n\n # Print the sign-in URL instead of opening a browser\n cb login --no-browser",
"arguments": [],
"flags": [
diff --git a/scripts/docs-generators/examples/cua-sdk/python/Pool.apply.py b/scripts/docs-generators/examples/cua-sdk/python/Pool.apply.py
deleted file mode 100644
index 35d4aa7b4d..0000000000
--- a/scripts/docs-generators/examples/cua-sdk/python/Pool.apply.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# docs: test="docs" prelude="fakefleet"
-import asyncio
-
-from cua_sandbox import CloudOptions, Image, Pool, PoolOptions, Sandbox, SandboxSpec
-
-
-async def main():
- pool = await Pool.apply("my-team-linux", SandboxSpec(image=Image.linux()), PoolOptions(replicas=2))
- sb = await Sandbox.create(cloud=CloudOptions(pool=pool)) # or CloudOptions(pool="my-team-linux")
- print(sb.id)
- await sb.destroy()
- await pool.delete()
-
-
-asyncio.run(main())
diff --git a/scripts/docs-generators/headers/cua-sdk/python/image.md b/scripts/docs-generators/headers/cua-sdk/python/image.md
index 40cdb9d453..9cfe89534f 100644
--- a/scripts/docs-generators/headers/cua-sdk/python/image.md
+++ b/scripts/docs-generators/headers/cua-sdk/python/image.md
@@ -1 +1 @@
-Builder methods add layers and return a new `Image`. Locally, a container image is built into your container engine before boot; in the cloud the same layers run as a remote build. Both are cached by content. Layers a build cannot run (`brew_install`, `choco_install`, ...) are applied after boot through cua-spacesd, so they need an image that runs it.
+Builder methods add layers and return a new `Image`. Locally, a container image is built into your container engine before boot; it is cached by content. Layers a build cannot run (`brew_install`, `choco_install`, ...) are applied after boot through cua-spacesd, so they need an image that runs it.
diff --git a/scripts/docs-generators/headers/cua-sdk/python/index.md b/scripts/docs-generators/headers/cua-sdk/python/index.md
index d9e3e4d2c4..00c6c6c7b3 100644
--- a/scripts/docs-generators/headers/cua-sdk/python/index.md
+++ b/scripts/docs-generators/headers/cua-sdk/python/index.md
@@ -9,8 +9,6 @@
| Variable | Purpose | Default |
| --- | --- | --- |
-| `FLEETS_TOKEN` | Cloud bearer token; wins over client credentials | None |
-| `CUA_CLIENT_ID`, `CUA_CLIENT_SECRET` | Cloud OAuth client credentials | None; then the `cua auth login` session |
-| `CUA_FLEET_BASE_URL`, `CUA_TOKEN_URL` | Cloud API and token endpoints | `https://run.cua.ai`, the cua.ai token endpoint |
-| `CUA_FLEET_MAX_POOL_SIZE`, `CUA_FLEET_CLAIM_TTL`, `CUA_FLEET_WARM`, `CUA_FLEET_POOL_IDLE_GC` | Cloud capacity defaults (`CUA_FLEET_POOL_IDLE_GC=off` disables idle cleanup) | 10, 15 min, warm for canonical images, 30 min |
+| `CUA_CLIENT_ID`, `CUA_CLIENT_SECRET` | API key credentials | None; then the `cua auth login` session |
+| `CUA_TOKEN_URL` | Token endpoint | The cua.ai token endpoint |
| `CUA_IMAGE_LINUX`, `CUA_IMAGE_WINDOWS`, `CUA_IMAGE_MACOS` | Override `Image.linux()`, `Image.windows()`, `Image.macos()` | The canonical images |
diff --git a/scripts/docs-generators/headers/cua-sdk/python/pool.md b/scripts/docs-generators/headers/cua-sdk/python/pool.md
index d9617656e6..0043e9c686 100644
--- a/scripts/docs-generators/headers/cua-sdk/python/pool.md
+++ b/scripts/docs-generators/headers/cua-sdk/python/pool.md
@@ -1 +1 @@
-Most programs never touch pools: a cloud `Sandbox.create` claims from a pool the SDK manages per image and shape (`cua-auto-*`), tuned with `CloudOptions`. A named `Pool` is dedicated capacity you size and own; `Sandbox.create(cloud=CloudOptions(pool=...))` claims from it, and fields that differ from its template raise `PoolSpecMismatch`.
+Pools and `CloudOptions` belonged to Cua Cloud, which has ended. Every call here fails with a clear error, and the module is removed in `cua-sandbox` 0.10.0.
diff --git a/scripts/docs-generators/headers/cua-sdk/python/sandbox.md b/scripts/docs-generators/headers/cua-sdk/python/sandbox.md
index d44f096c69..389e255fbd 100644
--- a/scripts/docs-generators/headers/cua-sdk/python/sandbox.md
+++ b/scripts/docs-generators/headers/cua-sdk/python/sandbox.md
@@ -1 +1 @@
-Local is the default: `Sandbox.create(image)` runs on this machine, `local=False` or `cloud=CloudOptions(...)` in the cloud, and every other parameter means the same on both. `Sandbox.connect(name)` and the class methods take `local=None`: the local sandbox of that name when one exists, else the cloud.
+Local is the default: `Sandbox.create(image)` runs on this machine, `on="aws"`, `"gcp"` or `"modal"` in your own cloud. `local=False` and `cloud=CloudOptions(...)` meant Cua Cloud, which has ended: they fail with a clear error and are removed in `cua-sandbox` 0.10.0. `Sandbox.connect(name)` and the class methods take `local=None`: the local sandbox of that name when one exists.
diff --git a/scripts/docs-generators/headers/cua-sdk/runtime-support.md b/scripts/docs-generators/headers/cua-sdk/runtime-support.md
index fa47690bac..5ded71ed9f 100644
--- a/scripts/docs-generators/headers/cua-sdk/runtime-support.md
+++ b/scripts/docs-generators/headers/cua-sdk/runtime-support.md
@@ -3,23 +3,21 @@
## Operating systems and image kinds
-The same image reference runs locally (`local=True`, or `cua sb create`) and in
-the cloud. The resolver picks the variant each backend runs; the guest OS can
-still differ in format, backend and available operations between the two.
+The resolver picks the variant each local backend runs (`local=True`, or
+`cua sb create`).
-| Image input | Guest and kind | Local backend | Cloud |
-| --- | --- | --- | --- |
-| `Image.linux()` | `ghcr.io/trycua/linux:24.04` rootfs (amd64, arm64) | Docker or Podman; gVisor when the engine has `runsc`, else `runc` | gVisor; warm by default |
-| `Image.linux(kind='vm')` | `ghcr.io/trycua/linux:24.04-disk` containerDisk | QEMU (`cua runtime setup qemu` installs it); raises when QEMU is missing | KubeVirt |
-| `Image.windows()` | `ghcr.io/trycua/windows:2022-disk` containerDisk | Hyper-V on a Windows host that has it, else QEMU | KubeVirt, EFI; warm by default |
-| `Image.windows('11')` | Windows 11 VM | Local ISO installation | Rejected |
-| `Image.macos()` / `Image.macos('15')` | `ghcr.io/trycua/macos:26` / `:15` Lume VM | Lume on Apple silicon | Rejected |
-| `Image.android()` | Android 14 | Legacy Android emulator adapter | Rejected |
-| `Image.from_registry(ref)` | Any OCI image: rootfs, containerDisk or Lume | Rootfs as a container, containerDisk on QEMU, Lume image on Lume | Rootfs on gVisor, containerDisk on KubeVirt; amd64 only |
-| `Image.from_file(...)` | Disk or ISO | QEMU (or Hyper-V) | Rejected |
-
-Not supported locally: macOS containers and macOS images that are not Lume images. The
-cloud runs amd64 only, so a Linux image must have an amd64 variant. With no
+| Image input | Guest and kind | Local backend |
+| --- | --- | --- |
+| `Image.linux()` | `ghcr.io/trycua/linux:24.04` rootfs (amd64, arm64) | Docker or Podman; gVisor when the engine has `runsc`, else `runc` |
+| `Image.linux(kind='vm')` | `ghcr.io/trycua/linux:24.04-disk` containerDisk | QEMU (`cua runtime setup qemu` installs it); raises when QEMU is missing |
+| `Image.windows()` | `ghcr.io/trycua/windows:2022-disk` containerDisk | Hyper-V on a Windows host that has it, else QEMU |
+| `Image.windows('11')` | Windows 11 VM | Local ISO installation |
+| `Image.macos()` / `Image.macos('15')` | `ghcr.io/trycua/macos:26` / `:15` Lume VM | Lume on Apple silicon |
+| `Image.android()` | Android 14 | Legacy Android emulator adapter |
+| `Image.from_registry(ref)` | Any OCI image: rootfs, containerDisk or Lume | Rootfs as a container, containerDisk on QEMU, Lume image on Lume |
+| `Image.from_file(...)` | Disk or ISO | QEMU (or Hyper-V) |
+
+Not supported locally: macOS containers and macOS images that are not Lume images. With no
container engine the managed runtime VM is not available yet; install Colima or
Docker Engine. See [Manage local runtimes](/cua-sdk/guides/local-runtimes#check-and-set-up-the-host).
@@ -28,38 +26,36 @@ The canonical images are generated from the SDK source:
{/* GENERATED:sandbox-builtin-mappings:start */}
{/* GENERATED:sandbox-builtin-mappings:end */}
-The resolver pins them by digest on both sides. Override one with
+The resolver pins them by digest. Override one with
`CUA_IMAGE_LINUX`, `CUA_IMAGE_WINDOWS` or `CUA_IMAGE_MACOS`.
### Windows firmware
-Cloud templates for `image.os_type == 'windows'` use `Firmware.EFI`.
-`Image.from_registry()` defaults to `os_type='linux'` and does not inspect the
+A Windows image uses `Firmware.EFI`. `Image.from_registry()` defaults to `os_type='linux'` and does not inspect the
disk, so pass `os_type='windows', kind='vm'` for a Windows containerDisk.
## Image customization
-| Operation | Local | Cloud |
-| --- | --- | --- |
-| Layers: `apt_install()`, `pip_install()`, `uv_install()`, `run()`, `env()`, `copy()` | Container image: built into the local engine before boot, cached by content. VM image: applied after boot through cua-spacesd (else `Unsupported`) | Remote build on the image as base, cached by content (not available yet) |
-| Other layers: `brew_install()`, `choco_install()`, `winget_install()`, `app_install()`, ... | Applied after boot through cua-spacesd (for example `Image.linux()`); `Unsupported` on an image without it | `Unsupported` (a `NotImplementedError`) |
-| `expose()` | Forwarded to a free host port, reported in `sb.exposed_ports` | Declares the service `port-N` |
-| `Image.from_registry(ref, secret=...)` | Authenticated pull | Registry pull secret for the sandbox and its sidecars |
-| `Sandbox.snapshot()` | Not implemented | Not implemented; snapshot-derived images are rejected |
-
-Cloud layers fail with a clear error until Fleet builds images. `cua image build` and `cua image push` build and
-publish an image both sides can use. See
+| Operation | Local |
+| --- | --- |
+| Layers: `apt_install()`, `pip_install()`, `uv_install()`, `run()`, `env()`, `copy()` | Container image: built into the local engine before boot, cached by content. VM image: applied after boot through cua-spacesd (else `Unsupported`) |
+| Other layers: `brew_install()`, `choco_install()`, `winget_install()`, `app_install()`, ... | Applied after boot through cua-spacesd (for example `Image.linux()`); `Unsupported` on an image without it |
+| `expose()` | Forwarded to a free host port, reported in `sb.exposed_ports` |
+| `Image.from_registry(ref, secret=...)` | Authenticated pull |
+| `Sandbox.snapshot()` | Not implemented |
+
+`cua image build` and `cua image push` build and publish an image to reuse. See
[Choose and build an image](/cua-sdk/guides/images).
## Workloads, ports and sidecars
-| Option | Local | Cloud |
-| --- | --- | --- |
-| `command=` | Container entrypoint, or run by cloud-init in a Linux VM | Template command with `processMode: Run` (container and VM images) |
-| `env=` | Container environment or cloud-init | Template environment with `processMode: Run` (VM images: single-line values) |
-| `services=`, `wait_for=` | Published loopback ports; probes | Gateway services; probes |
-| `sidecars=` | Extra containers sharing the network namespace, reached by name or `localhost`; needs `runtime="runc"` where gVisor would run | Container images: extra containers in the gVisor pod. VM images: a companion gVisor pod named in the guest's `/etc/hosts` |
-| VM sandboxes with `sidecars=` | Refused | Supported (companion pod) |
+| Option | Local |
+| --- | --- |
+| `command=` | Container entrypoint, or run by cloud-init in a Linux VM |
+| `env=` | Container environment or cloud-init |
+| `services=`, `wait_for=` | Published loopback ports; probes |
+| `sidecars=` | Extra containers sharing the network namespace, reached by name or `localhost`; needs `runtime="runc"` where gVisor would run |
+| VM sandboxes with `sidecars=` | Refused |
Sidecars are reached by name on every runtime: the sandbox reaches `db:6379`,
and a sidecar reaches the sandbox at `main`. With sidecars the service names
@@ -71,12 +67,12 @@ CLI), and fails fast when the sandbox exits. The computer interfaces use
cua-spacesd on 3211 when the image has it; the SDK reports the `env`
service only for images that do.
-### Cloud guest services
+### Guest services
-| Service | Template behavior | Guest requirement |
+| Service | Behavior | Guest requirement |
| --- | --- | --- |
| `env` | Published on port 3211 when the image has cua-spacesd | cua-spacesd, for the computer interfaces and `sb.spacesd()` |
-| Names in `services=` | One gateway service per name | Your process listening on that port |
+| Names in `services=` | One service per name | Your process listening on that port |
| `port-N` | Added by `.expose(N)` | The application listening on `N` |
| `server` | Added by the older `server_port=` | Your own daemon on that port |
@@ -88,13 +84,11 @@ Declaring a service does not install or start it. For an example layout, see the
| Sandbox | Computer interfaces | `sb.tunnel.forward()` | `sb.service()`, `public_url()`, `mcp()` |
| --- | --- | --- | --- |
| Local (container, QEMU, Lume) | spacesd, else QMP or VNC fallback | Loopback TCP listener | Yes; public URLs through the cua daemon |
-| Cloud | spacesd through the gateway (gRPC-Web) | Loopback listener (spacesd tunnel, else gateway proxy for a declared service) | Yes; public URLs are signed service URLs |
| Direct `Sandbox.connect(url=...)` | spacesd | spacesd tunnel | No declared services |
| Legacy adapters (Android ADB, OSWorld, Tart, Hyper-V) | Adapter-specific | ADB forwards ports and Android sockets | Adapter-specific |
-Cloud service URLs require authentication unless you create a public URL. See
-[Set up cloud credentials](/cua-sdk/guides/cloud) and
-[Sandbox interfaces](/cua-sdk/reference/python/interfaces).
+For sandboxes in your own cloud, see [Use your own cloud](/cua-sdk/guides/your-cloud)
+and [Sandbox interfaces](/cua-sdk/reference/python/interfaces).
## Evidence and limits
@@ -105,7 +99,7 @@ versions inside a particular deployed image.
{/* GENERATED:sandbox-evidence:start */}
{/* GENERATED:sandbox-evidence:end */}
-Verification covers source and offline contract checks, not provisioned cloud
-boots, authenticated service requests, or local VM and container boots on every
+Verification covers source and offline contract checks, not provisioned
+cloud boots, authenticated service requests, or local VM and container boots on every
host. Recipe observations, such as the [Windows Minecraft workflow](/cua-sdk/guides/agent-frameworks),
describe their own tested environment.
diff --git a/scripts/docs-generators/headers/cua-sdk/sandbox.md b/scripts/docs-generators/headers/cua-sdk/sandbox.md
index 422eec0ff6..9e0d162cfe 100644
--- a/scripts/docs-generators/headers/cua-sdk/sandbox.md
+++ b/scripts/docs-generators/headers/cua-sdk/sandbox.md
@@ -3,7 +3,7 @@ A sandbox's `id()` is its ref, and every call that takes a sandbox name accepts
| Ref | Meaning |
| --- | --- |
| `local:<name>` | A sandbox on this machine |
-| `cloud:<name>` | A cloud sandbox |
+| `aws:<name>` | A sandbox in your own cloud (`gcp:` and `modal:` the same way) |
| `direct:<host:port>` | A machine reached by address |
| `relay:<machine-id>` | An account machine reached through the relay (a Space) |
| `<name>` | A bare name, searched across locations; `AmbiguousSandbox` when it matches more than one |
diff --git a/scripts/docs-generators/headers/cua-sdk/services.md b/scripts/docs-generators/headers/cua-sdk/services.md
index 470809e80a..f258c33325 100644
--- a/scripts/docs-generators/headers/cua-sdk/services.md
+++ b/scripts/docs-generators/headers/cua-sdk/services.md
@@ -1,6 +1,6 @@
| To reach a guest port | Use | Works |
| --- | --- | --- |
-| From your code, by name | `sandbox.service(name).request(...)` or `.url()` | Declared services, locally and in the cloud |
+| From your code, by name | `sandbox.service(name).request(...)` or `.url()` | Declared services |
| From local tools (a browser, a client) | `sandbox.forward(port)` | Any port; a loopback listener |
| From someone else | `sandbox.public_url(service, ttl_seconds, label)` | Declared services; a bearer URL that expires |
| From an MCP client | `sandbox.mcp_config(service, path)` or `sandbox.mcp(service, path)` | An MCP server behind a declared service |
diff --git a/scripts/docs-generators/sandbox.ts b/scripts/docs-generators/sandbox.ts
index 96a688bbdf..573ffc8208 100644
--- a/scripts/docs-generators/sandbox.ts
+++ b/scripts/docs-generators/sandbox.ts
@@ -797,7 +797,7 @@ export function generateDocuments(): Map<string, string> {
RUNTIME_DOC,
page(
'Runtime support',
- 'Which images run on which local runtime or in the cloud, what customization each accepts, and how ports reach them.',
+ 'Which images run on which local runtime, what customization each accepts, and how ports reach them.',
runtime
),
],
diff --git a/tests/e2e/cua-sdk/python/e2e.py b/tests/e2e/cua-sdk/python/e2e.py
index 979c6addd0..8fe0c7651d 100644
--- a/tests/e2e/cua-sdk/python/e2e.py
+++ b/tests/e2e/cua-sdk/python/e2e.py
@@ -104,6 +104,27 @@ def env_token_command(token: str) -> list[str]:
]
+# Cua Cloud has ended: `Cua.fleet()` and every cloud create fail with this
+# message (`CLOUD_ENDED` in cua-sandbox-core). The live Fleet lanes skip with
+# CLOUD_ENDED_SKIP, which run.py allows under --strict.
+CLOUD_ENDED = "Cua Cloud has ended"
+CLOUD_ENDED_SKIP = "Cua Cloud has ended (CUA-1854): there is no live Fleet lane"
+
+
+async def assert_cloud_ended(c: "cua.Cua", **create: Any) -> None:
+ """``c.fleet()`` and a cloud create (``on="cloud"``, plus ``create``'s
+ options) fail with the one `Unsupported` message, even when ``c`` holds
+ Fleet credentials; nothing is created."""
+ import pytest
+
+ with pytest.raises(cua.CuaError.Unsupported, match=CLOUD_ENDED):
+ c.fleet()
+ options = cua.SandboxCreateOptions(on="cloud", image="registry.test/cua-e2e:fake", **create)
+ with pytest.raises(cua.CuaError.Unsupported, match=CLOUD_ENDED):
+ await c.sandboxes().create(options)
+ assert not any(s.location == "cloud" for s in await c.sandboxes().list(None))
+
+
def lane_enabled(lane: str) -> Optional[str]:
"""``None`` when ``lane`` can run here, else the skip reason."""
flag = lambda v: os.environ.get(v) == "1" # noqa: E731
@@ -117,22 +138,9 @@ def lane_enabled(lane: str) -> Optional[str]:
return None if flag("CUA_E2E_QEMU") else "set CUA_E2E_QEMU=1 for the QEMU lane"
if lane == "lume":
return None if flag("CUA_E2E_LUME") else "set CUA_E2E_LUME=1 for the Lume lane"
- if lane == "fleet":
- if not flag("CUA_E2E_FLEET"):
- return "set CUA_E2E_FLEET=1 for live Fleet"
- if not (os.environ.get("FLEETS_TOKEN") or os.environ.get("CUA_CLIENT_ID")):
- return "no Fleet credentials (CUA_CLIENT_ID/SECRET or FLEETS_TOKEN)"
- return None
- if lane == "fleet-env":
- why = lane_enabled("fleet")
- if why:
- return why
- if not os.environ.get("CUA_E2E_FLEET_ENV_IMAGE"):
- return (
- "CUA_E2E_FLEET_ENV_IMAGE is unset: no linux (spacesd) image "
- "in a registry Fleet can pull"
- )
- return None
+ if lane in ("fleet", "fleet-env"):
+ # Cua Cloud has ended (CUA-1854): there is no live Fleet to run on.
+ return CLOUD_ENDED_SKIP
if lane == "docs":
return None
if lane == "contrib":
diff --git a/tests/e2e/cua-sdk/python/test_cua_sandbox_guides.py b/tests/e2e/cua-sdk/python/test_cua_sandbox_guides.py
index eca86bd2f7..a9526f1d86 100644
--- a/tests/e2e/cua-sdk/python/test_cua_sandbox_guides.py
+++ b/tests/e2e/cua-sdk/python/test_cua_sandbox_guides.py
@@ -1,15 +1,15 @@
"""cua-sandbox lane: the guides' own public API (``cua_sandbox.Pool``,
``Image``, ``ClaimSpec``, ``Sandbox.ephemeral``) on top of the cua SDK.
-Gated by CUA_E2E_CUA_SANDBOX=1 because cua-sandbox is being rewritten as a
-thin wrapper over ``cua``; enable the lane after that merge. Each check runs
-in the docs venv (repo cua-sandbox) as a subprocess. Fleet: the fake Fleet
-API by default (hermetic), live Fleet when CUA_E2E_FLEET=1.
+Cua Cloud has ended (CUA-1854): every ``Pool`` call raises
+``cua_sandbox._ended.CloudEnded``, so each check asserts that instead of a
+Fleet round trip. Gated by CUA_E2E_CUA_SANDBOX=1 because cua-sandbox is being
+rewritten as a thin wrapper over ``cua``; enable the lane after that merge.
+Each check runs in the docs venv (repo cua-sandbox) as a subprocess.
"""
from __future__ import annotations
-import os
import subprocess
import textwrap
@@ -18,17 +18,6 @@ import pytest
from test_docs_blocks import _env, sandbox_python # noqa: F401 (session fixture)
-def _fleet_env(fixtures) -> dict:
- if os.environ.get("CUA_E2E_FLEET") == "1":
- return {}
- return {
- "CUA_FLEET_BASE_URL": fixtures["fleet_base_url"],
- "FLEETS_TOKEN": fixtures["fleet_token"],
- "CUA_CLIENT_ID": "",
- "CUA_CLIENT_SECRET": "",
- }
-
-
def _run(py: str, code: str, env: dict, timeout: int = 1800) -> str:
out = subprocess.run(
[py, "-c", textwrap.dedent(code)],
@@ -41,72 +30,49 @@ def _run(py: str, code: str, env: dict, timeout: int = 1800) -> str:
return out.stdout
[email protected]("expire-pools-and-claims", "cua-sandbox")
-def test_spec_and_ttl_together_is_value_error(sandbox_python, fixtures):
- pool = e2e.name("cs-ttl")
+def _expect_cloud_ended(py: str, call: str) -> None:
+ """Runs ``call`` (an awaitable expression on ``Pool``) in the docs venv
+ and checks it raises ``CloudEnded`` with the one message."""
_run(
- sandbox_python,
+ py,
f"""
import asyncio
- from cua_sandbox import ClaimSpec, Image, Pool
+ from cua_sandbox import Image, Pool, WarmPoolAutoscaling
+ from cua_sandbox._ended import CloudEnded
async def main():
- pool = await Pool.apply(Image.from_registry({e2e.LEGACY_FLEET_ROOTFS!r}), name={pool!r},
- replicas=1, cpu=1, memory_mb=1024, ttl_seconds_after_created=3600)
try:
- spec = ClaimSpec(sandbox_template_ref=pool.resource.spec.sandbox_template_ref, warmpool=None,
- bind_deadline=None, lifecycle=None, ttl_seconds_after_created=3600)
- try:
- async with pool.claim(spec=spec, ttl_seconds_after_created=60):
- raise SystemExit("claim with spec + ttl must raise ValueError")
- except ValueError as e:
- print("ValueError:", e)
- finally:
- await pool.delete()
+ await {call}
+ except CloudEnded as e:
+ assert "Cua Cloud has ended" in str(e), e
+ return
+ raise SystemExit("expected CloudEnded")
asyncio.run(main())
""",
- _fleet_env(fixtures),
+ {},
)
[email protected]("create-pool", "cua-sandbox")
-def test_autoscaling_and_ephemeral(sandbox_python, fixtures):
- pool = e2e.name("cs-auto")
- _run(
[email protected]("expire-pools-and-claims", "cua-sandbox")
+def test_pool_apply_with_a_ttl_is_cloud_ended(sandbox_python):
+ pool = e2e.name("cs-ttl")
+ _expect_cloud_ended(
sandbox_python,
- f"""
- import asyncio
- from cua_sandbox import Image, Pool, Sandbox, WarmPoolAutoscaling
- async def main():
- pool = await Pool.apply(Image.from_registry({e2e.LEGACY_FLEET_ROOTFS!r}), name={pool!r}, cpu=1, memory_mb=2048,
- autoscaling=WarmPoolAutoscaling(min_pool_size=0, initial_pool_size=0, max_pool_size=2),
- ttl_seconds_after_created=3600)
- await pool.delete()
- asyncio.run(main())
- """,
- _fleet_env(fixtures),
+ f"Pool.apply(Image.from_registry({e2e.LEGACY_FLEET_ROOTFS!r}), name={pool!r}, "
+ "replicas=1, cpu=1, memory_mb=1024, ttl_seconds_after_created=3600)",
)
@pytest.mark.e2e("create-pool", "cua-sandbox")
-def test_pool_access_denied_on_taken_name(sandbox_python):
- taken = os.environ.get("CUA_E2E_FLEET_TAKEN_POOL")
- if os.environ.get("CUA_E2E_FLEET") != "1" or not taken:
- pytest.skip(
- "needs live Fleet and CUA_E2E_FLEET_TAKEN_POOL (a pool name another account owns)"
- )
- _run(
+def test_pool_apply_with_autoscaling_is_cloud_ended(sandbox_python):
+ pool = e2e.name("cs-auto")
+ _expect_cloud_ended(
sandbox_python,
- f"""
- import asyncio
- from cua_sandbox import Image, Pool, PoolAccessDeniedError
- async def main():
- try:
- await Pool.apply(Image.from_registry({e2e.LEGACY_FLEET_ROOTFS!r}), name={taken!r})
- except PoolAccessDeniedError as e:
- assert "globally unique" in str(e), e
- return
- raise SystemExit("expected PoolAccessDeniedError")
- asyncio.run(main())
- """,
- {},
+ f"Pool.apply(Image.from_registry({e2e.LEGACY_FLEET_ROOTFS!r}), name={pool!r}, cpu=1, "
+ "memory_mb=2048, autoscaling=WarmPoolAutoscaling(min_pool_size=0, "
+ "initial_pool_size=0, max_pool_size=2), ttl_seconds_after_created=3600)",
)
+
+
[email protected]("create-pool", "cua-sandbox")
+def test_pool_get_is_cloud_ended(sandbox_python):
+ _expect_cloud_ended(sandbox_python, f"Pool.get({e2e.name('cs-get')!r})")
diff --git a/tests/e2e/cua-sdk/python/test_daemon_agnostic.py b/tests/e2e/cua-sdk/python/test_daemon_agnostic.py
index 9dd3204c51..cfa4a36044 100644
--- a/tests/e2e/cua-sdk/python/test_daemon_agnostic.py
+++ b/tests/e2e/cua-sdk/python/test_daemon_agnostic.py
@@ -74,32 +74,14 @@ async def _plain_local(
@pytest.mark.e2e("daemon-agnostic", "hermetic")
-def test_agnostic_fake_fleet_and_direct(fixtures, fake_fleet):
+def test_agnostic_cloud_ended_and_direct(fixtures, fake_fleet, local_cua):
async def body():
- pool = e2e.name("agnostic")
- fleet = fake_fleet.fleet()
- await fleet.apply_pool(
- cua.FleetPoolSpec(name=pool, image="img:plain", services={"server": 8000})
- )
- sb = None
- try:
- sb = await fake_fleet.sandboxes().create(
- cua.SandboxCreateOptions(on="cloud", pool=pool, name=f"{pool}-c")
- )
- # NOTE: sb.services() reports the create options' default
- # {"env": 3211}, not the pool's services (SDK bug, see report);
- # env() correctly consults the bound sandbox's services.
- resp = await sb.service("server").request("GET", "/status", None, 5_000)
- assert resp.status == 200
- with pytest.raises(cua.CuaError.SpacesdNotAvailable):
- await sb.spacesd(2_000)
- finally:
- if sb is not None:
- await sb.delete()
- await fleet.delete_pool(pool)
+ # Cua Cloud has ended: no pool, no cloud claim.
+ await e2e.assert_cloud_ended(fake_fleet, pool=e2e.name("agnostic"))
- # Direct URL where no spacesd answers (the fake Fleet API).
- d = await fake_fleet.sandboxes().connect_url(
+ # Direct URL where no spacesd answers (the fake Fleet API's HTTP
+ # server): a typed error, never a hang.
+ d = await local_cua.sandboxes().connect_url(
fixtures["fleet_base_url"], "t", e2e.name("nodriver")
)
with pytest.raises(cua.CuaError.SpacesdNotAvailable):
diff --git a/tests/e2e/cua-sdk/python/test_fleet_guides.py b/tests/e2e/cua-sdk/python/test_fleet_guides.py
index 77156c5d66..79d31a17a7 100644
--- a/tests/e2e/cua-sdk/python/test_fleet_guides.py
+++ b/tests/e2e/cua-sdk/python/test_fleet_guides.py
@@ -1,5 +1,12 @@
"""The Fleet guides, through the cua SDK (``cua``) directly.
+Cua Cloud has ended (CUA-1854): ``Cua.fleet()`` and every ``on="cloud"``
+create fail with the one "Cua Cloud has ended" `Unsupported` error. The
+hermetic tests assert exactly that, even with Fleet credentials (the fake
+Fleet API of ``cua-test-fixtures``). The live ``fleet`` and ``fleet-env``
+lanes skip (``e2e.lane_enabled``); their bodies below are the guides' flows
+and are removed with the Fleet provider.
+
* your-first-cloud-fleet: apply pool -> claim -> ``uname -a`` -> screenshot
PNG -> delete.
* create-fleet-capacity / claim-a-sandbox (formerly create-pool-with-*): warm pool, readiness, named claim
@@ -7,11 +14,6 @@
managed ``cua-auto-*`` pool (the test then GCs that pool), name collision
is a typed error.
* expire-pools-and-claims: pool TTL and claim TTL reach Fleet.
-
-hermetic: the fake Fleet API (+ the MockServer spacesd for the desktop
-steps). fleet: live run.cua.ai with the guides' public legacy image (its
-desktop is computer-server on 8000, reached through the ``server``
-service). fleet-env: live Fleet with the spacesd reference image.
"""
from __future__ import annotations
@@ -27,13 +29,11 @@ import pytest
import cua
-FAKE_IMAGE = "registry.test/cua-e2e:fake"
-
def _is_404(e: Exception) -> bool:
# A Fleet 404, and the 403 live Fleet answers for reads once a pool's
- # namespace is gone, are CuaError.NotFound (test_fleet_404_is_not_found);
- # a delete in a namespace that is already gone still answers 403.
+ # namespace is gone, are CuaError.NotFound; a delete in a namespace that
+ # is already gone still answers 403.
return isinstance(e, cua.CuaError.NotFound) or (
isinstance(e, cua.CuaError.Fleet) and "403" in str(e)
)
@@ -70,10 +70,13 @@ async def _claim_gone(fleet: cua.Fleet, pool: str, claim: str) -> None:
@pytest.mark.e2e("create-pool", "hermetic")
-def test_fleet_404_is_not_found(fake_fleet):
+def test_cloud_ended_fleet_and_pool_creates_fail(fake_fleet):
async def body():
- with pytest.raises(cua.CuaError.NotFound):
- await fake_fleet.fleet().get_pool(e2e.name("missing"))
+ # A named pool, then a managed (warm, autoscaled) one.
+ await e2e.assert_cloud_ended(fake_fleet, pool=e2e.name("pool"), name=e2e.name("claim"))
+ await e2e.assert_cloud_ended(
+ fake_fleet, runtime="gvisor", warm=True, max_pool_size=2, fleet_ttl_seconds=3600
+ )
e2e.run_async(body(), timeout=60)
@@ -162,32 +165,10 @@ async def _ok(fut):
@pytest.mark.e2e("your-first-cloud-fleet", "hermetic")
-def test_first_cloud_fleet_fake(fake_fleet, fixtures):
- async def desktop(sb):
- # The fake gateway cannot host a spacesd; the desktop steps run
- # against the MockServer spacesd by URL.
- assert (await sb.service("server").request("GET", "/status", None, 5_000)).status == 200
- d = await fake_fleet.sandboxes().connect_url(
- fixtures["env_url"], fixtures["env_token"], e2e.name("first-env")
- )
- try:
- env = await d.spacesd(5_000)
- out = await env.run(cua.SpacesdCommand(program="echo", args=["Linux", "mock"]))
- return out.stdout.decode(), (await env.screenshot(None)).image
- finally:
- await d.delete()
-
- print(
- e2e.run_async(
- _first_fleet(
- fake_fleet,
- image=FAKE_IMAGE,
- runtime="kubevirt",
- desktop=desktop,
- services={"server": 8000},
- ),
- timeout=120,
- )
+def test_first_cloud_fleet_is_cloud_ended(fake_fleet):
+ e2e.run_async(
+ e2e.assert_cloud_ended(fake_fleet, pool=e2e.name("first"), name=e2e.name("first-claim")),
+ timeout=60,
)
@@ -357,11 +338,11 @@ async def _gc_managed_pool(fleet: cua.Fleet, pool: str) -> None:
@pytest.mark.e2e("create-pool", "hermetic")
-def test_create_pool_fake(fake_fleet):
+def test_ephemeral_create_is_cloud_ended(fake_fleet):
e2e.run_async(
- _create_pool(fake_fleet, image=FAKE_IMAGE, runtime="gvisor", live=False), timeout=120
+ e2e.assert_cloud_ended(fake_fleet, runtime="gvisor", services={"server": 8000}),
+ timeout=60,
)
- e2e.run_async(_ephemeral(fake_fleet, image=FAKE_IMAGE, runtime="gvisor"), timeout=120)
@pytest.mark.e2e("create-pool", "fleet")
@@ -462,8 +443,8 @@ async def _expire(c: cua.Cua, *, image: str, live: bool) -> None:
@pytest.mark.e2e("expire-pools-and-claims", "hermetic")
-def test_expire_fake(fake_fleet):
- e2e.run_async(_expire(fake_fleet, image=FAKE_IMAGE, live=False), timeout=120)
+def test_expiring_claims_are_cloud_ended(fake_fleet):
+ e2e.run_async(e2e.assert_cloud_ended(fake_fleet, fleet_ttl_seconds=3600), timeout=60)
@pytest.mark.e2e("expire-pools-and-claims", "fleet")
diff --git a/tests/e2e/cua-sdk/python/test_sandbox_parity.py b/tests/e2e/cua-sdk/python/test_sandbox_parity.py
index 94581445dd..d235efdd53 100644
--- a/tests/e2e/cua-sdk/python/test_sandbox_parity.py
+++ b/tests/e2e/cua-sdk/python/test_sandbox_parity.py
@@ -3,18 +3,18 @@ with the same meaning local and in the cloud.
Lanes:
-* hermetic: the fake Fleet admits sidecars like Fleet (on KubeVirt too) and
- refuses the reserved service names ``main`` / ``sidecars`` / ``sc`` with
- sidecars; cloud layer builds fail with the "not deployed yet" error before
- anything is created; a local core create refuses layers on a VM image.
+* hermetic: Cua Cloud has ended, so every cloud create (sidecars, reserved
+ service names, layer builds) fails with the one "Cua Cloud has ended"
+ error before anything is created; a local core create refuses layers on a
+ VM image.
* container: ``python:3.12-slim`` with a ``redis:7-alpine`` sidecar named
``db`` and a ``busybox`` sidecar named ``relay``, through a private
``cua daemon`` on runc. The sandbox reaches ``db:6379`` by name and the
relay reaches the sandbox at ``main``; refused on gVisor without an
explicit runc.
-* fleet: the same group on Fleet gVisor and Fleet KubeVirt (a companion pod),
- plus a ``processMode: Run`` command with ``env`` serving HTTP on both
- runtimes. Pools are garbage-collected in the test.
+* fleet: skipped, Cua Cloud has ended. It ran the same group on Fleet gVisor
+ and Fleet KubeVirt (a companion pod), plus a ``processMode: Run`` command
+ with ``env`` serving HTTP on both runtimes.
"""
from __future__ import annotations
@@ -26,7 +26,6 @@ import pytest
import cua
-KUBEVIRT_IMAGE = "registry.example/workspace@sha256:0123"
ROOTFS_IMAGE = "registry.example/mcp:docker-e2e"
# Live Fleet: a container image for gVisor, the canonical VM disk for
# KubeVirt (its guest has python3 and cloud-init).
@@ -115,58 +114,29 @@ async def _expect_group(sb) -> None:
@pytest.mark.e2e("sandbox-parity", "hermetic")
-def test_parity_admits_sidecars_and_refuses_what_fleet_refuses(fixtures, fake_fleet, tmp_path):
+def test_parity_cloud_ended_and_local_vm_refuses_layers(fixtures, fake_fleet, tmp_path):
async def body():
+ # Cua Cloud has ended: sidecars, reserved service names and cloud
+ # layer builds all fail with the one message, before anything is
+ # created (they used to reach Fleet's admission).
sbx = fake_fleet.sandboxes()
- # With sidecars, main / sidecars / sc are reserved service names.
- for reserved in ("main", "sidecars", "sc"):
- with pytest.raises(cua.CuaError) as err:
- await sbx.create(
- _opts(
- "cloud",
- ROOTFS_IMAGE,
- "parity",
- sidecars=[_redis("db")],
- services={reserved: 6379},
- )
+ for kw in (
+ {"sidecars": [_redis("db")], "services": {"db": 6379}},
+ {"sidecars": [_redis("db")], "services": {"main": 6379}},
+ {"sidecars": [_redis("main")]},
+ {
+ "build": cua.ImageBuild(
+ layers=[cua.ImageLayer.PIP_INSTALL(packages=["mcp"])],
+ env={},
+ ports=[],
+ files=[],
+ timeout_ms=None,
)
- assert "reserved" in str(err.value), err.value
- # A sidecar may not be named main.
- with pytest.raises(cua.CuaError) as err:
- await sbx.create(_opts("cloud", ROOTFS_IMAGE, "parity", sidecars=[_redis("main")]))
- assert "main" in str(err.value), err.value
- # Cloud layers need Fleet's builder, which does not run them yet.
- with pytest.raises(cua.CuaError) as err:
- await sbx.create(
- _opts(
- "cloud",
- ROOTFS_IMAGE,
- "parity",
- build=cua.ImageBuild(
- layers=[cua.ImageLayer.PIP_INSTALL(packages=["mcp"])],
- env={},
- ports=[],
- files=[],
- timeout_ms=None,
- ),
- )
- )
- assert "not deployed yet" in str(err.value), err.value
- assert not await fake_fleet.fleet().pools().list(), "nothing was created"
- # A cloud VM image takes sidecars (Fleet runs them in a companion pod).
- sb = await sbx.create(
- _opts(
- "cloud",
- KUBEVIRT_IMAGE,
- "parity-vm",
- sidecars=[_redis("db")],
- services={"db": 6379},
- )
- )
- try:
- assert sb.info().services.get("db") == 6379
- finally:
- await sb.delete()
+ },
+ ):
+ with pytest.raises(cua.CuaError.Unsupported, match=e2e.CLOUD_ENDED):
+ await sbx.create(_opts("cloud", ROOTFS_IMAGE, "parity", **kw))
+ await e2e.assert_cloud_ended(fake_fleet, sidecars=[_redis("db")])
# Locally, layers build into the container engine (the container
# lane runs that); a VM image takes none, refused before anything runs.
local = cua.embedded(state_dir=str(tmp_path / "local"), fleet_from_env=False)
diff --git a/tests/e2e/cua-sdk/python/test_unified_api.py b/tests/e2e/cua-sdk/python/test_unified_api.py
index 5a08687fa1..d651ee8ee1 100644
--- a/tests/e2e/cua-sdk/python/test_unified_api.py
+++ b/tests/e2e/cua-sdk/python/test_unified_api.py
@@ -12,9 +12,9 @@ service (``services``) after a readiness probe on it (``wait_for``):
a proxy through the gateway),
* portable info: ``id``, phase, location, ``provider_details``.
-Lanes: hermetic (fake Fleet + MockServer through a private daemon),
-container (``python:3.12-slim`` on gVisor through a private daemon), fleet
-(live, one sandbox, managed pool removed in ``finally``).
+Lanes: hermetic (a cloud create fails: Cua Cloud has ended; MockServer
+through a private daemon), container (``python:3.12-slim`` on gVisor through
+a private daemon), fleet (live; skipped, Cua Cloud has ended).
"""
from __future__ import annotations
@@ -127,44 +127,17 @@ def _plain_opts(image: str, what: str, *, env: bool) -> "cua.SandboxCreateOption
@pytest.mark.e2e("unified-sandbox-api", "hermetic")
-def test_unified_api_fake_fleet_and_daemon_public_url(fixtures, fake_fleet):
+def test_unified_api_cloud_ended_and_daemon_public_url(fixtures, fake_fleet, local_cua):
async def body():
- # Cloud (fake Fleet): command and services on a managed gVisor pool;
- # signed URLs; the forward proxies through the gateway.
- sbx = fake_fleet.sandboxes()
- sb = await sbx.create(
- cua.SandboxCreateOptions(
- on="cloud",
- image="registry.example/mcp:docker-e2e",
- command=["python", "/srv.py"],
- services={"mcp": 8765},
- runtime="gvisor",
- cloud=cua.CloudOptions(max_pool_size=2),
- ready_timeout_ms=120_000,
- )
+ # Cua Cloud has ended: a cloud create (command and services on a
+ # managed gVisor pool) fails before anything is created.
+ await e2e.assert_cloud_ended(
+ fake_fleet,
+ command=["python", "/srv.py"],
+ services={"mcp": 8765},
+ runtime="gvisor",
+ cloud=cua.CloudOptions(max_pool_size=2),
)
- pool = sb.info().provider_details.get("pool", "")
- try:
- info = sb.info()
- assert (info.location, info.phase) == ("cloud", cua.SandboxPhase.READY), info
- assert info.id and pool.startswith("cua-auto-"), info
- assert (await sb.service("mcp").url()).startswith("https://signed.fleet.test/")
- p = await sb.public_url("mcp", 600, None)
- assert p.url.startswith("https://signed.fleet.test/") and "claim" in p.provider_details
- r = await sb.service("mcp").request(
- "POST", "/mcp", b"{}", 30_000, [_h("accept", ACCEPT), _h("mcp-session-id", "s")]
- )
- assert r.status == 200
- fwd = await sb.forward(8765)
- try:
- status, _, text = _http("GET", fwd.url() + "/x")
- assert status == 200 and b"-mcp/x" in text, text
- finally:
- await fwd.close()
- finally:
- await sb.delete()
- if pool:
- await fake_fleet.fleet().pools().gc_pools([pool], 0)
# Local public URL (a direct spacesd): served by the daemon; any
# gRPC-Web client reaches the driver through it with its own token.
@@ -176,7 +149,7 @@ def test_unified_api_fake_fleet_and_daemon_public_url(fixtures, fake_fleet):
assert (await direct.service("env").url()) == fixtures["env_url"].rstrip("/")
pub = await direct.public_url("env", 120, None)
assert pub.url.startswith("http://127.0.0.1:") and "/s/" in pub.url, pub
- shared = await fake_fleet.sandboxes().connect_url(pub.url, fixtures["env_token"], None)
+ shared = await local_cua.sandboxes().connect_url(pub.url, fixtures["env_token"], None)
out = await (await shared.spacesd(5_000)).sh("echo shared", None)
assert bytes(out.stdout) == b"shared\n"
await direct.revoke_public_url(pub.id)
diff --git a/tests/e2e/cua-sdk/run.py b/tests/e2e/cua-sdk/run.py
index 8a818199ce..055781af3d 100755
--- a/tests/e2e/cua-sdk/run.py
+++ b/tests/e2e/cua-sdk/run.py
@@ -60,6 +60,8 @@ ALLOWED_SKIPS = (
"docs block input",
# The TypeScript Fleet guide page was removed upstream.
"no Fleet TypeScript docs block is tagged",
+ # Cua Cloud has ended: there is no live Fleet lane to run.
+ "Cua Cloud has ended (CUA-1854)",
)
STATUS_ICON = {
"pass": "pass",
diff --git a/tests/e2e/cua-sdk/rust/src/lib.rs b/tests/e2e/cua-sdk/rust/src/lib.rs
index d78fa28f4f..916bbd2f78 100644
--- a/tests/e2e/cua-sdk/rust/src/lib.rs
+++ b/tests/e2e/cua-sdk/rust/src/lib.rs
@@ -125,6 +125,35 @@ pub fn env_token_command(token: &str) -> Vec<String> {
]
}
+/// Cua Cloud has ended: `Cua::fleet()` and every cloud create fail with this
+/// message (`CLOUD_ENDED` in cua-sandbox-core). The live Fleet lanes skip
+/// with `CLOUD_ENDED_SKIP`, which run.py allows under --strict.
+pub const CLOUD_ENDED: &str = "Cua Cloud has ended";
+pub const CLOUD_ENDED_SKIP: &str = "Cua Cloud has ended (CUA-1854): there is no live Fleet lane";
+
+pub fn is_cloud_ended(e: &CuaError) -> bool {
+ matches!(e, CuaError::Unsupported(m) if m.contains(CLOUD_ENDED))
+}
+
+/// `c.fleet()` and a cloud create (`on: "cloud"`, shaped further by `shape`)
+/// fail with the one `Unsupported` message, even when `c` holds Fleet
+/// credentials; nothing is created.
+pub async fn assert_cloud_ended(c: &Arc<Cua>, shape: impl FnOnce(&mut SandboxCreateOptions)) -> Res {
+ match c.fleet() {
+ Err(e) => assert!(is_cloud_ended(&e), "{e}"),
+ Ok(_) => panic!("fleet() must fail: Cua Cloud has ended"),
+ }
+ let mut o = opts("cloud");
+ o.image = "registry.test/cua-e2e:fake".into();
+ shape(&mut o);
+ match c.sandboxes().create(o).await {
+ Err(e) => assert!(is_cloud_ended(&e), "{e}"),
+ Ok(_) => panic!("a cloud create must fail: Cua Cloud has ended"),
+ }
+ assert!(!c.sandboxes().list(None).await?.iter().any(|s| s.location == "cloud"));
+ Ok(())
+}
+
/// `None` when `lane` can run here, else the skip reason.
pub fn lane_enabled(lane: &str) -> Option<String> {
match lane {
@@ -134,20 +163,8 @@ pub fn lane_enabled(lane: &str) -> Option<String> {
"container" => (!flag("CUA_E2E_CONTAINER")).then(|| "set CUA_E2E_CONTAINER=1 for the container lane".into()),
"qemu" => (!flag("CUA_E2E_QEMU")).then(|| "set CUA_E2E_QEMU=1 for the QEMU lane".into()),
"lume" => (!flag("CUA_E2E_LUME")).then(|| "set CUA_E2E_LUME=1 for the Lume lane".into()),
- "fleet" => {
- if !flag("CUA_E2E_FLEET") {
- Some("set CUA_E2E_FLEET=1 for live Fleet".into())
- } else if std::env::var("FLEETS_TOKEN").is_err() && std::env::var("CUA_CLIENT_ID").is_err() {
- Some("no Fleet credentials".into())
- } else {
- None
- }
- }
- "fleet-env" => lane_enabled("fleet").or_else(|| {
- std::env::var("CUA_E2E_FLEET_ENV_IMAGE").is_err().then(|| {
- "CUA_E2E_FLEET_ENV_IMAGE is unset: no linux (spacesd) image in a registry Fleet can pull".into()
- })
- }),
+ // Cua Cloud has ended (CUA-1854): there is no live Fleet to run on.
+ "fleet" | "fleet-env" => Some(CLOUD_ENDED_SKIP.into()),
"conformance" => (!flag("CUA_E2E_CONFORMANCE") || !flag("CUA_E2E_CONTAINER"))
.then(|| "set CUA_E2E_CONTAINER=1 CUA_E2E_CONFORMANCE=1 to run the spacesd conformance suite".into()),
other => panic!("unknown lane {other}"),
diff --git a/tests/e2e/cua-sdk/rust/tests/core.rs b/tests/e2e/cua-sdk/rust/tests/core.rs
index a06151b05a..62c5e79383 100644
--- a/tests/e2e/cua-sdk/rust/tests/core.rs
+++ b/tests/e2e/cua-sdk/rust/tests/core.rs
@@ -183,40 +183,15 @@ async fn agnostic_fake_fleet_and_direct() {
e2e(
"daemon-agnostic",
"hermetic",
- "fake Fleet pool without env + direct URL without a driver",
+ "cloud create fails (Cua Cloud has ended) + direct URL without a driver",
MIN,
None,
|| async {
let fx = Fixtures::start()?;
let c = embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token)));
- let fleet = c.fleet()?;
- let pool = name("agnostic");
- let mut spec = pool_spec(&pool, "img:plain");
- spec.services = HashMap::from([("server".to_string(), 8000)]);
- fleet.apply_pool(spec).await?;
- let mut o = opts("cloud");
- o.pool = Some(pool.clone());
- o.name = Some(format!("{pool}-c"));
- let sb = c.sandboxes().create(o).await?;
- let r = async {
- assert_eq!(
- sb.service("server".into())?
- .request("GET".into(), "/status".into(), None, Some(5000), None)
- .await?
- .status,
- 200
- );
- assert!(matches!(
- sb.spacesd(Some(2000)).await,
- Err(CuaError::SpacesdNotAvailable(_))
- ));
- Res::Ok(())
- }
- .await;
- sb.delete().await?;
- fleet.delete_pool(pool).await?;
- r?;
- let d = c
+ assert_cloud_ended(&c, |o| o.pool = Some(name("agnostic"))).await?;
+ // Direct URL where no spacesd answers (the fake Fleet API's HTTP server).
+ let d = embedded_local()
.sandboxes()
.connect_url(
fx.fleet_base_url.clone(),
diff --git a/tests/e2e/cua-sdk/rust/tests/guides.rs b/tests/e2e/cua-sdk/rust/tests/guides.rs
index 4eff8566a3..2cd44decc0 100644
--- a/tests/e2e/cua-sdk/rust/tests/guides.rs
+++ b/tests/e2e/cua-sdk/rust/tests/guides.rs
@@ -11,7 +11,6 @@ use cua_sdk_e2e::cua::{Cua, Fleet, Sandbox};
use cua_sdk_e2e::*;
const MIN: Duration = Duration::from_secs(60);
-const FAKE_IMAGE: &str = "registry.test/cua-e2e:fake";
/// Fleet "gone": NotFound (404, or a read's 403 in a deleted namespace), or
/// the 403 live Fleet answers a *delete* in a namespace that is already gone.
@@ -130,38 +129,16 @@ async fn first_cloud_fleet_fake() {
e2e(
"your-first-cloud-fleet",
"hermetic",
- "pool -> claim -> uname -> screenshot -> delete (fake Fleet)",
+ "pool -> claim fails: Cua Cloud has ended (fake Fleet credentials)",
MIN,
None,
|| async {
let fx = Fixtures::start()?;
let c = embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token)));
- let (url, token) = (fx.env_url.clone(), fx.env_token.clone());
- let c2 = c.clone();
- first_fleet(
- &c,
- FAKE_IMAGE,
- "kubevirt",
- &[("server", 8000)],
- move |sb| async move {
- assert_eq!(
- sb.service("server".into())?
- .request("GET".into(), "/status".into(), None, Some(5000), None)
- .await?
- .status,
- 200
- );
- let d = c2
- .sandboxes()
- .connect_url(url, Some(token), Some(name("first-env")))
- .await?;
- let env = d.spacesd(Some(5000)).await?;
- let out = env.run(cmd("echo", &["Linux", "mock"])).await?;
- let png = env.screenshot(None).await?.image;
- d.delete().await?;
- Ok((String::from_utf8_lossy(&out.stdout).into_owned(), png))
- },
- )
+ assert_cloud_ended(&c, |o| {
+ o.pool = Some(name("first"));
+ o.name = Some(name("first-claim"));
+ })
.await
},
)
@@ -430,14 +407,18 @@ async fn create_pool_fake() {
e2e(
"create-pool",
"hermetic",
- "warm pool, named claim reattach, scaling, ephemeral cleanup (fake Fleet)",
+ "a managed (warm, autoscaled) cloud create fails: Cua Cloud has ended",
MIN,
None,
|| async {
let fx = Fixtures::start()?;
let c = embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token)));
- create_pool(&c, FAKE_IMAGE, false).await?;
- ephemeral(&c, FAKE_IMAGE).await
+ assert_cloud_ended(&c, |o| {
+ o.runtime = Some("gvisor".into());
+ o.warm = Some(true);
+ o.max_pool_size = Some(2);
+ })
+ .await
},
)
.await;
@@ -531,17 +512,13 @@ async fn expire_fake() {
e2e(
"expire-pools-and-claims",
"hermetic",
- "pool + claim TTLs reach Fleet (fake)",
+ "a TTL cloud create fails: Cua Cloud has ended",
MIN,
None,
|| async {
let fx = Fixtures::start()?;
- expire(
- &embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token))),
- FAKE_IMAGE,
- false,
- )
- .await
+ let c = embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token)));
+ assert_cloud_ended(&c, |o| o.fleet_ttl_seconds = Some(3600)).await
},
)
.await;
diff --git a/tests/e2e/cua-sdk/rust/tests/unified.rs b/tests/e2e/cua-sdk/rust/tests/unified.rs
index 8b473dc695..03d65c4fcc 100644
--- a/tests/e2e/cua-sdk/rust/tests/unified.rs
+++ b/tests/e2e/cua-sdk/rust/tests/unified.rs
@@ -169,69 +169,24 @@ async fn unified_api_fake_fleet_and_daemon_public_url() {
e2e(
"unified-sandbox-api",
"hermetic",
- "fake Fleet command/services/URLs + daemon public URL",
+ "cloud create fails (Cua Cloud has ended) + daemon public URL",
5 * MIN,
None,
|| async {
let fx = Fixtures::start()?;
+ // Cua Cloud has ended: a cloud create (command and services on a
+ // managed gVisor pool) fails before anything is created.
let c = embedded_fleet(Some((&fx.fleet_base_url, &fx.fleet_token)));
- let sb = c
- .sandboxes()
- .create(SandboxCreateOptions {
- image: "registry.example/mcp:docker-e2e".into(),
- command: Some(vec!["python".into(), "/srv.py".into()]),
- services: HashMap::from([("mcp".to_string(), 8765u16)]),
- runtime: Some("gvisor".into()),
- cloud: Some(CloudOptions {
- max_pool_size: Some(2),
- ..Default::default()
- }),
- ready_timeout_ms: Some(120_000),
- ..SandboxCreateOptions::new("cloud", "")
- })
- .await?;
- let pool = sb
- .info()
- .provider_details
- .get("pool")
- .cloned()
- .unwrap_or_default();
- let res = async {
- let info = sb.info();
- assert_eq!(
- (info.location.as_str(), info.phase),
- ("cloud", SandboxPhase::Ready)
- );
- assert!(pool.starts_with("cua-auto-"), "{pool}");
- let url = sb.service("mcp".into())?.url().await?;
- assert!(url.starts_with("https://signed.fleet.test/"), "{url}");
- let p = sb.public_url("mcp".into(), Some(600), None).await?;
- assert!(p.url.starts_with("https://signed.fleet.test/"));
- assert!(p.provider_details.contains_key("claim"));
- let r = sb
- .service("mcp".into())?
- .request(
- "POST".into(),
- "/mcp".into(),
- Some(b"{}".to_vec()),
- Some(30_000),
- Some(vec![hdr("accept", ACCEPT), hdr("mcp-session-id", "s")]),
- )
- .await?;
- assert_eq!(r.status, 200);
- let fwd = sb.forward(8765).await?;
- let (status, _, body) = http("GET", &format!("{}/x", fwd.url().unwrap()), &[], "")?;
- fwd.close().await?;
- assert_eq!(status, 200);
- assert!(body.contains("-mcp/x"), "{body}");
- Res::Ok(())
- }
- .await;
- sb.delete().await?;
- if !pool.is_empty() {
- c.fleet()?.pools().gc_pools(vec![pool], Some(0)).await?;
- }
- res?;
+ assert_cloud_ended(&c, |o| {
+ o.command = Some(vec!["python".into(), "/srv.py".into()]);
+ o.services = HashMap::from([("mcp".to_string(), 8765u16)]);
+ o.runtime = Some("gvisor".into());
+ o.cloud = Some(CloudOptions {
+ max_pool_size: Some(2),
+ ..Default::default()
+ });
+ })
+ .await?;
// Local public URL of a direct spacesd, served by the daemon.
let d = Daemon::start()?;
diff --git a/tests/e2e/cua-sdk/typescript/browser.test.mjs b/tests/e2e/cua-sdk/typescript/browser.test.mjs
index a9f9a50f73..3c4b7b1d5a 100644
--- a/tests/e2e/cua-sdk/typescript/browser.test.mjs
+++ b/tests/e2e/cua-sdk/typescript/browser.test.mjs
@@ -1,7 +1,8 @@
// create-pool-browser: the Browser tab of create-pool-with-typescript, on
-// @trycua/cua/browser (the wasm32 build). A pool is applied from Node (the
-// browser build has no apply, as in the guide); the browser code claims from
-// it, lists and releases the claim, and talks gRPC-Web to a spacesd.
+// @trycua/cua/browser (the wasm32 build). Cua Cloud has ended (CUA-1854), so
+// the browser build's Fleet client fails with the one "Cua Cloud has ended"
+// error instead of claiming from a pool; the rest of the flow, a gRPC-Web
+// session to a spacesd, is unchanged.
//
// * wasm in Node: the browser module imported directly (fetch transport).
// * Chromium (Playwright): the same flow in a real page, served with a
@@ -16,7 +17,6 @@ import { after, before } from "node:test"
import * as e from "./lib.mjs"
-const { cua } = e
const BROWSER = process.env.CUA_TS_BROWSER ?? join(e.CUA_ROOT, "typescript", "browser")
const built = existsSync(join(BROWSER, "cua_sdk.js"))
const needBuild = () => { if (!built) e.skip("browser build missing (cd libs/cua/typescript && npm run build:browser)") }
@@ -27,50 +27,35 @@ before(async () => {
})
after(async () => fx?.stop())
-/** Applies a pool on the fake Fleet from Node (native SDK). */
-async function applyFakePool(pool) {
- const c = cua.embedded({ stateDir: e.tmpState(), fleetFromEnv: false,
- fleet: cua.FleetSettings.create({ baseUrl: fx.fleet_base_url, token: fx.fleet_token }) })
- await e.applyPool(c.fleet(), { name: pool, image: "registry.test/cua-e2e:fake", services: { env: 3211 } })
- return c.fleet()
-}
-
// The flow both hosts run (kept as a string so the page runs the same code).
-// The wasm Fleet transport uses globalThis.fetch, so Node runs it too.
+// The wasm transport uses globalThis.fetch, so Node runs it too.
const FLOW = `async (sdk, cfg) => {
const c = sdk.Cua.embedded(sdk.CuaConfig.create({ fleet: sdk.FleetSettings.create({ baseUrl: cfg.fleet, token: cfg.fleetToken }) }))
- let sb = { claim: cfg.claim }, claims = [cfg.claim]
- if (cfg.fleet) {
- const fleet = c.fleet()
- sb = await fleet.acquire(cfg.pool, cfg.claim)
- claims = (await fleet.listClaims(sb.namespace)).map((j) => JSON.parse(j).metadata.name) // browser: claim JSON
- await fleet.release(sb)
- }
+ // Cua Cloud has ended: the Fleet client fails even with credentials.
+ let cloudEnded = false
+ try { c.fleet() } catch (err) { cloudEnded = sdk.CuaError.Unsupported.instanceOf(err) && /Cua Cloud has ended/.test(err.message) }
const env = await c.spacesd(cfg.env, cfg.envToken)
const out = await env.sh("echo from-browser", undefined)
let unauth = false
try { await c.spacesd(cfg.env, "wrong") } catch (err) { unauth = sdk.CuaError.Unauthenticated.instanceOf(err) }
- return { claim: sb.claim, claims, stdout: new TextDecoder().decode(out.stdout), unauth }
+ return { cloudEnded, stdout: new TextDecoder().decode(out.stdout), unauth }
}`
-function check(r, claim) {
- assert.equal(r.claim, claim)
- assert.ok(r.claims.includes(claim), JSON.stringify(r.claims))
+function check(r) {
+ assert.equal(r.cloudEnded, true, "the browser Fleet client fails: Cua Cloud has ended")
assert.equal(r.stdout, "from-browser\n")
assert.equal(r.unauth, true)
}
-e.e2eTest("create-pool-browser", "hermetic", "wasm build in Node: Fleet claim and env over gRPC-Web", async () => {
+e.e2eTest("create-pool-browser", "hermetic", "wasm build in Node: Fleet client fails (Cua Cloud has ended), env over gRPC-Web", async () => {
needBuild()
- const pool = e.name("browser")
- await applyFakePool(pool)
const sdk = await import(join(BROWSER, "index.js"))
await sdk.initialize(readFileSync(join(BROWSER, "wasm-bindgen", "index_bg.wasm")))
assert.equal(typeof globalThis.window, "undefined", "Node has no window")
const flow = eval(FLOW)
- const r = await flow(sdk, { fleet: fx.fleet_base_url, fleetToken: fx.fleet_token, pool, claim: `${pool}-c`,
+ const r = await flow(sdk, { fleet: fx.fleet_base_url, fleetToken: fx.fleet_token,
env: fx.env_url, envToken: fx.env_token })
- check(r, `${pool}-c`)
+ check(r)
})
const MIME = { ".js": "text/javascript", ".mjs": "text/javascript", ".wasm": "application/wasm", ".html": "text/html" }
@@ -100,7 +85,7 @@ function serve() {
return new Promise((r) => server.listen(0, "127.0.0.1", () => r(server)))
}
-e.e2eTest("create-pool-browser", "hermetic", "Chromium (Playwright): claim from a pool + env over gRPC-Web", async () => {
+e.e2eTest("create-pool-browser", "hermetic", "Chromium (Playwright): Fleet client fails (Cua Cloud has ended), env over gRPC-Web", async () => {
needBuild()
let chromium
try {
@@ -109,8 +94,6 @@ e.e2eTest("create-pool-browser", "hermetic", "Chromium (Playwright): claim from
} catch {
e.skip("playwright is not installed (npm i -D playwright && npx playwright install chromium)")
}
- const pool = e.name("browser-pw")
- await applyFakePool(pool)
const server = await serve()
const origin = `http://127.0.0.1:${server.address().port}`
let browser
@@ -127,9 +110,9 @@ e.e2eTest("create-pool-browser", "hermetic", "Chromium (Playwright): claim from
const sdk = await import("/browser/index.js")
await sdk.initialize("/browser/wasm-bindgen/index_bg.wasm")
return await (0, eval)(flowSrc)(sdk, cfg)
- }, [FLOW, { fleet: `${origin}/fleet`, fleetToken: fx.fleet_token, pool, claim: `${pool}-c`,
+ }, [FLOW, { fleet: `${origin}/fleet`, fleetToken: fx.fleet_token,
env: `${origin}/env`, envToken: fx.env_token }])
- check(r, `${pool}-c`)
+ check(r)
} finally {
await browser.close()
server.close()
diff --git a/tests/e2e/cua-sdk/typescript/core.test.mjs b/tests/e2e/cua-sdk/typescript/core.test.mjs
index 718457168a..e40a814dba 100644
--- a/tests/e2e/cua-sdk/typescript/core.test.mjs
+++ b/tests/e2e/cua-sdk/typescript/core.test.mjs
@@ -82,20 +82,10 @@ async function plainLocal(c, image, port, banner, what, memoryMb) {
assert.ok(!(await sbx.list("local")).some((s) => s.name === nm))
}
-e.e2eTest("daemon-agnostic", "hermetic", "fake Fleet pool without env + direct URL without a driver", async () => {
- const c = fakeFleet()
- const fleet = c.fleet()
- const pool = e.name("agnostic")
- await e.applyPool(fleet, { name: pool, image: "img:plain", services: { server: 8000 } })
- let sb
- try {
- sb = await c.sandboxes().create(cua.SandboxCreateOptions.create({ on: "cloud", pool, name: `${pool}-c` }))
- assert.equal((await sb.service("server").request("GET", "/status", undefined, 5000)).status, 200)
- await assert.rejects(sb.spacesd(2000), (err) => e.isErr(err, "SpacesdNotAvailable"))
- } finally {
- await sb?.delete_()
- await fleet.deletePool(pool)
- }
+e.e2eTest("daemon-agnostic", "hermetic", "cloud create fails (Cua Cloud has ended) + direct URL without a driver", async () => {
+ await e.assertCloudEnded(fakeFleet(), { pool: e.name("agnostic") })
+ // Direct URL where no spacesd answers (the fake Fleet API's HTTP server).
+ const c = e.embeddedLocal(e.tmpState())
const d = await c.sandboxes().connectUrl(fx.fleet_base_url, "t", e.name("nodriver"))
await assert.rejects(d.spacesd(2000), (err) => e.isErr(err, "SpacesdNotAvailable"))
await d.delete_()
diff --git a/tests/e2e/cua-sdk/typescript/guides.test.mjs b/tests/e2e/cua-sdk/typescript/guides.test.mjs
index 594bba6980..dfc3956613 100644
--- a/tests/e2e/cua-sdk/typescript/guides.test.mjs
+++ b/tests/e2e/cua-sdk/typescript/guides.test.mjs
@@ -1,6 +1,8 @@
// The guide scenarios in TypeScript: your-first-cloud-fleet, create-pool
// (Node), expire-pools-and-claims, run-omarchy, connect-with-viewer and
// local-container. Same definitions as ../python/test_{fleet_guides,desktop}.py.
+// Cua Cloud has ended (CUA-1854): the hermetic cloud tests assert the one
+// "Cua Cloud has ended" error; the live fleet lanes skip (lib.mjs).
import assert from "node:assert/strict"
import { randomBytes } from "node:crypto"
import { after, before } from "node:test"
@@ -8,7 +10,6 @@ import { after, before } from "node:test"
import * as e from "./lib.mjs"
const { cua } = e
-const FAKE_IMAGE = "registry.test/cua-e2e:fake"
let fx
before(async () => {
if (!e.laneEnabled("hermetic")) fx = await e.startFixtures()
@@ -63,19 +64,8 @@ async function firstFleet(c, { image, runtime, desktop, services, command, token
await assertGone(fleet, pool)
}
-e.e2eTest("your-first-cloud-fleet", "hermetic", "pool -> claim -> uname -> screenshot -> delete (fake Fleet)", async () => {
- const c = fakeFleet()
- await firstFleet(c, { image: FAKE_IMAGE, runtime: "kubevirt", services: { server: 8000 }, desktop: async (sb) => {
- assert.equal((await sb.service("server").request("GET", "/status", undefined, 5000)).status, 200)
- const d = await c.sandboxes().connectUrl(fx.env_url, fx.env_token, e.name("first-env"))
- try {
- const env = await d.spacesd(5000)
- const out = await env.run(e.cmd("echo", ["Linux", "mock"]))
- return [e.str(out.stdout), (await env.screenshot(undefined)).image]
- } finally {
- await d.delete_()
- }
- } })
+e.e2eTest("your-first-cloud-fleet", "hermetic", "a cloud pool and claim fail: Cua Cloud has ended", async () => {
+ await e.assertCloudEnded(fakeFleet(), { pool: e.name("first"), name: e.name("first-claim") })
})
e.e2eTest("your-first-cloud-fleet", "fleet", "the tutorial's KubeVirt pool (legacy /cmd)", async () => {
@@ -158,10 +148,10 @@ async function ephemeral(c, image) {
await assertGone(fleet, pool)
}
-e.e2eTest("create-pool", "hermetic", "warm pool, named claim reattach, scaling, ephemeral cleanup (fake Fleet)", async () => {
+e.e2eTest("create-pool", "hermetic", "named, warm and ephemeral cloud creates fail: Cua Cloud has ended", async () => {
const c = fakeFleet()
- await createPool(c, { image: FAKE_IMAGE, live: false })
- await ephemeral(c, FAKE_IMAGE)
+ await e.assertCloudEnded(c, { pool: e.name("pool"), name: e.name("claim") })
+ await e.assertCloudEnded(c, { runtime: "gvisor", warm: true, maxPoolSize: 2, fleetTtlSeconds: 3600 })
})
e.e2eTest("create-pool", "fleet", "warm pool, named claim reattach, scaling", async () => {
@@ -201,8 +191,8 @@ async function expire(c, { image, live }) {
}
}
-e.e2eTest("expire-pools-and-claims", "hermetic", "pool + claim TTLs reach Fleet (fake)", async () => {
- await expire(fakeFleet(), { image: FAKE_IMAGE, live: false })
+e.e2eTest("expire-pools-and-claims", "hermetic", "pool and claim TTLs fail: Cua Cloud has ended", async () => {
+ await e.assertCloudEnded(fakeFleet(), { fleetTtlSeconds: 3600 })
})
e.e2eTest("expire-pools-and-claims", "fleet", "pool + claim TTLs reach Fleet", async () => {
diff --git a/tests/e2e/cua-sdk/typescript/lib.mjs b/tests/e2e/cua-sdk/typescript/lib.mjs
index 9d663b1977..0606911f56 100644
--- a/tests/e2e/cua-sdk/typescript/lib.mjs
+++ b/tests/e2e/cua-sdk/typescript/lib.mjs
@@ -1,6 +1,7 @@
// Shared helpers for the cua SDK e2e suite (TypeScript / Node). Mirrors
// ../python/e2e.py: cua-e2e-<run>-* names, env-gated lanes, bounded polls,
// results appended to $CUA_E2E_RESULTS/ts.jsonl.
+import assert from "node:assert/strict"
import { execFileSync, spawn, spawnSync } from "node:child_process"
import { randomBytes } from "node:crypto"
import { appendFileSync, existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs"
@@ -50,6 +51,29 @@ export function binary(env, exe) {
const flag = (v) => process.env[v] === "1"
const hasDocker = () => spawnSync("docker", ["version", "--format", "{{.Server.Version}}"]).status === 0
+// Cua Cloud has ended: `Cua.fleet()` and every cloud create fail with this
+// message (`CLOUD_ENDED` in cua-sandbox-core). The live Fleet lanes skip with
+// CLOUD_ENDED_SKIP, which run.py allows under --strict.
+export const CLOUD_ENDED_SKIP = "Cua Cloud has ended (CUA-1854): there is no live Fleet lane"
+export const isCloudEnded = (err) =>
+ cua.CuaError.Unsupported.instanceOf(err) && /Cua Cloud has ended/.test(err.message)
+
+/**
+ * `c.fleet()` and a cloud create (`on: "cloud"`, plus `extra`'s options) fail
+ * with the one `Unsupported` message, even when `c` holds Fleet credentials;
+ * nothing is created.
+ */
+export async function assertCloudEnded(c, extra = {}) {
+ assert.throws(() => c.fleet(), isCloudEnded)
+ await assert.rejects(
+ c.sandboxes().create(
+ cua.SandboxCreateOptions.create({ on: "cloud", image: "registry.test/cua-e2e:fake", ...extra }),
+ ),
+ isCloudEnded,
+ )
+ assert.deepEqual((await c.sandboxes().listWithWarnings("cloud")).sandboxes, [])
+}
+
/** `undefined` when `lane` can run here, else the skip reason. */
export function laneEnabled(lane) {
switch (lane) {
@@ -63,15 +87,9 @@ export function laneEnabled(lane) {
case "lume":
return flag("CUA_E2E_LUME") ? undefined : "set CUA_E2E_LUME=1 for the Lume lane"
case "fleet":
- if (!flag("CUA_E2E_FLEET")) return "set CUA_E2E_FLEET=1 for live Fleet"
- return process.env.FLEETS_TOKEN || process.env.CUA_CLIENT_ID ? undefined : "no Fleet credentials"
case "fleet-env":
- return (
- laneEnabled("fleet") ??
- (process.env.CUA_E2E_FLEET_ENV_IMAGE
- ? undefined
- : "CUA_E2E_FLEET_ENV_IMAGE is unset: no linux (spacesd) image in a registry Fleet can pull")
- )
+ // Cua Cloud has ended (CUA-1854): there is no live Fleet to run on.
+ return CLOUD_ENDED_SKIP
case "cua-sandbox":
return flag("CUA_E2E_CUA_SANDBOX") ? undefined : "set CUA_E2E_CUA_SANDBOX=1"
default:
diff --git a/tests/e2e/cua-sdk/typescript/unified.test.mjs b/tests/e2e/cua-sdk/typescript/unified.test.mjs
index 37cc133019..33b007f228 100644
--- a/tests/e2e/cua-sdk/typescript/unified.test.mjs
+++ b/tests/e2e/cua-sdk/typescript/unified.test.mjs
@@ -71,47 +71,20 @@ async function urlsAndForward(sb, port) {
await sb.revokePublicUrl(pub.id)
}
-e.e2eTest("unified-sandbox-api", "hermetic", "fake Fleet command/services/URLs + daemon public URL", async () => {
+e.e2eTest("unified-sandbox-api", "hermetic", "cloud create fails (Cua Cloud has ended) + daemon public URL", async () => {
const c = cua.embedded({
stateDir: e.tmpState(),
fleetFromEnv: false,
fleet: cua.FleetSettings.create({ baseUrl: fx.fleet_base_url, token: fx.fleet_token }),
})
- const sb = await c.sandboxes().create(cua.SandboxCreateOptions.create({
- on: "cloud",
- image: "registry.example/mcp:docker-e2e",
+ // A cloud create (command and services on a managed gVisor pool) fails
+ // before anything is created.
+ await e.assertCloudEnded(c, {
command: ["python", "/srv.py"],
services: new Map([["mcp", 8765]]),
runtime: "gvisor",
cloud: cua.CloudOptions.create({ maxPoolSize: 2 }),
- readyTimeoutMs: 120_000,
- }))
- const pool = sb.info().providerDetails.get("pool") ?? ""
- try {
- const info = sb.info()
- assert.equal(info.location, "cloud")
- assert.equal(info.phase, cua.SandboxPhase.Ready)
- assert.ok(info.id && pool.startsWith("cua-auto-"), pool)
- assert.ok((await sb.service("mcp").url()).startsWith("https://signed.fleet.test/"))
- const p = await sb.publicUrl("mcp", 600, undefined)
- assert.ok(p.url.startsWith("https://signed.fleet.test/") && p.providerDetails.has("claim"))
- // The same from the service handle (as in Python and Rust).
- const sp = await sb.service("mcp").publicUrl(600, undefined)
- assert.ok(sp.url.startsWith("https://signed.fleet.test/") && sp.service === "mcp", sp.url)
- const r = await sb.service("mcp").request("POST", "/mcp", json({}), 30_000, [h("accept", ACCEPT), h("mcp-session-id", "s")])
- assert.equal(r.status, 200)
- const fwd = await sb.forward(8765)
- try {
- const res = await fetch(fwd.url() + "/x")
- assert.equal(res.status, 200)
- assert.match(await res.text(), /-mcp\/x/)
- } finally {
- await fwd.close()
- }
- } finally {
- await sb.delete_()
- if (pool) await c.fleet().pools().gcPools([pool], 0)
- }
+ })
await e.withDaemon(async (d) => {
const direct = await d.client().sandboxes().connectUrl(fx.env_url, fx.env_token, undefined)