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(spaces): say computers in use at once for the plan limit (CUA-3690) (#6790)

cua-agents[bot]891ccb7153dd
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
index b5fddf9a38..7710588740 100644
--- a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
+++ b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
@@ -38341,7 +38341,7 @@ const FfiConverterTypeAppRefreshReport = (() => {
export type AppRelayAllowanceNotice = {
/**
- * On Free: "You're using 2 of 2 live sessions on the free plan. ..."
+ * On Free: "You have 2 of 2 computers in use at once on the free plan. ..."
*/
text: string,
/**
@@ -38502,11 +38502,11 @@ export type AppRelayUsage = {
*/
team?: AppRelayUsageTeam,
/**
- * Live sessions now.
+ * Computers in use now.
*/
liveSessions: number,
/**
- * Live sessions allowed at once (none: no limit).
+ * Computers in use allowed at once (none: no limit).
*/
liveSessionsLimit?: number,
/**
@@ -38609,7 +38609,7 @@ export type AppRelayUsageView = {
*/
label: string,
/**
- * "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month", then the
+ * "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month", then the
* team pool when there is one.
*/
line: string,
diff --git a/apps/cua-spaces-desktop/test/host-failure.test.ts b/apps/cua-spaces-desktop/test/host-failure.test.ts
index 5eb89ab510..10e4b737ed 100644
--- a/apps/cua-spaces-desktop/test/host-failure.test.ts
+++ b/apps/cua-spaces-desktop/test/host-failure.test.ts
@@ -59,7 +59,7 @@ describe("host setup failures", () => {
expect(f.message).not.toMatch(/429|http|relay/i);
});
- it.each(["http: relay: HTTP 429: computer limit for this token reached", "HTTP 429: at most 5 unused pairing codes", "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."])(
+ it.each(["http: relay: HTTP 429: computer limit for this token reached", "HTTP 429: at most 5 unused pairing codes", "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."])(
"a limit the relay explains is not a throttle: %s",
(raw) => expect(classify(raw)).toBe("other"),
);
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DevicesTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DevicesTests.swift
index 47a2f0ebed..77ce9bb69a 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DevicesTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DevicesTests.swift
@@ -257,7 +257,7 @@ struct RelayUsageTests {
await m.readRelayUsage()
let view = try #require(m.relayUsageView)
#expect(view.label == "Remote use")
- #expect(view.line == "Live sessions 1 of 2 \u{b7} Remote hours 6.5 of 20 this month")
+ #expect(view.line == "Computers in use 1 of 2 \u{b7} Remote hours 6.5 of 20 this month")
#expect(view.plan == "Free plan")
#expect(m.relayNotice == nil)
}
@@ -268,7 +268,7 @@ struct RelayUsageTests {
let (m, defaults) = model(fixture)
await m.readRelayUsage()
let notice = try #require(m.relayNotice)
- #expect(notice.text == "You're using 2 of 2 live sessions and 20.4 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 live sessions and 200 remote hours.")
+ #expect(notice.text == "You have 2 of 2 computers in use at once and 20.4 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 computers in use at once and 200 remote hours.")
#expect(notice.upgrade == "Upgrade")
#expect(notice.upgradeUrl == "https://app.cua.ai/buy/pro?from=app_meter")
#expect(notice.level == "limit")
@@ -290,9 +290,9 @@ struct RelayUsageTests {
let (m, _) = model(FixtureDevices())
m.noteRefusal("timed out")
#expect(m.relayNotice == nil)
- m.noteRefusal("relay: You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.")
+ m.noteRefusal("relay: You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams.")
let notice = try #require(m.relayNotice)
- #expect(notice.text == "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.")
+ #expect(notice.text == "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams.")
#expect(notice.upgrade == "Upgrade")
#expect(notice.upgradeUrl?.hasSuffix("/buy/teams?from=plan_limit") == true)
m.dismissRelayNotice()
@@ -306,7 +306,7 @@ struct RelayUsageTests {
let (m, _) = model(FixtureDevices())
let telemetry = FixtureTelemetry()
m.telemetry = telemetry
- m.noteRefusal("relay: You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro.", surface: "app_create")
+ m.noteRefusal("relay: You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro.", surface: "app_create")
let notice = try #require(m.relayNotice)
#expect(notice.kind == "sessions")
#expect(notice.plan == "free")
@@ -341,7 +341,7 @@ struct RelayUsageTests {
await m.readRelayUsage()
let notice = try #require(m.relayNotice)
#expect(notice.level == "warn")
- #expect(notice.text == "You've used 16.5 of 20 remote hours this month. Nothing stops at the limit. Pro gives you 200 hours and 5 live sessions.")
+ #expect(notice.text == "You've used 16.5 of 20 remote hours this month. Nothing stops at the limit. Pro gives you 200 hours and 5 computers in use at once.")
#expect(notice.upgradeUrl == "https://app.cua.ai/buy/pro?from=app_meter")
#expect(notice.dismissKey == "2026-10:warn")
}
diff --git a/apps/cua-spaces-web/src/__tests__/plan-copy-guard.test.ts b/apps/cua-spaces-web/src/__tests__/plan-copy-guard.test.ts
new file mode 100644
index 0000000000..d8edf28e83
--- /dev/null
+++ b/apps/cua-spaces-web/src/__tests__/plan-copy-guard.test.ts
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+// The plan limit is "computers in use at once" everywhere a person reads it
+// (CUA-3690). This scans the plan, usage and upgrade files so the old wording
+// ("live sessions", "machines at once", "connections at once", "Machines in
+// use") cannot come back. The refusal sentence itself comes from the Rust core,
+// which has its own test; the files here must also not carry the old wording.
+// The toast test keeps the old sentence on purpose (older relays still send it),
+// so test files are not scanned.
+
+import { readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+
+import { describe, expect, it } from "vitest";
+
+const SRC = join(dirname(fileURLToPath(import.meta.url)), "..");
+const PLAN_FILES = [
+ "components/settings/account-tab.tsx",
+ "components/upgrade-card.tsx",
+ "components/upsell-prompt.tsx",
+ "bridge/adapters/demo/relay-usage.ts",
+ "bridge/ops/relay-usage.ts",
+];
+const OLD_WORDS = [/live sessions/i, /machines at once/i, /connections at once/i, /machines in use/i];
+
+describe("plan and usage copy", () => {
+ it.each(PLAN_FILES)("%s never says the old words for the plan limit", (file) => {
+ const text = readFileSync(join(SRC, file), "utf8");
+ for (const word of OLD_WORDS) expect(text).not.toMatch(word);
+ });
+
+ it("the Settings usage row says computers in use", () => {
+ const text = readFileSync(join(SRC, "components/settings/account-tab.tsx"), "utf8");
+ expect(text).toContain("Computers in use right now");
+ expect(text).toContain("computers in use at once");
+ });
+});
diff --git a/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
index e7f4eeb837..aca78c131a 100644
--- a/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/settings-advanced.test.tsx
@@ -34,8 +34,8 @@ describe.skipIf(!wasmBuilt)("account usage and self-hosting in Settings (real ro
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(usage.textContent).toContain("Time away from this machine");
- expect(usage.textContent).toContain("away from the machine you're using");
+ expect(usage.textContent).toContain("Time away from this computer");
+ expect(usage.textContent).toContain("away from the computer you're using");
expect(document.body.textContent).not.toMatch(/relay hours|remote hours/i);
});
diff --git a/apps/cua-spaces-web/src/__tests__/upsell.test.tsx b/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
index a15f3bfe85..d4f58380cf 100644
--- a/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
+++ b/apps/cua-spaces-web/src/__tests__/upsell.test.tsx
@@ -68,7 +68,7 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
return el as HTMLElement;
});
expect(card.getAttribute("data-plan-card")).toBe("free");
- expect(card.textContent).toBe("Free: 2 machines at once and 20 hours a month away from the machine you're using.");
+ expect(card.textContent).toBe("Free: 2 computers in use at once and 20 hours a month away from the computer you're using.");
// "Free plan" shows once, in the plan row.
const tab = document.querySelector<HTMLElement>('[data-settings-tab="account"]')!;
expect(tab.textContent).not.toContain("Free plan");
@@ -79,12 +79,12 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
await waitFor(() => expect(features(tracked)).toContain("upsell_plan_card_click"));
});
- it("Settings shows the usage meter: Pro at 5 of 5 live sessions gets the sessions card, with Upgrade to Teams", async () => {
+ it("Settings shows the usage meter: Pro at 5 of 5 computers in use at once gets the sessions card, with Upgrade to Teams", async () => {
const opened: string[] = [];
const { router } = await mountApp("/settings", host(idle({ plan: "pro", liveSessions: 5, liveSessionsLimit: 5, hoursUsed: 12, hoursLimit: 200 }), opened));
await router.load();
const sessions = await waitFor(() => {
- const el = document.querySelector('[data-usage-meter="Live sessions"]');
+ const el = document.querySelector('[data-usage-meter="Computers in use"]');
expect(el).toBeTruthy();
return el as HTMLElement;
});
@@ -92,8 +92,8 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
expect(sessions.getAttribute("aria-valuemax")).toBe("5");
expect(sessions.hasAttribute("data-full")).toBe(true);
const hours = document.querySelector('[data-usage-meter="Remote hours"]')!;
- expect(document.body.textContent).toContain("Machines in use right now");
- expect(document.body.textContent).toContain("Time away from this machine");
+ expect(document.body.textContent).toContain("Computers in use right now");
+ expect(document.body.textContent).toContain("Time away from this computer");
expect(hours.getAttribute("aria-valuenow")).toBe("12");
expect(hours.hasAttribute("data-full")).toBe(false);
const card = await waitFor(() => {
@@ -102,7 +102,7 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
return el as HTMLElement;
});
expect(card.getAttribute("data-upgrade-card")).toBe("sessions");
- expect(card.textContent).toContain("You're using 5 of 5 live sessions");
+ expect(card.textContent).toContain("You have 5 of 5 computers in use at once");
fireEvent.click(card.querySelector("[data-upgrade-cta]")!);
await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/teams?from=app_card_sessions"]));
});
@@ -115,7 +115,7 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(card.textContent).toBe("Pro: 5 machines at once and 200 hours a month away from the machine you're using.");
+ expect(card.textContent).toBe("Pro: 5 computers in use at once and 200 hours a month away from the computer you're using.");
expect(document.querySelector("[data-plan-primary]")).toBeNull();
expect(document.querySelector("[data-manage-account]")?.textContent).toBe("Manage account on the web");
});
@@ -152,7 +152,7 @@ describe.skipIf(!wasmBuilt)("in-app Pro and Teams prompts (real routes, wasm cor
expect(el).toBeTruthy();
return el as HTMLElement;
});
- expect(prompt.textContent).toContain("Two computers now. Free includes 2 live sessions and 20 remote hours a month. Pro makes it 5 and 200, for $18 a month.");
+ expect(prompt.textContent).toContain("Two computers now. Free includes 2 computers in use at once and 20 remote hours a month. Pro makes it 5 and 200, for $18 a month.");
await waitFor(() => expect(features(tracked)).toContain("upsell_machine_shown"));
fireEvent.click(document.querySelector("[data-upsell=machine] [data-upsell-cta]")!);
await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/pro?from=app_machine"]));
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/relay-usage.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/relay-usage.test.tsx
index 5dd06d9793..49e2de3a17 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/relay-usage.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/relay-usage.test.tsx
@@ -55,12 +55,12 @@ describe("relay.usage", () => {
it.skipIf(!wasmBuilt)("the row and the notice are the core's words", async () => {
const core = await testCore();
const free = relayUsageView(core, demoRelayUsage())!;
- expect(free).toMatchObject({ label: "Remote use", line: "Live sessions 1 of 2 · Remote hours 6.5 of 20 this month", plan: "Free plan", notice: null });
+ expect(free).toMatchObject({ label: "Remote use", line: "Computers in use 1 of 2 · Remote hours 6.5 of 20 this month", plan: "Free plan", notice: null });
expect(free.planCard).toMatchObject({ plan: "free", label: "Free plan", primary: { label: "Get Pro", url: "https://app.cua.ai/buy/pro?from=app_plan_card" }, secondary: { label: "Start a team", url: "https://app.cua.ai/buy/teams?from=app_plan_card" } });
const past = relayUsageView(core, { ...demoRelayUsage(), hoursUsed: 20.24, softLimitReached: true, reasons: ["hours"], team: { id: "acme", seats: 3 } })!;
- expect(past.line).toBe("Live sessions 1 of 2 · Remote hours 20.2 of 20 this month · Team pool, 3 seats");
+ expect(past.line).toBe("Computers in use 1 of 2 · Remote hours 20.2 of 20 this month · Team pool, 3 seats");
expect(past.notice).toEqual({
- text: "You're using 20.2 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 live sessions and 200 remote hours.",
+ text: "You're using 20.2 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 computers in use at once and 200 remote hours.",
upgrade: "Upgrade",
upgradeUrl: "https://app.cua.ai/buy/pro?from=app_meter",
dismiss: "Dismiss",
diff --git a/apps/cua-spaces-web/src/bridge/ops/relay-usage.ts b/apps/cua-spaces-web/src/bridge/ops/relay-usage.ts
index 1da25bf0ba..4bb570a0d5 100644
--- a/apps/cua-spaces-web/src/bridge/ops/relay-usage.ts
+++ b/apps/cua-spaces-web/src/bridge/ops/relay-usage.ts
@@ -87,7 +87,7 @@ export interface PlanCard {
export interface RelayUsageView {
/** "Remote use". */
label: string;
- /** "Live sessions 1 of 2 · Remote hours 6.5 of 20 this month". */
+ /** "Computers in use 1 of 2 · Remote hours 6.5 of 20 this month". */
line: string;
/** "Free plan". */
plan: string;
diff --git a/apps/cua-spaces-web/src/components/settings/account-tab.tsx b/apps/cua-spaces-web/src/components/settings/account-tab.tsx
index 61de146402..5fcc2c1d14 100644
--- a/apps/cua-spaces-web/src/components/settings/account-tab.tsx
+++ b/apps/cua-spaces-web/src/components/settings/account-tab.tsx
@@ -62,7 +62,7 @@ function UsageBar({ id, label, text, used, limit }: { id: string; label: string;
function allowanceLine(plan: string, usage: RelayUsage): string | null {
const { liveSessionsLimit: machines, hoursLimit: away } = usage;
if (!machines || !away) return null;
- return `${plan}: ${machines} machines at once and ${hours(away)} hours a month away from the machine you're using.`;
+ return `${plan}: ${machines} computers in use at once and ${hours(away)} hours a month away from the computer you're using.`;
}
/**
@@ -127,14 +127,14 @@ export function AccountTab() {
<div data-relay-usage="">
<UsageBar
id="Remote hours"
- label="Time away from this machine"
+ label="Time away from this computer"
text={`${hours(usage.hoursUsed)} of ${usage.hoursLimit ?? 0} hours`}
used={usage.hoursUsed}
limit={usage.hoursLimit}
/>
<UsageBar
- id="Live sessions"
- label="Machines in use right now"
+ id="Computers in use"
+ label="Computers in use right now"
text={`${usage.liveSessions} of ${usage.liveSessionsLimit ?? 0}`}
used={usage.liveSessions}
limit={usage.liveSessionsLimit}
diff --git a/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.test.tsx b/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.test.tsx
index 482d40d611..e76827d7ae 100644
--- a/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.test.tsx
+++ b/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.test.tsx
@@ -16,7 +16,9 @@ afterEach(() => {
cleanup();
});
-const SENTENCE = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.";
+const SENTENCE = "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams.";
+// What an older relay still says; the core reads both wordings.
+const OLD_SENTENCE = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.";
/** A core that answers `relayUsage.planLimit`, `upgrade.link` and
* `telemetry.planLimit` the way the real one does. */
@@ -26,8 +28,8 @@ const core: CoreClient = {
call: () => undefined as never,
tryCall: <T,>(method: string, args?: Record<string, unknown>) => {
if (method === "relayUsage.planLimit")
- return (String(args?.error).includes("live sessions on Pro")
- ? { text: SENTENCE, upgrade: "Upgrade", upgradeUrl: "https://app.cua.ai/buy/teams?from=plan_limit", dismiss: "Dismiss", dismissKey: "refused:Sessions", level: "limit", kind: "sessions", plan: "pro" }
+ return (/computers in use at once on Pro|live sessions on Pro/.test(String(args?.error))
+ ? { text: String(args?.error), upgrade: "Upgrade", upgradeUrl: "https://app.cua.ai/buy/teams?from=plan_limit", dismiss: "Dismiss", dismissKey: "refused:Sessions", level: "limit", kind: "sessions", plan: "pro" }
: null) as T;
if (method === "upgrade.link") return String(args?.url).replace("from=plan_limit", `from=${String(args?.from)}`) as T;
if (method === "telemetry.planLimit")
@@ -94,4 +96,11 @@ describe("PlanLimitToastAction", () => {
act(() => toastError("Couldn't open the Space")(new Error("timed out")));
expect(document.querySelector("[data-toast-action]")).toBeNull();
});
+
+ it("the older relay's wording gets the same Upgrade", async () => {
+ mount();
+ await act(() => new Promise((r) => setTimeout(r, 10)));
+ act(() => toastError("Couldn't open the Space")(new Error(OLD_SENTENCE)));
+ expect(document.querySelector("[data-toast-action]")?.textContent).toBe("Upgrade");
+ });
});
diff --git a/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.tsx b/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.tsx
index 3cae810b83..cf4f85592f 100644
--- a/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.tsx
+++ b/apps/cua-spaces-web/src/components/shell/plan-limit-toast-action.tsx
@@ -8,9 +8,11 @@ import { setErrorAction } from "@/components/ui/toast";
/**
* Puts Upgrade on the toast of a failed action when the failure is the
- * relay refusing a new live session over the plan's cap ("You're using 5 of
- * 5 live sessions on Pro. Close one or upgrade to Teams."). The sentence is
- * the error's own; the button opens the plan's page on the account app.
+ * relay refusing a new computer in use over the plan's cap ("You have 5 of
+ * 5 computers in use at once on Pro. Close one or upgrade to Teams.", or the
+ * older "You're using 5 of 5 live sessions on Pro." from an older relay; the
+ * core reads both). The sentence is the error's own; the button opens the
+ * plan's page on the account app.
* Renders nothing.
*
* Usage data (CUA-1881): the refusal shown is `cua_plan_limit_shown` and
diff --git a/apps/cua-spaces-web/src/components/upgrade-card.test.tsx b/apps/cua-spaces-web/src/components/upgrade-card.test.tsx
index 6ef98524bf..90aa7e771d 100644
--- a/apps/cua-spaces-web/src/components/upgrade-card.test.tsx
+++ b/apps/cua-spaces-web/src/components/upgrade-card.test.tsx
@@ -58,7 +58,7 @@ describe.skipIf(!wasmBuilt)("<UpgradeCard>", () => {
});
expect(card.getAttribute("data-upgrade-card")).toBe("hours");
expect(card.textContent).toContain("You've used this month's remote hours");
- expect(card.textContent).toContain("Pro gives you 200 hours and 5 live sessions");
+ expect(card.textContent).toContain("Pro gives you 200 hours and 5 computers in use at once");
expect(card.textContent).toContain("$18 a month");
fireEvent.click(screen.getByRole("button", { name: "Upgrade to Pro" }));
await waitFor(() => expect(opened).toEqual(["https://app.cua.ai/buy/pro?from=app_card_hours"]));
@@ -96,7 +96,7 @@ describe.skipIf(!wasmBuilt)("<RelayAllowanceNotice> with the cards on", () => {
await waitFor(() => expect(document.querySelector("[data-upgrade-card]")).toBeNull());
});
- it("a Pro account at 5 of 5 live sessions with empty reasons gets the sessions card", async () => {
+ it("a Pro account at 5 of 5 computers in use at once with empty reasons gets the sessions card", async () => {
const { view } = host({ ...reached, plan: "pro", hoursUsed: 10, hoursLimit: 200, liveSessions: 5, liveSessionsLimit: 5, reasons: [], softLimitReached: false });
view();
const card = await waitFor(() => {
@@ -105,7 +105,7 @@ describe.skipIf(!wasmBuilt)("<RelayAllowanceNotice> with the cards on", () => {
return el as HTMLElement;
});
expect(card.getAttribute("data-upgrade-card")).toBe("sessions");
- expect(card.textContent).toContain("You're using 5 of 5 live sessions");
+ expect(card.textContent).toContain("You have 5 of 5 computers in use at once");
});
it("a plan with no card keeps the notice and its Upgrade link", async () => {
diff --git a/docs/content/docs/cua-cli/reference/cli/computers-and-teams.mdx b/docs/content/docs/cua-cli/reference/cli/computers-and-teams.mdx
index 860387a318..8c79b66963 100644
--- a/docs/content/docs/cua-cli/reference/cli/computers-and-teams.mdx
+++ b/docs/content/docs/cua-cli/reference/cli/computers-and-teams.mdx
@@ -52,7 +52,7 @@ description: "Your computers, unattended access on this computer, teams and your
| [`cua team remove-machine`](#cua-team-remove-machine) | Take a computer off the team. |
| [`cua team audit`](#cua-team-audit) | The team's audit log. |
| [`cua team delete`](#cua-team-delete) | Delete a team (owner; cancel its subscription first). |
-| [`cua usage`](#cua-usage) | Your remote use this month: live sessions, remote hours, and your plan. |
+| [`cua usage`](#cua-usage) | Your remote use this month: computers in use at once, remote hours, and your plan. |
Every command also accepts the [global options](/cua-cli/reference/cli#global-options).
@@ -836,7 +836,7 @@ cua team delete AIGIS --yes
## `cua usage`
-Your remote use this month: live sessions, remote hours, and your plan. Remote hours are time spent using your computers from somewhere else; using a computer from itself is free.
+Your remote use this month: computers in use at once, remote hours, and your plan. Remote hours are time spent using your computers from somewhere else; using a computer from itself is free.
```text output
cua usage [OPTIONS]
diff --git a/docs/content/docs/cua-cli/reference/cli/index.mdx b/docs/content/docs/cua-cli/reference/cli/index.mdx
index 24d947e1ef..0bd0487791 100644
--- a/docs/content/docs/cua-cli/reference/cli/index.mdx
+++ b/docs/content/docs/cua-cli/reference/cli/index.mdx
@@ -36,7 +36,7 @@ Your computers, unattended access on this computer, teams and your remote use th
| <span id="cua-host"></span><span id="cua-host-setup"></span><span id="cua-host-pair"></span><span id="cua-host-config"></span><span id="cua-host-cache"></span><span id="cua-host-cache-status"></span><span id="cua-host-cache-fill"></span><span id="cua-host-cache-clear"></span><span id="cua-host-status"></span><span id="cua-host-stop"></span><span id="cua-host-start"></span><span id="cua-host-share"></span><span id="cua-host-unshare"></span><span id="cua-host-migrate"></span><span id="cua-host-remove"></span>[`cua host`](/cua-cli/reference/cli/computers-and-teams#cua-host) | Unattended access to this computer (setup, status, stop, start, remove). | [`setup`](/cua-cli/reference/cli/computers-and-teams#cua-host-setup), [`pair`](/cua-cli/reference/cli/computers-and-teams#cua-host-pair), [`config`](/cua-cli/reference/cli/computers-and-teams#cua-host-config), [`cache`](/cua-cli/reference/cli/computers-and-teams#cua-host-cache), [`cache status`](/cua-cli/reference/cli/computers-and-teams#cua-host-cache-status), [`cache fill`](/cua-cli/reference/cli/computers-and-teams#cua-host-cache-fill), [`cache clear`](/cua-cli/reference/cli/computers-and-teams#cua-host-cache-clear), [`status`](/cua-cli/reference/cli/computers-and-teams#cua-host-status), [`stop`](/cua-cli/reference/cli/computers-and-teams#cua-host-stop), [`start`](/cua-cli/reference/cli/computers-and-teams#cua-host-start), [`share`](/cua-cli/reference/cli/computers-and-teams#cua-host-share), [`unshare`](/cua-cli/reference/cli/computers-and-teams#cua-host-unshare), [`migrate`](/cua-cli/reference/cli/computers-and-teams#cua-host-migrate), [`remove`](/cua-cli/reference/cli/computers-and-teams#cua-host-remove) |
| <span id="cua-devices"></span><span id="cua-devices-status"></span><span id="cua-devices-enroll"></span><span id="cua-devices-approve"></span><span id="cua-devices-ls"></span><span id="cua-devices-rename"></span><span id="cua-devices-revoke"></span><span id="cua-devices-audit"></span>[`cua devices`](/cua-cli/reference/cli/computers-and-teams#cua-devices) | This device as a client of your cua.ai account on the relay: enroll (second factor), approve other devices, list, rename, revoke, and the audit log of who accessed what. | [`status`](/cua-cli/reference/cli/computers-and-teams#cua-devices-status), [`enroll`](/cua-cli/reference/cli/computers-and-teams#cua-devices-enroll), [`approve`](/cua-cli/reference/cli/computers-and-teams#cua-devices-approve), [`ls`](/cua-cli/reference/cli/computers-and-teams#cua-devices-ls), [`rename`](/cua-cli/reference/cli/computers-and-teams#cua-devices-rename), [`revoke`](/cua-cli/reference/cli/computers-and-teams#cua-devices-revoke), [`audit`](/cua-cli/reference/cli/computers-and-teams#cua-devices-audit) |
| <span id="cua-team"></span><span id="cua-team-create"></span><span id="cua-team-ls"></span><span id="cua-team-show"></span><span id="cua-team-invite"></span><span id="cua-team-join"></span><span id="cua-team-leave"></span><span id="cua-team-remove-member"></span><span id="cua-team-set-role"></span><span id="cua-team-devices"></span><span id="cua-team-approve"></span><span id="cua-team-deny"></span><span id="cua-team-request"></span><span id="cua-team-add-machine"></span><span id="cua-team-remove-machine"></span><span id="cua-team-audit"></span><span id="cua-team-delete"></span>[`cua team`](/cua-cli/reference/cli/computers-and-teams#cua-team) | Teams (organizations of your cua.ai account) share computers with every member and their agents. | [`create`](/cua-cli/reference/cli/computers-and-teams#cua-team-create), [`ls`](/cua-cli/reference/cli/computers-and-teams#cua-team-ls), [`show`](/cua-cli/reference/cli/computers-and-teams#cua-team-show), [`invite`](/cua-cli/reference/cli/computers-and-teams#cua-team-invite), [`join`](/cua-cli/reference/cli/computers-and-teams#cua-team-join), [`leave`](/cua-cli/reference/cli/computers-and-teams#cua-team-leave), [`remove-member`](/cua-cli/reference/cli/computers-and-teams#cua-team-remove-member), [`set-role`](/cua-cli/reference/cli/computers-and-teams#cua-team-set-role), [`devices`](/cua-cli/reference/cli/computers-and-teams#cua-team-devices), [`approve`](/cua-cli/reference/cli/computers-and-teams#cua-team-approve), [`deny`](/cua-cli/reference/cli/computers-and-teams#cua-team-deny), [`request`](/cua-cli/reference/cli/computers-and-teams#cua-team-request), [`add-machine`](/cua-cli/reference/cli/computers-and-teams#cua-team-add-machine), [`remove-machine`](/cua-cli/reference/cli/computers-and-teams#cua-team-remove-machine), [`audit`](/cua-cli/reference/cli/computers-and-teams#cua-team-audit), [`delete`](/cua-cli/reference/cli/computers-and-teams#cua-team-delete) |
-| <span id="cua-usage"></span>[`cua usage`](/cua-cli/reference/cli/computers-and-teams#cua-usage) | Your remote use this month: live sessions, remote hours, and your plan. | |
+| <span id="cua-usage"></span>[`cua usage`](/cua-cli/reference/cli/computers-and-teams#cua-usage) | Your remote use this month: computers in use at once, remote hours, and your plan. | |
### Sharing and Space networks
diff --git a/docs/content/docs/cua-sdk/concepts/telemetry-events.mdx b/docs/content/docs/cua-sdk/concepts/telemetry-events.mdx
index 28fe5c599a..376b896ffb 100644
--- a/docs/content/docs/cua-sdk/concepts/telemetry-events.mdx
+++ b/docs/content/docs/cua-sdk/concepts/telemetry-events.mdx
@@ -82,7 +82,7 @@ people hit and which prompts help, never what you were doing.
first-run plan card). In the CLI: `cli_limit` (a command turned down over a
plan limit) and `cli_usage` (`cua usage` past the allowance). `other`
otherwise.
-- `kind`: which cap: `sessions` (live sessions at once), `hours` (remote hours
+- `kind`: which cap: `sessions` (computers in use at once), `hours` (remote hours
this month), `machines` (team computers), `seats` (team seats), `other`, or
`none` for a link that was not opened from a limit.
- `plan`: the plan you were on, as the app or CLI knew it: `free`, `pro`,
diff --git a/docs/content/docs/cua-sdk/reference/typescript/spaces.mdx b/docs/content/docs/cua-sdk/reference/typescript/spaces.mdx
index 9c665d5367..067cb00ebc 100644
--- a/docs/content/docs/cua-sdk/reference/typescript/spaces.mdx
+++ b/docs/content/docs/cua-sdk/reference/typescript/spaces.mdx
@@ -636,13 +636,13 @@ workingBots(chatID): string[];
### PlanLimitError
-The relay refused a new live session because the account's plan is at its
+The relay refused a new computer in use because the account's plan is at its
cap (HTTP 429, `x-cua-relay-error: plan_limit_sessions|plan_limit_hours`).
-Live sessions are never cut and retrying gets the same answer: close one,
+Computers already in use are never cut and retrying gets the same answer: close one,
or send the person to [PlanLimitError.upgradeUrl](#property-upgradeurl).
-`message` is the plain sentence, such as "You're using 5 of 5 live sessions
-on Pro. Close one or upgrade to Teams."
+`message` is the plain sentence, such as "You have 5 of 5 computers in use at
+once on Pro. Close one or upgrade to Teams."
#### Extends
diff --git a/docs/content/docs/spaces/concepts/how-spaces-works.mdx b/docs/content/docs/spaces/concepts/how-spaces-works.mdx
index fe68e3a710..2c066d41d7 100644
--- a/docs/content/docs/spaces/concepts/how-spaces-works.mdx
+++ b/docs/content/docs/spaces/concepts/how-spaces-works.mdx
@@ -42,7 +42,7 @@ Every Space runs `cua-spacesd`. It streams the screen, takes input through
- **Through the relay.** A computer set up with `cua host setup` joins the cua.ai
relay with an outbound connection, so you don't open ports. Your other
computers, and people you share a Space with, reach it through the relay. Relay
- use counts toward your [plan's](/spaces/guides/teams#plans) live sessions and
+ use counts toward your [plan's](/spaces/guides/teams#plans) computers in use at once and
remote hours.
For what the relay can and can't see, see
diff --git a/docs/content/docs/spaces/guides/relay-security.mdx b/docs/content/docs/spaces/guides/relay-security.mdx
index a4d3f4aa0e..d0f7110d25 100644
--- a/docs/content/docs/spaces/guides/relay-security.mdx
+++ b/docs/content/docs/spaces/guides/relay-security.mdx
@@ -345,7 +345,7 @@ The relay applies the rules you already manage:
### Your plan allowance
A desktop view, terminal or agent session over the mesh counts toward your
-plan's live sessions, the same as one over the relay's HTTPS path, and one
+plan's computers in use at once, the same as one over the relay's HTTPS path, and one
computer reached both ways at once counts once. Remote hours count only the
time a session's traffic goes through the relay: a direct connection uses
none. `cua usage` and the app's Settings show both.
diff --git a/docs/content/docs/spaces/guides/teams.mdx b/docs/content/docs/spaces/guides/teams.mdx
index 24ea02d832..830a9b0108 100644
--- a/docs/content/docs/spaces/guides/teams.mdx
+++ b/docs/content/docs/spaces/guides/teams.mdx
@@ -12,14 +12,18 @@ that lets your computers reach your computers. Current prices are on
## Plans
-| Plan | Price | Live sessions | Remote hours |
+| Plan | Price | Computers in use at once | Remote hours |
| --- | --- | --- | --- |
| Free | $0 | 2 | 20 a month |
| Pro | $18 a month or $180 a year, one person | 5 | 200 a month |
| Teams | $30 per seat a month or $300 per seat a year, 1 to 100 seats | 5 per seat | 200 per seat a month, pooled across the team |
+"Computers in use at once" counts the computers you are connected to from somewhere
+else right now. Close one to free its place. Using a computer from itself never
+counts.
+
Every plan includes Spaces on every computer you connect and Teleport. Pro adds
-more live sessions and remote hours. Teams adds sharing a Space with your team,
+more computers in use at once and remote hours. Teams adds sharing a Space with your team,
team-owned computers, roles and computer approval. Sharing is for teams: Free and
Pro accounts without a team cannot share a Space. SSO and audit export are not
included yet.
@@ -39,9 +43,9 @@ and don't count.
## See your usage
-Open **Settings** in Cua Spaces. The usage row shows your live sessions and
-remote hours this month, for example 1 of 2 live sessions and 6.5 of 20 remote
-hours, and the plan card shows your plan. To read the same numbers in a
+Open **Settings** in Cua Spaces. The usage row shows your computers in use and
+remote hours this month, for example 1 of 2 computers in use at once and 6.5 of 20
+remote hours, and the plan card shows your plan. To read the same numbers in a
terminal, run `cua usage`.
When you have used 80% of your remote hours, the app shows a notice with an
@@ -74,7 +78,7 @@ before it can reach a team computer.
</VideoDemo>
Teams starts with 1 seat, for you. Start with just yourself, then add a seat for
-each teammate when you invite them. Two seats give 10 live sessions and 400 remote hours a month for the
+each teammate when you invite them. Two seats give 10 computers in use at once and 400 remote hours a month for the
whole team.
1. Open [app.cua.ai/buy/teams](https://app.cua.ai/buy/teams) and sign in or
diff --git a/libs/cua-spacesd/crates/cua-relay/HOSTED.md b/libs/cua-spacesd/crates/cua-relay/HOSTED.md
index fa137218a8..d4e280b9d8 100644
--- a/libs/cua-spacesd/crates/cua-relay/HOSTED.md
+++ b/libs/cua-spacesd/crates/cua-relay/HOSTED.md
@@ -49,9 +49,9 @@ These flags exist only with the feature on (`cua-relay --help`).
| Env var | Default | Meaning |
|---|---|---|
-| `CUA_RELAY_METERING` | `on` | Account mode: meter live sessions and relay hours against the plan allowances. Measure and prompt; plans in `CUA_RELAY_ENFORCE_PLANS` (default empty: off) are also refused at their live-session limit (see `CUA_RELAY_ENFORCE_PLANS`). |
-| `CUA_RELAY_ALLOWANCES` | `free=2/20,pro=5/200,teams=5/200` | `plan=SESSIONS/HOURS`: live sessions at a time and relay hours per calendar month (UTC). For a team plan the numbers are per seat and pooled. Must include `free`. |
-| `CUA_RELAY_ENFORCE_PLANS` | empty (off) | Plans whose caps are enforced (`free,pro`): a NEW session past the live-session or hours cap is refused on every path: a WebSocket upgrade or a long gRPC stream (process, terminal and watch RPCs, decided at stream open from the method path; list, health and other short calls are never refused) through the HTTPS proxy gets 429 (gRPC callers `ResourceExhausted`), an `x-cua-relay-error` of `plan_limit_sessions` or `plan_limit_hours`, used and limit headers and a plain sentence body; a mesh session a machine reports for a peer is refused by dropping that peer from the machine's network map for 30 s (the machine tears the session down, relayed packets stop; the held sessions of other peers are untouched). A machine the user already holds a session on is never refused and live sessions are never cut (in memory, one lock, plan from the cached entitlements). Other plans are measure and prompt only. |
+| `CUA_RELAY_METERING` | `on` | Account mode: meter computers in use at once and relay hours against the plan allowances. Measure and prompt; plans in `CUA_RELAY_ENFORCE_PLANS` (default empty: off) are also refused at their computers-in-use limit (see `CUA_RELAY_ENFORCE_PLANS`). |
+| `CUA_RELAY_ALLOWANCES` | `free=2/20,pro=5/200,teams=5/200` | `plan=SESSIONS/HOURS`: computers in use at a time and relay hours per calendar month (UTC). For a team plan the numbers are per seat and pooled. Must include `free`. |
+| `CUA_RELAY_ENFORCE_PLANS` | empty (off) | Plans whose caps are enforced (`free,pro`): a NEW session past the computers-in-use or hours cap is refused on every path: a WebSocket upgrade or a long gRPC stream (process, terminal and watch RPCs, decided at stream open from the method path; list, health and other short calls are never refused) through the HTTPS proxy gets 429 (gRPC callers `ResourceExhausted`), an `x-cua-relay-error` of `plan_limit_sessions` or `plan_limit_hours`, used and limit headers and a plain sentence body; a mesh session a machine reports for a peer is refused by dropping that peer from the machine's network map for 30 s (the machine tears the session down, relayed packets stop; the held sessions of other peers are untouched). A machine the user already holds a session on is never refused and live sessions are never cut (in memory, one lock, plan from the cached entitlements). Other plans are measure and prompt only. |
| `CUA_RELAY_UPGRADE_URL` | `https://cua.ai/pricing` | Where the allowance prompt links (pricing page or a Payment Link). |
| `CUA_RELAY_USAGE_FILE` | next to the state file | This month's totals per user (`machines.json` gives `machines.usage.json`), written at most every 5 minutes. |
| `CUA_RELAY_PLANS_FILE` | unset (everyone Free) | Plans and teams, reloaded when it changes: `{"users": {"<sub or email>": "pro"}, "teams": {"<id>": {"plan": "teams", "seats": 5, "members": ["<sub or email>"]}}}`. |
diff --git a/libs/cua-spacesd/crates/cua-relay/src/hosted.rs b/libs/cua-spacesd/crates/cua-relay/src/hosted.rs
index aebd356ee3..646c497bd2 100644
--- a/libs/cua-spacesd/crates/cua-relay/src/hosted.rs
+++ b/libs/cua-spacesd/crates/cua-relay/src/hosted.rs
@@ -25,7 +25,7 @@ use crate::storage::Storage;
/// The hosted relay's command-line settings (flattened into `cua-relay`'s).
#[derive(clap::Args, Debug)]
pub struct HostedArgs {
- /// Account mode: meter live sessions and relay hours against the plan
+ /// Account mode: meter computers in use at once and relay hours against the plan
/// allowances (`on` / `off`). Measure and prompt only, never refuses.
#[arg(long, env = "CUA_RELAY_METERING", default_value = "on")]
pub metering: String,
@@ -33,7 +33,7 @@ pub struct HostedArgs {
/// time, relay hours a month; per seat, pooled, for a team plan).
#[arg(long, env = "CUA_RELAY_ALLOWANCES", default_value = crate::meter::DEFAULT_ALLOWANCES)]
pub allowances: String,
- /// Plans whose live-session limit is enforced: a session past it is
+ /// Plans whose computers-in-use limit is enforced: a session past it is
/// refused (429). Other plans stay measure and prompt only.
#[arg(long, env = "CUA_RELAY_ENFORCE_PLANS", default_value = crate::meter::DEFAULT_ENFORCE_PLANS)]
pub enforce_plans: String,
diff --git a/libs/cua-spacesd/crates/cua-relay/src/meter.rs b/libs/cua-spacesd/crates/cua-relay/src/meter.rs
index 06668caf7a..e3e1044037 100644
--- a/libs/cua-spacesd/crates/cua-relay/src/meter.rs
+++ b/libs/cua-spacesd/crates/cua-relay/src/meter.rs
@@ -6,7 +6,7 @@
//!
//! Measure and prompt, plus one refusal: a plan in
//! [`MeterConfig::enforce_plans`] (Pro) cannot open a NEW session past its
-//! live-session or hours allowance, on any path a session can take: a
+//! computers-in-use or hours allowance, on any path a session can take: a
//! WebSocket upgrade, a long gRPC stream (process, terminal and watch
//! RPCs) through the HTTPS proxy ([`Meter::enter_enforced`], 429 or gRPC
//! `ResourceExhausted`), or a mesh session a machine reports
@@ -76,7 +76,7 @@ const PLAN_WARM_TIMEOUT: Duration = Duration::from_secs(3);
pub const DEFAULT_PLAN: &str = "free";
/// Where the upgrade prompt links by default (the pricing page).
pub const DEFAULT_UPGRADE_URL: &str = "https://cua.ai/pricing";
-/// Default allowances: Free is 2 live sessions and 20 hours a month. Pro
+/// Default allowances: Free is 2 computers in use at once and 20 hours a month. Pro
/// and Teams (per seat) are placeholders until their numbers are set.
pub const DEFAULT_ALLOWANCES: &str = "free=2/20,pro=5/200,teams=5/200";
@@ -438,7 +438,7 @@ pub struct UsageView {
pub team: Option<TeamView>,
/// Live remote sessions now (the pool's).
pub live_sessions: u32,
- /// Allowed live sessions at a time (the pool's).
+ /// Allowed computers in use at a time (the pool's).
pub live_sessions_limit: u32,
/// Relay hours used this period (the pool's), one decimal.
pub hours_used: f64,
@@ -515,7 +515,7 @@ impl Refusal {
other => other,
};
let (what, hint) = if self.code == "plan_limit_sessions" {
- ("live sessions", "Close one or upgrade")
+ ("computers in use at once", "Close one or upgrade")
} else {
("remote hours this month", "Upgrade to keep going")
};
@@ -524,6 +524,12 @@ impl Refusal {
} else {
hint.to_owned()
};
+ if self.code == "plan_limit_sessions" {
+ return format!(
+ "You have {} of {} {what} on {plan}. {hint}: {}",
+ self.used, self.limit, self.upgrade_url
+ );
+ }
format!(
"You're using {} of {} {what} on {plan}. {hint}: {}",
self.used, self.limit, self.upgrade_url
@@ -1424,7 +1430,7 @@ fn error(status: StatusCode, message: impl Into<String>) -> Response {
(status, Json(serde_json::json!({"error": message.into()}))).into_response()
}
-/// `GET /v1/usage`: the caller's live sessions and relay hours against its
+/// `GET /v1/usage`: the caller's computers in use at once and relay hours against its
/// allowance. Needs the account token only (no enrolled device): it shows
/// nothing but the caller's own counts.
async fn usage(Extract(relay): Extract<Relay>, headers: HeaderMap) -> Response {
@@ -1538,7 +1544,7 @@ mod tests {
let r = m.enter_enforced(&ada, "m5").unwrap_err();
assert_eq!(r.code, "plan_limit_sessions");
assert!(r.message().starts_with(
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams"
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams"
));
// Free is refused at 2.
let bob = who("bob", "[email protected]");
diff --git a/libs/cua-spacesd/crates/cua-relay/tests/metering.rs b/libs/cua-spacesd/crates/cua-relay/tests/metering.rs
index 7612aece04..55dc346efc 100644
--- a/libs/cua-spacesd/crates/cua-relay/tests/metering.rs
+++ b/libs/cua-spacesd/crates/cua-relay/tests/metering.rs
@@ -194,7 +194,7 @@ async fn past_the_allowance_the_session_continues_with_an_upgrade_prompt() {
assert_eq!(v["hours_limit"], 20);
assert_eq!(v["soft_limit_reached"], false);
- // Two held streams on two machines: two live sessions, one over.
+ // Two held streams on two machines: two computers in use, one over.
let held: Vec<_> = ids
.iter()
.map(|id| gate.send(http.get(format!("{base}/m/{id}/slow")).bearer_auth(&ada)))
@@ -440,7 +440,10 @@ async fn a_long_grpc_stream_is_refused_past_an_enforced_cap_and_short_calls_neve
assert_eq!(r.headers()["x-cua-relay-error"], "plan_limit_sessions");
assert_eq!(r.headers()["x-cua-relay-limit"], "1");
let message = r.headers()["grpc-message"].to_str().unwrap().to_owned();
- assert!(message.contains("live%20sessions") || message.contains("live sessions"));
+ assert!(
+ message.contains("computers%20in%20use%20at%20once")
+ || message.contains("computers in use at once")
+ );
// Watches hold sessions too.
let r = call(&ids[1], "WindowsService/WatchWindows").await;
assert_eq!(r.headers()["grpc-status"], "8");
diff --git a/libs/cua/crates/cua-byoc/tests/session_allowance.rs b/libs/cua/crates/cua-byoc/tests/session_allowance.rs
index 28654783f0..222b0aeed6 100644
--- a/libs/cua/crates/cua-byoc/tests/session_allowance.rs
+++ b/libs/cua/crates/cua-byoc/tests/session_allowance.rs
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Cua AI, Inc.
-//! Spaces in your own cloud count against your plan's live sessions (a
+//! Spaces in your own cloud count against your plan's computers in use at once (a
//! Space on a pool host is reached through the relay). A Free-plan account
//! with no session left asks for a Space in its cloud: it is refused with
//! the plan's numbers and the upgrade path, and no cloud machine is bought.
@@ -115,7 +115,7 @@ async fn a_free_plan_with_no_session_left_buys_no_cloud_machine() {
assert_eq!(e.tag(), "limit_exceeded", "{e}");
let m = e.to_string();
assert!(
- m.contains("Your plan allows 2 live sessions (2 in use)"),
+ m.contains("Your plan allows 2 computers in use at once (2 in use now)"),
"{m}"
);
assert!(m.contains("needs 1"), "{m}");
diff --git a/libs/cua/crates/cua-cli/src/lib.rs b/libs/cua/crates/cua-cli/src/lib.rs
index 543d813fbe..de7d7a56ff 100644
--- a/libs/cua/crates/cua-cli/src/lib.rs
+++ b/libs/cua/crates/cua-cli/src/lib.rs
@@ -399,7 +399,7 @@ enum Command {
cua ci disconnect"
)]
Ci(ci_cmd::CiCmd),
- /// Your remote use this month: live sessions, remote hours, and your
+ /// Your remote use this month: computers in use at once, remote hours, and your
/// plan. Remote hours are time spent using your computers from
/// somewhere else; using a computer from itself is free.
#[command(after_help = "Examples:
diff --git a/libs/cua/crates/cua-cli/src/usage_cmd.rs b/libs/cua/crates/cua-cli/src/usage_cmd.rs
index 8c501d5146..2e52a4ab8a 100644
--- a/libs/cua/crates/cua-cli/src/usage_cmd.rs
+++ b/libs/cua/crates/cua-cli/src/usage_cmd.rs
@@ -68,7 +68,7 @@ fn print(u: &RelayUsage, out: &mut dyn Write) {
line(
out,
format!(
- "Live sessions: {}",
+ "Computers in use: {}",
of(
u.live_sessions.to_string(),
u.live_sessions_limit.map(|l| l.to_string())
@@ -164,7 +164,7 @@ fn print(u: &RelayUsage, out: &mut dyn Write) {
line(
out,
format!(
- "Your Spaces keep working. New live sessions wait until there is room.{upgrade}"
+ "Your Spaces keep working. Connecting to more computers waits until there is room.{upgrade}"
),
);
}
@@ -218,7 +218,7 @@ mod tests {
relay.set_usage(Some(usage.clone()));
let t = text(&relay, false).await;
assert!(t.contains("Plan: free (2026-10)"), "{t}");
- assert!(t.contains("Live sessions: 1 of 2"), "{t}");
+ assert!(t.contains("Computers in use: 1 of 2"), "{t}");
assert!(t.contains("Remote hours: 6.5 of 20 this month"), "{t}");
assert!(!t.contains("Team pool") && !t.contains("reached"), "{t}");
@@ -255,7 +255,7 @@ mod tests {
})));
let t = text(&relay, false).await;
assert!(
- t.contains("You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams. Upgrade: https://app.cua.ai/buy/teams"),
+ t.contains("You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams. Upgrade: https://app.cua.ai/buy/teams"),
"{t}"
);
assert!(!t.contains("remote hours this month on"), "{t}");
@@ -264,11 +264,12 @@ mod tests {
#[test]
fn a_refused_session_error_carries_the_sentence_and_the_upgrade_link() {
let e = crate::host::host_err(cua_host::Error::PlanLimit(
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.".into(),
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
+ .into(),
));
let m = e.to_string();
assert!(
- m.contains("You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams. Upgrade: https://"),
+ m.contains("You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams. Upgrade: https://"),
"{m}"
);
// The link says the CLI showed it.
diff --git a/libs/cua/crates/cua-compat/examples/mock_gateway.rs b/libs/cua/crates/cua-compat/examples/mock_gateway.rs
index 42d1da879a..ab8ffe57d3 100644
--- a/libs/cua/crates/cua-compat/examples/mock_gateway.rs
+++ b/libs/cua/crates/cua-compat/examples/mock_gateway.rs
@@ -30,7 +30,7 @@ async fn main() {
let (guest, addr) = spec.split_once('=').expect("--port GUEST=HOST:PORT");
ports.push((guest.parse::<u16>().expect("guest port"), addr.to_string()));
}
- // Every create answers the live-session limit (for SDK repros).
+ // Every create answers the computers-in-use limit (for SDK repros).
"--plan-limit" => plan_limit = true,
other => panic!("unknown argument {other}"),
}
@@ -41,7 +41,7 @@ async fn main() {
}
if plan_limit {
*backend.create_fails.lock().await = Some(cua_compat::backend::BackendError::RateLimited(
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro."
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
.into(),
));
}
diff --git a/libs/cua/crates/cua-compat/src/backend.rs b/libs/cua/crates/cua-compat/src/backend.rs
index a571fb35b0..6e5d030375 100644
--- a/libs/cua/crates/cua-compat/src/backend.rs
+++ b/libs/cua/crates/cua-compat/src/backend.rs
@@ -24,7 +24,7 @@ pub enum BackendError {
Unsupported(String),
#[error("{0}")]
Timeout(String),
- /// The account is at its live-session (or remote-hours) limit: the
+ /// The account is at its computers-in-use (or remote-hours) limit: the
/// message is the plan-limit sentence with its upgrade path, verbatim.
/// Providers answer their rate-limit error (HTTP 429).
#[error("{0}")]
@@ -36,7 +36,7 @@ pub enum BackendError {
impl From<CuaError> for BackendError {
fn from(e: CuaError) -> Self {
let msg = e.to_string();
- // The relay's plan limit ("You're using N of N live sessions on
+ // The relay's plan limit ("You're using N of N computers in use at once on
// <plan>. ...") reaches us as text inside whatever error carried it.
if cua_home::plan_limit::PlanLimit::parse(&msg).is_some() {
return BackendError::RateLimited(plan_limit_sentence(&msg));
@@ -1552,13 +1552,13 @@ mod default_tests {
#[test]
fn a_plan_limit_error_is_rate_limited_with_its_sentence_verbatim() {
let wrapped = CuaError::Internal(
- "rpc failed: You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro. (resource exhausted)"
+ "rpc failed: You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro. (resource exhausted)"
.into(),
);
match BackendError::from(wrapped) {
BackendError::RateLimited(m) => assert_eq!(
m,
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro."
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
),
other => panic!("{other:?}"),
}
diff --git a/libs/cua/crates/cua-compat/tests/daytona_api.rs b/libs/cua/crates/cua-compat/tests/daytona_api.rs
index b9765764d1..31d95ec1a8 100644
--- a/libs/cua/crates/cua-compat/tests/daytona_api.rs
+++ b/libs/cua/crates/cua-compat/tests/daytona_api.rs
@@ -892,19 +892,20 @@ async fn unbuildable_requests_are_refused_with_their_reason_not_accepted() {
assert_eq!(sb["disk"], 3);
}
-/// An account at its live-session limit gets Daytona's rate-limit error
+/// An account at its computers-in-use limit gets Daytona's rate-limit error
/// (HTTP 429), with the plan-limit sentence and its upgrade path verbatim.
#[tokio::test]
async fn the_live_session_limit_is_a_429_with_its_sentence() {
let g = start().await;
*g.mock.create_fails.lock().await = Some(cua_compat::backend::BackendError::RateLimited(
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro.".into(),
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
+ .into(),
));
let (s, b) = g.post("/sandbox", json!({"name": "over"})).await;
assert_eq!(s, 429, "{b}");
assert!(
b.to_string().contains(
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro."
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
),
"{b}"
);
diff --git a/libs/cua/crates/cua-compat/tests/gateway.rs b/libs/cua/crates/cua-compat/tests/gateway.rs
index 3fcf1334c1..7da1c3d089 100644
--- a/libs/cua/crates/cua-compat/tests/gateway.rs
+++ b/libs/cua/crates/cua-compat/tests/gateway.rs
@@ -1021,7 +1021,7 @@ async fn start_warmed_makes_the_first_create_before_it_returns() {
}
}
-/// An account at its live-session limit gets E2B's rate-limit error (HTTP
+/// An account at its computers-in-use limit gets E2B's rate-limit error (HTTP
/// 429, which the SDKs raise as RateLimitException), with the plan-limit
/// sentence and its upgrade path verbatim.
#[tokio::test]
@@ -1029,7 +1029,8 @@ async fn the_live_session_limit_is_a_429_with_its_sentence() {
let dir = tempfile::tempdir().unwrap();
let backend = Arc::new(MockBackend::new());
*backend.create_fails.lock().await = Some(cua_compat::backend::BackendError::RateLimited(
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro.".into(),
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
+ .into(),
));
let mut o = GatewayOptions::new(Provider::E2b);
o.listen = "127.0.0.1:0".parse().unwrap();
@@ -1048,7 +1049,7 @@ async fn the_live_session_limit_is_a_429_with_its_sentence() {
let v: Value = r.json().await.unwrap();
assert_eq!(
v["message"],
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro."
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
);
}
}
diff --git a/libs/cua/crates/cua-home/src/plan_limit.rs b/libs/cua/crates/cua-home/src/plan_limit.rs
index 6799d080f5..d0d23cc4ad 100644
--- a/libs/cua/crates/cua-home/src/plan_limit.rs
+++ b/libs/cua/crates/cua-home/src/plan_limit.rs
@@ -1,9 +1,9 @@
//! The relay's plan-limit refusal, in plain words, for every client.
//!
-//! The relay answers a NEW live session over the plan's cap with HTTP 429
+//! The relay answers a NEW computer in use over the plan's cap with HTTP 429
//! and `x-cua-relay-error: plan_limit_sessions` (or `plan_limit_hours`),
//! plus `x-cua-relay-plan`, `x-cua-relay-used` and `x-cua-relay-limit`.
-//! Live sessions are never cut. The host client turns those headers into
+//! Computers already in use are never cut. The host client turns those headers into
//! one sentence ([`PlanLimit::sentence`]); the apps read the same sentence
//! back ([`PlanLimit::parse`]) to show it with an Upgrade button. No
//! dependencies, so the wasm build can use it.
@@ -20,7 +20,7 @@ pub const LIMIT_HEADER: &str = "x-cua-relay-limit";
/// Which cap was hit.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Kind {
- /// Live sessions at once.
+ /// Computers in use at once.
Sessions,
/// Remote hours this month.
Hours,
@@ -159,13 +159,13 @@ impl PlanLimit {
}
}
- /// "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ /// "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
pub fn sentence(&self) -> String {
let plan = plan_name(&self.plan);
let (used, limit) = (number(self.used), number(self.limit));
match self.kind {
Kind::Sessions => format!(
- "You're using {used} of {limit} live sessions on {plan}. {}",
+ "You have {used} of {limit} computers in use at once on {plan}. {}",
self.next_step()
),
Kind::Hours => format!(
@@ -178,7 +178,11 @@ impl PlanLimit {
/// Reads [`PlanLimit::sentence`] back out of an error's text (which may
/// wrap it). None for any other text.
pub fn parse(text: &str) -> Option<Self> {
+ // The sessions sentence has two wordings: the current one, and the
+ // old "live sessions" one that older relays, daemons and SDKs still
+ // send. Both are read.
for (marker, kind, tail) in [
+ ("You have ", Kind::Sessions, " computers in use at once on "),
("You're using ", Kind::Sessions, " live sessions on "),
("You've used ", Kind::Hours, " remote hours this month on "),
] {
@@ -257,9 +261,10 @@ mod tests {
"https://app.cua.ai/b"
);
}
- let l =
- PlanLimit::parse("You're using 5 of 5 live sessions on Teams. Close one or add seats.")
- .unwrap();
+ let l = PlanLimit::parse(
+ "You have 5 of 5 computers in use at once on Teams. Close one or add seats.",
+ )
+ .unwrap();
assert_eq!(
l.upgrade_url_from("https://app.cua.ai", "app_connect"),
"https://app.cua.ai/billing?from=app_connect"
@@ -276,7 +281,7 @@ mod tests {
let l = h("plan_limit_sessions", "pro", "5", "5").unwrap();
assert_eq!(
l.sentence(),
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
);
assert_eq!(
l.upgrade_url("https://app.cua.ai/"),
@@ -289,7 +294,7 @@ mod tests {
let l = h("plan_limit_sessions", "free", "2", "2").unwrap();
assert_eq!(
l.sentence(),
- "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro."
+ "You have 2 of 2 computers in use at once on the free plan. Close one or upgrade to Pro."
);
let l = h("plan_limit_hours", "free", "20.04", "20").unwrap();
assert_eq!(
@@ -318,6 +323,36 @@ mod tests {
assert_eq!(PlanLimit::parse("no machine image is configured"), None);
}
+ #[test]
+ fn the_old_live_sessions_sentence_still_reads() {
+ // Older relays, daemons and SDKs send this wording; newer clients
+ // must still read it, and read it as the same limit.
+ let old = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.";
+ let l = PlanLimit::parse(old).unwrap();
+ assert_eq!(l, h("plan_limit_sessions", "pro", "5", "5").unwrap());
+ assert_eq!(
+ PlanLimit::parse(&format!("relay: HTTP 429: {old}")),
+ Some(l)
+ );
+ let free = PlanLimit::parse(
+ "You're using 2 of 2 live sessions on the free plan. Close one or upgrade to Pro.",
+ )
+ .unwrap();
+ assert_eq!(free.plan, "free");
+ assert_eq!((free.used, free.limit), (2.0, 2.0));
+ }
+
+ #[test]
+ fn the_new_sentence_has_none_of_the_old_words() {
+ for plan in ["free", "pro", "team"] {
+ let s = h("plan_limit_sessions", plan, "2", "2").unwrap().sentence();
+ assert!(s.contains("computers in use at once"), "{s}");
+ for old in ["live sessions", "machines at once", "connections at once"] {
+ assert!(!s.to_lowercase().contains(old), "{s}");
+ }
+ }
+ }
+
#[test]
fn other_refusals_are_not_plan_limits() {
assert!(h("rate_limited", "pro", "5", "5").is_none());
diff --git a/libs/cua/crates/cua-host/src/relay.rs b/libs/cua/crates/cua-host/src/relay.rs
index 73274cb013..3f3761935c 100644
--- a/libs/cua/crates/cua-host/src/relay.rs
+++ b/libs/cua/crates/cua-host/src/relay.rs
@@ -518,9 +518,9 @@ pub struct RelayUsage {
/// The team whose allowance is pooled, if any.
#[serde(skip_serializing_if = "Option::is_none")]
pub team: Option<RelayUsageTeam>,
- /// Live sessions now.
+ /// Computers in use now.
pub live_sessions: u32,
- /// Live sessions allowed at once (none: no limit).
+ /// Computers in use allowed at once (none: no limit).
pub live_sessions_limit: Option<u32>,
/// Relay hours used this month (the team's, when pooled).
pub hours_used: f64,
@@ -1791,7 +1791,7 @@ mod tests {
("x-cua-relay-used", "5"),
("x-cua-relay-limit", "5"),
],
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams: https://x",
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams: https://x",
)
}
}),
@@ -1804,7 +1804,7 @@ mod tests {
assert!(matches!(e, Error::PlanLimit(_)), "{e:?}");
assert_eq!(
e.to_string(),
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
);
assert_eq!(e.http_status(), Some(429));
assert!(!e.is_transient());
diff --git a/libs/cua/crates/cua-spaces-app-core/src/first_run.rs b/libs/cua/crates/cua-spaces-app-core/src/first_run.rs
index d117b1d69c..91bdf96297 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/first_run.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/first_run.rs
@@ -273,7 +273,7 @@ pub struct FirstRunPlan {
pub metered: bool,
/// `free`, `pro`, `team`.
pub plan: String,
- /// Free's connections at once (default 2).
+ /// Free's computers in use at once (default 2).
pub sessions_limit: Option<u32>,
/// Free's remote hours a month (default 20).
pub hours_limit: Option<u32>,
@@ -1784,8 +1784,10 @@ pub fn upsell(plan: &FirstRunPlan, agent_used: bool) -> Option<UpsellCard> {
plan: "pro".into(),
title: "More remote hours with Pro".into(),
lines: vec![
- format!("Free: {hours} remote hours a month · {sessions} connections at once"),
- format!("Pro: {PRO_HOURS} remote hours a month · {PRO_SESSIONS} connections at once"),
+ format!("Free: {hours} remote hours a month · {sessions} computers in use at once"),
+ format!(
+ "Pro: {PRO_HOURS} remote hours a month · {PRO_SESSIONS} computers in use at once"
+ ),
],
price: "$18 a month".into(),
cta: button("upsell", "Try Pro"),
diff --git a/libs/cua/crates/cua-spaces-app-core/src/relay_usage.rs b/libs/cua/crates/cua-spaces-app-core/src/relay_usage.rs
index f945e248a3..74423235e4 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/relay_usage.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/relay_usage.rs
@@ -26,7 +26,7 @@ pub const ROW_LABEL: &str = "Remote use";
/// Free plan card, `cua usage`). The relay meters the time an account has
/// at least one live session through it; a computer used from itself never
/// goes through the relay.
-pub const REMOTE_HOURS_MEANING: &str = "Remote hours: time spent using your machines from somewhere else (your laptop, phone or an agent on another machine). Using a machine from itself is free.";
+pub const REMOTE_HOURS_MEANING: &str = "Remote hours: time spent using your computers from somewhere else (your laptop, phone or an agent on another computer). Using a computer from itself is free.";
/// The notice's button.
pub const UPGRADE: &str = "Upgrade";
@@ -76,9 +76,9 @@ pub struct RelayUsage {
pub plan: String,
/// The team whose allowance is pooled.
pub team: Option<RelayUsageTeam>,
- /// Live sessions now.
+ /// Computers in use now.
pub live_sessions: u32,
- /// Live sessions allowed at once (none: no limit).
+ /// Computers in use allowed at once (none: no limit).
pub live_sessions_limit: Option<u32>,
/// Relay hours used this month (the team's, when pooled).
pub hours_used: f64,
@@ -98,7 +98,7 @@ pub struct RelayUsage {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RelayAllowanceNotice {
- /// On Free: "You're using 2 of 2 live sessions on the free plan. ..."
+ /// On Free: "You have 2 of 2 computers in use at once on the free plan. ..."
pub text: String,
/// [`UPGRADE`].
pub upgrade: String,
@@ -134,7 +134,7 @@ pub fn plan_word(plan: &str) -> &'static str {
}
/// The cap a `limit` notice is about: the month's remote hours when they
-/// are past the allowance (the one that lasts), else live sessions.
+/// are past the allowance (the one that lasts), else computers in use.
fn limit_kind(u: &RelayUsage) -> &'static str {
if !u.soft_limit_reached {
"none"
@@ -179,7 +179,7 @@ pub struct PlanCard {
pub struct RelayUsageView {
/// [`ROW_LABEL`].
pub label: String,
- /// "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month", then the
+ /// "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month", then the
/// team pool when there is one.
pub line: String,
/// "Free plan" (empty when the relay names none).
@@ -213,7 +213,7 @@ pub fn hours(h: f64) -> String {
}
}
-/// "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month".
+/// "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month".
pub fn usage_line(u: &RelayUsage) -> String {
let of = |used: String, limit: Option<String>| match limit {
Some(l) => format!("{used} of {l}"),
@@ -224,7 +224,7 @@ pub fn usage_line(u: &RelayUsage) -> String {
u.live_sessions_limit.map(|l| l.to_string()),
);
let relay_hours = of(hours(u.hours_used), u.hours_limit.map(hours));
- format!("Live sessions {sessions} \u{b7} Remote hours {relay_hours} this month")
+ format!("Computers in use {sessions} \u{b7} Remote hours {relay_hours} this month")
}
/// "Free plan", "Pro plan"; empty when the relay names none.
@@ -274,7 +274,7 @@ pub fn dismiss_key(u: &RelayUsage) -> String {
/// Folds the relay's Free-limit `warnings` (at or over an allowance) into
/// the "reached" flag and `reasons` the apps already draw from, so a Free
-/// person sees the prompt at 2 of 2 live sessions, not only past it.
+/// person sees the prompt at 2 of 2 computers in use, not only past it.
pub fn with_warnings(
reached: bool,
mut reasons: Vec<String>,
@@ -296,8 +296,8 @@ pub fn with_warnings(
}
/// What the relay says when it refuses a new session over the cap
-/// ([`cua_home::plan_limit`]), for each cap this account is at: "You're
-/// using 5 of 5 live sessions on Pro. Close one or upgrade to Teams." Empty
+/// ([`cua_home::plan_limit`]), for each cap this account is at: "You
+/// have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams." Empty
/// when no cap with a known limit is reached.
fn plan_limit_sentences(u: &RelayUsage) -> String {
use cua_home::plan_limit::{Kind, PlanLimit};
@@ -326,7 +326,7 @@ fn plan_limit_sentences(u: &RelayUsage) -> String {
}
/// The usage with the caps it is at counted as reached: a plan at 5 of 5
-/// live sessions has its next session refused, so the apps say so before
+/// computers in use at once has its next one refused, so the apps say so before
/// that happens, on every plan (Free's relay warning does the same).
fn at_cap(u: &RelayUsage) -> RelayUsage {
let mut u = u.clone();
@@ -356,7 +356,7 @@ fn at_cap(u: &RelayUsage) -> RelayUsage {
pub fn notice_text(u: &RelayUsage) -> String {
if warns(u) {
return format!(
- "You've used {} of {} remote hours this month. Nothing stops at the limit. Pro gives you {PRO_HOURS} hours and {PRO_SESSIONS} live sessions.",
+ "You've used {} of {} remote hours this month. Nothing stops at the limit. Pro gives you {PRO_HOURS} hours and {PRO_SESSIONS} computers in use at once.",
hours(u.hours_used),
hours(u.hours_limit.unwrap_or_default()),
);
@@ -368,7 +368,10 @@ pub fn notice_text(u: &RelayUsage) -> String {
u.reasons.iter().any(|r| r == "sessions"),
u.live_sessions_limit,
) {
- parts.push(format!("{} of {limit} live sessions", u.live_sessions));
+ parts.push(format!(
+ "{} of {limit} computers in use at once",
+ u.live_sessions
+ ));
}
if let (true, Some(limit)) = (u.reasons.iter().any(|r| r == "hours"), u.hours_limit) {
parts.push(format!(
@@ -378,8 +381,13 @@ pub fn notice_text(u: &RelayUsage) -> String {
));
}
if !parts.is_empty() {
+ let verb = if u.reasons.iter().any(|r| r == "sessions") {
+ "You have"
+ } else {
+ "You're using"
+ };
return format!(
- "You're using {} on the free plan. Your Spaces keep working. Pro gives you {PRO_SESSIONS} live sessions and {PRO_HOURS} remote hours.",
+ "{verb} {} on the free plan. Your Spaces keep working. Pro gives you {PRO_SESSIONS} computers in use at once and {PRO_HOURS} remote hours.",
parts.join(" and ")
);
}
@@ -431,7 +439,10 @@ pub fn plan_card(u: &RelayUsage, account_app: &str) -> PlanCard {
url: buy(account_app, path, "app_plan_card"),
};
let allowance = |s: Option<u32>, h: Option<f64>| match (s, h) {
- (Some(s), Some(h)) => format!("{s} live sessions and {} remote hours a month", hours(h)),
+ (Some(s), Some(h)) => format!(
+ "{s} computers in use at once and {} remote hours a month",
+ hours(h)
+ ),
_ => "No limit on remote use".into(),
};
let (detail, primary, secondary) = match kind {
@@ -585,7 +596,7 @@ mod tests {
assert_eq!(v.label, "Remote use");
assert_eq!(
v.line,
- "Live sessions 1 of 2 \u{b7} Remote hours 6.5 of 20 this month"
+ "Computers in use 1 of 2 \u{b7} Remote hours 6.5 of 20 this month"
);
assert_eq!(v.plan, "Free plan");
assert_eq!(v.notice, None);
@@ -606,12 +617,12 @@ mod tests {
let v = view_for(&u, "https://app.cua.ai").unwrap();
assert_eq!(
v.line,
- "Live sessions 1 of 2 \u{b7} Remote hours 20.2 of 20 this month \u{b7} Team pool, 3 seats"
+ "Computers in use 1 of 2 \u{b7} Remote hours 20.2 of 20 this month \u{b7} Team pool, 3 seats"
);
let n = v.notice.unwrap();
assert_eq!(
n.text,
- "You're using 1 of 2 live sessions and 20.2 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 live sessions and 200 remote hours."
+ "You have 1 of 2 computers in use at once and 20.2 of 20 remote hours on the free plan. Your Spaces keep working. Pro gives you 5 computers in use at once and 200 remote hours."
);
assert_eq!(n.upgrade, "Upgrade");
assert_eq!(n.level, "limit");
@@ -712,7 +723,7 @@ mod tests {
assert_eq!(n.kind, "none", "a heads-up is not a limit");
assert_eq!(
n.text,
- "You've used 16 of 20 remote hours this month. Nothing stops at the limit. Pro gives you 200 hours and 5 live sessions."
+ "You've used 16 of 20 remote hours this month. Nothing stops at the limit. Pro gives you 200 hours and 5 computers in use at once."
);
assert_eq!(
n.upgrade_url.as_deref(),
@@ -759,7 +770,7 @@ mod tests {
assert_eq!((f.plan.as_str(), f.label.as_str()), ("free", "Free plan"));
assert_eq!(
f.detail,
- "2 live sessions and 20 remote hours a month. Remote hours: time spent using your machines from somewhere else (your laptop, phone or an agent on another machine). Using a machine from itself is free."
+ "2 computers in use at once and 20 remote hours a month. Remote hours: time spent using your computers from somewhere else (your laptop, phone or an agent on another computer). Using a computer from itself is free."
);
let p = f.primary.unwrap();
assert_eq!(
@@ -804,14 +815,14 @@ mod tests {
assert_eq!(team.plan, "teams");
assert_eq!(
team.detail,
- "10 live sessions and 400 remote hours a month across 2 seats, shared by the team."
+ "10 computers in use at once and 400 remote hours a month across 2 seats, shared by the team."
);
assert!(team.secondary.is_none());
}
#[test]
fn a_free_user_at_the_limit_is_asked_before_going_over() {
- // The relay's warnings fire at 2 of 2 live sessions, before anything is over.
+ // The relay's warnings fire at 2 of 2 computers in use, before anything is over.
let (reached, reasons) = with_warnings(false, vec![], &["free_limit_sessions".into()]);
assert!(reached);
let u = RelayUsage {
@@ -823,7 +834,7 @@ mod tests {
let n = view_for(&u, "https://app.cua.ai").unwrap().notice.unwrap();
assert_eq!(
n.text,
- "You're using 2 of 2 live sessions on the free plan. Your Spaces keep working. Pro gives you 5 live sessions and 200 remote hours."
+ "You have 2 of 2 computers in use at once on the free plan. Your Spaces keep working. Pro gives you 5 computers in use at once and 200 remote hours."
);
assert_eq!(n.upgrade, "Upgrade");
assert_eq!(
@@ -842,6 +853,46 @@ mod tests {
);
}
+ /// The plan limit is "computers in use at once" everywhere a person reads
+ /// it (CUA-3690): the usage line, the notices, the plan card and the
+ /// refusal sentence never say "live sessions", "machines at once" or
+ /// "connections at once".
+ #[test]
+ fn plan_copy_never_says_the_old_words() {
+ let old = ["live sessions", "machines at once", "connections at once"];
+ let mut texts = Vec::new();
+ for plan in ["free", "pro", "team", "teams"] {
+ for (live, hours_used) in [(1, 6.5), (2, 6.5), (5, 12.0), (1, 20.4), (1, 17.0)] {
+ let mut u = free();
+ u.plan = plan.into();
+ u.live_sessions = live;
+ u.hours_used = hours_used;
+ u.live_sessions_limit = Some(if plan == "free" { 2 } else { 5 });
+ if plan == "team" || plan == "teams" {
+ u.team = Some(RelayUsageTeam {
+ id: "t".into(),
+ seats: 2,
+ });
+ }
+ let u = at_cap(&u);
+ if let Some(v) = view_for(&u, "https://app.cua.ai/") {
+ texts.push(v.line);
+ texts.push(v.plan);
+ texts.extend(v.notice.map(|n| n.text));
+ texts.push(v.plan_card.detail);
+ }
+ texts.push(notice_text(&u));
+ texts.push(plan_limit_sentences(&u));
+ }
+ }
+ assert!(texts.iter().any(|t| t.contains("computers in use")));
+ for t in &texts {
+ for word in old {
+ assert!(!t.to_lowercase().contains(word), "{word:?} in {t:?}");
+ }
+ }
+ }
+
#[test]
fn pro_at_five_of_five_says_so_and_offers_teams() {
let u = RelayUsage {
@@ -855,12 +906,12 @@ mod tests {
let v = view_for(&u, "https://app.cua.ai").unwrap();
assert_eq!(
v.line,
- "Live sessions 5 of 5 \u{b7} Remote hours 12 of 200 this month"
+ "Computers in use 5 of 5 \u{b7} Remote hours 12 of 200 this month"
);
let n = v.notice.unwrap();
assert_eq!(
n.text,
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
);
assert_eq!((n.upgrade.as_str(), n.level.as_str()), ("Upgrade", "limit"));
assert_eq!(
@@ -882,11 +933,11 @@ mod tests {
#[test]
fn a_refused_session_becomes_the_sentence_with_upgrade() {
- let raw = "relay: You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams.";
+ let raw = "relay: You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams.";
let n = plan_limit_notice(raw, "https://app.cua.ai").unwrap();
assert_eq!(
n.text,
- "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
);
assert_eq!(n.upgrade, "Upgrade");
assert_eq!(
@@ -918,7 +969,10 @@ mod tests {
..free()
};
let v = view(&u).unwrap();
- assert_eq!(v.line, "Live sessions 1 \u{b7} Remote hours 3 this month");
+ assert_eq!(
+ v.line,
+ "Computers in use 1 \u{b7} Remote hours 3 this month"
+ );
assert_eq!(v.plan, "");
assert_eq!(
view(&RelayUsage {
@@ -988,7 +1042,7 @@ mod tests {
let bare: RelayUsage = serde_json::from_str(r#"{"metered":true}"#).unwrap();
assert_eq!(
view(&bare).unwrap().line,
- "Live sessions 0 \u{b7} Remote hours 0 this month"
+ "Computers in use 0 \u{b7} Remote hours 0 this month"
);
}
}
diff --git a/libs/cua/crates/cua-spaces-app-core/src/upsell.rs b/libs/cua/crates/cua-spaces-app-core/src/upsell.rs
index b5fb7854f9..ce9fc6fb4b 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/upsell.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/upsell.rs
@@ -111,7 +111,7 @@ pub fn prompt(
"machine" if kind == "free" => Some(UpsellPrompt {
surface: "machine".into(),
text: format!(
- "Two computers now. Free includes {} live sessions and {} remote hours a month. Pro makes it {PRO_SESSIONS} and {PRO_HOURS}, for $18 a month.",
+ "Two computers now. Free includes {} computers in use at once and {} remote hours a month. Pro makes it {PRO_SESSIONS} and {PRO_HOURS}, for $18 a month.",
usage.live_sessions_limit.unwrap_or(2),
hours(usage.hours_limit.unwrap_or(20.0)),
),
@@ -207,7 +207,7 @@ pub fn card(reason: &str, usage: &RelayUsage, account_app: &str) -> Option<Upsel
("hours", "free") => (
"You've used this month's remote hours".to_owned(),
format!(
- "Free includes {} remote hours a month. Your Spaces keep working. Pro gives you {PRO_HOURS} hours and {PRO_SESSIONS} live sessions.",
+ "Free includes {} remote hours a month. Your Spaces keep working. Pro gives you {PRO_HOURS} hours and {PRO_SESSIONS} computers in use at once.",
hours(usage.hours_limit.unwrap_or(20.0)),
),
"$18 a month".to_owned(),
@@ -221,17 +221,17 @@ pub fn card(reason: &str, usage: &RelayUsage, account_app: &str) -> Option<Upsel
),
("sessions", "free") => (
format!(
- "You're using {} of {} live sessions",
+ "You have {} of {} computers in use at once",
usage.live_sessions,
usage.live_sessions_limit.unwrap_or(2),
),
- format!("Close one to start another, or get Pro: {PRO_SESSIONS} live sessions at once and {PRO_HOURS} remote hours a month."),
+ format!("Close one to start another, or get Pro: {PRO_SESSIONS} computers in use at once and {PRO_HOURS} remote hours a month."),
"$18 a month".to_owned(),
to("Upgrade to Pro", BUY_PRO_PATH, &from),
),
("sessions", "pro") => (
format!(
- "You're using {} of {} live sessions",
+ "You have {} of {} computers in use at once",
usage.live_sessions,
usage.live_sessions_limit.unwrap_or(PRO_SESSIONS),
),
@@ -241,7 +241,7 @@ pub fn card(reason: &str, usage: &RelayUsage, account_app: &str) -> Option<Upsel
),
("hours" | "sessions", "teams") => (
"Your team has used its remote allowance".to_owned(),
- "Your Spaces keep working. Each seat adds to the team's hours and live sessions.".to_owned(),
+ "Your Spaces keep working. Each seat adds to the team's hours and computers in use at once.".to_owned(),
TEAMS_PRICE.to_owned(),
to("Add seats", "/billing", &from),
),
@@ -316,7 +316,7 @@ mod tests {
let p = prompt("machine", &usage("free"), APP, &state()).unwrap();
assert_eq!(
p.text,
- "Two computers now. Free includes 2 live sessions and 20 remote hours a month. Pro makes it 5 and 200, for $18 a month."
+ "Two computers now. Free includes 2 computers in use at once and 20 remote hours a month. Pro makes it 5 and 200, for $18 a month."
);
assert_eq!(p.cta.label, "Get Pro");
assert_eq!(p.cta.url, "https://app.cua.ai/buy/pro?from=app_machine");
@@ -392,7 +392,7 @@ mod tests {
assert_eq!(c.title, "You've used this month's remote hours");
assert_eq!(
c.body,
- "Free includes 20 remote hours a month. Your Spaces keep working. Pro gives you 200 hours and 5 live sessions."
+ "Free includes 20 remote hours a month. Your Spaces keep working. Pro gives you 200 hours and 5 computers in use at once."
);
assert_eq!(c.price, "$18 a month");
assert_eq!(c.cta.url, "https://app.cua.ai/buy/pro?from=app_card_hours");
@@ -400,7 +400,7 @@ mod tests {
u.live_sessions = 2;
let s = card("sessions", &u, APP).unwrap();
- assert_eq!(s.title, "You're using 2 of 2 live sessions");
+ assert_eq!(s.title, "You have 2 of 2 computers in use at once");
assert_eq!(s.cta.label, "Upgrade to Pro");
let t = card("invite", &u, APP).unwrap();
diff --git a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
index 20a6ee269a..d56198845e 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
@@ -11045,9 +11045,9 @@ pub struct AppRelayUsage {
pub plan: String,
/// The team whose allowance is pooled.
pub team: Option<AppRelayUsageTeam>,
- /// Live sessions now.
+ /// Computers in use now.
pub live_sessions: u32,
- /// Live sessions allowed at once (none: no limit).
+ /// Computers in use allowed at once (none: no limit).
pub live_sessions_limit: Option<u32>,
/// Relay hours used this month (the team's, when pooled).
pub hours_used: f64,
@@ -11067,7 +11067,7 @@ pub struct AppRelayUsage {
pub type AppRelayAllowanceNotice = core::relay_usage::RelayAllowanceNotice;
#[uniffi::remote(Record)]
pub struct AppRelayAllowanceNotice {
- /// On Free: "You're using 2 of 2 live sessions on the free plan. ..."
+ /// On Free: "You have 2 of 2 computers in use at once on the free plan. ..."
pub text: String,
/// [`UPGRADE`].
pub upgrade: String,
@@ -11122,7 +11122,7 @@ pub type AppRelayUsageView = core::relay_usage::RelayUsageView;
pub struct AppRelayUsageView {
/// [`ROW_LABEL`].
pub label: String,
- /// "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month", then the
+ /// "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month", then the
/// team pool when there is one.
pub line: String,
/// "Free plan" (empty when the relay names none).
diff --git a/libs/cua/crates/cua-spaces/src/elastic.rs b/libs/cua/crates/cua-spaces/src/elastic.rs
index e51f000bc5..4b9e8fc0bd 100644
--- a/libs/cua/crates/cua-spaces/src/elastic.rs
+++ b/libs/cua/crates/cua-spaces/src/elastic.rs
@@ -1471,7 +1471,7 @@ impl Spaces {
// places its first solve reserved without solving again.
let (target, label, _in_cloud) = {
let _g = self.inner.elastic.placing.lock().await;
- // What the plan leaves of live sessions: read under the turn,
+ // What the plan leaves of computers in use: read under the turn,
// so the creates of a burst count each other.
let room = self.cloud_session_room().await;
let (target, label) = if let Some(t) = self.take_reservation(&key, &excluded) {
@@ -2260,7 +2260,7 @@ pub struct SessionRoom {
/// Counted as used: the relay's live sessions, or this home's cloud
/// Spaces when more, plus cloud creates under way.
pub used: u32,
- /// The plan's live-session limit.
+ /// The plan's computers-in-use limit.
pub limit: u32,
/// `free`, `pro`, `team`, ...
pub plan: String,
@@ -2307,7 +2307,7 @@ impl SessionRoom {
_ => format!("Upgrade to Pro or Teams ({upgrade})"),
};
Error::LimitExceeded(format!(
- "Your plan allows {} live sessions ({} in use); {what} needs {asked}. A Space in \
+ "Your plan allows {} computers in use at once ({} in use now); {what} needs {asked}. A Space in \
your own cloud uses one, so no cloud machine was started. {next}, or lower --count.",
self.limit, self.used
))
@@ -2659,7 +2659,9 @@ mod tests {
.refusal(16)
.to_string();
assert!(
- m.contains("Your plan allows 2 live sessions (2 in use); this burst needs 16."),
+ m.contains(
+ "Your plan allows 2 computers in use at once (2 in use now); this burst needs 16."
+ ),
"{m}"
);
assert!(
diff --git a/libs/cua/crates/cua-telemetry/src/schema.rs b/libs/cua/crates/cua-telemetry/src/schema.rs
index 40614724e8..20c1474949 100644
--- a/libs/cua/crates/cua-telemetry/src/schema.rs
+++ b/libs/cua/crates/cua-telemetry/src/schema.rs
@@ -1098,7 +1098,7 @@ const PLAN_SURFACE: Prop = p(
const LIMIT_KIND: Prop = p(
"kind",
Kind::Enum(LIMIT_KINDS),
- "Which cap: live sessions, remote hours, team computers, team seats, other; none when the link was not opened from a limit.",
+ "Which cap: computers in use at once, remote hours, team computers, team seats, other; none when the link was not opened from a limit.",
);
const PLAN: Prop = p(
"plan",
@@ -1618,7 +1618,7 @@ pub const EVENTS: &[EventSpec] = &[
p(
"phase",
Kind::Enum(DURABLE_PHASES),
- "What happened: started, restarted, failed_over (a drive ran on another machine than the one before), exhausted (out of attempts), ended, space_recreated (a durable Space was placed again on another machine) or refused (a lease or epoch was refused).",
+ "What happened: started, restarted, failed_over (a drive ran on another machine than the one before), exhausted (out of attempts), ended, space_recreated (a durable Space was placed again on another computer) or refused (a lease or epoch was refused).",
),
AGENT_HARNESS,
p(
diff --git a/libs/cua/python/src/cua/__init__.py b/libs/cua/python/src/cua/__init__.py
index 7d7d3c37ff..d1124e2ab0 100644
--- a/libs/cua/python/src/cua/__init__.py
+++ b/libs/cua/python/src/cua/__init__.py
@@ -102,9 +102,9 @@ from ._plan_limit import parse_plan_limit as _parse_plan_limit # noqa: E402
class PlanLimitError(_CuaError.Http): # type: ignore[name-defined,misc]
- """The relay refused a new live session because the plan is at its cap.
+ """The relay refused a new computer in use because the plan is at its cap.
- ``str(error)`` is the plain sentence. Live sessions are never cut, and
+ ``str(error)`` is the plain sentence. Computers already in use are never cut, and
retrying gets the same answer: close one, or send the person to
``upgrade_url``.
"""
diff --git a/libs/cua/python/src/cua/_plan_limit.py b/libs/cua/python/src/cua/_plan_limit.py
index cd96a9420d..62d2a77b87 100644
--- a/libs/cua/python/src/cua/_plan_limit.py
+++ b/libs/cua/python/src/cua/_plan_limit.py
@@ -1,8 +1,8 @@
"""Reads the relay's plan-limit refusal back out of an error's text.
-The relay answers a new live session over the plan's cap with HTTP 429. The
-SDK turns it into one plain sentence, such as "You're using 5 of 5 live
-sessions on Pro. Close one or upgrade to Teams.", and appends
+The relay answers a new computer in use over the plan's cap with HTTP 429. The
+SDK turns it into one plain sentence, such as "You have 5 of 5 computers in
+use at once on Pro. Close one or upgrade to Teams.", and appends
"Upgrade: <url>". This module holds no native code, so it loads anywhere.
"""
@@ -11,7 +11,10 @@ from __future__ import annotations
import re
from typing import NamedTuple, Optional
+# The sessions sentence has two wordings: the current one, and the old "live
+# sessions" one that older relays, daemons and SDKs still send. Both are read.
_FORMS = (
+ ("You have ", "sessions", " computers in use at once on "),
("You're using ", "sessions", " live sessions on "),
("You've used ", "hours", " remote hours this month on "),
)
diff --git a/libs/cua/python/tests/test_plan_limit.py b/libs/cua/python/tests/test_plan_limit.py
index 05567a98f5..71ce2a9b91 100644
--- a/libs/cua/python/tests/test_plan_limit.py
+++ b/libs/cua/python/tests/test_plan_limit.py
@@ -2,7 +2,8 @@
import cua
-SENTENCE = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+SENTENCE = "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
+OLD_SENTENCE = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
def test_a_sessions_refusal_carries_its_numbers_and_the_upgrade_link():
@@ -17,6 +18,14 @@ def test_a_sessions_refusal_carries_its_numbers_and_the_upgrade_link():
assert refusal.status == 429
+def test_the_old_live_sessions_sentence_still_reads():
+ error = cua.CuaError.Http(f"{OLD_SENTENCE} Upgrade: https://app.cua.ai/buy/teams?from=plan_limit")
+ refusal = error.plan_limit
+ assert isinstance(refusal, cua.PlanLimitError)
+ assert str(refusal) == OLD_SENTENCE
+ assert (refusal.kind, refusal.plan, refusal.used, refusal.limit) == ("sessions", "pro", 5, 5)
+
+
def test_remote_hours_on_the_free_plan_without_a_link():
text = "You've used 20.5 of 20 remote hours this month on the free plan. Upgrade to Pro for more."
refusal = cua.PlanLimitError.from_error(cua.CuaError.Http("relay: " + text))
diff --git a/libs/cua/typescript/src/spaces/errors.ts b/libs/cua/typescript/src/spaces/errors.ts
index 47a27a0974..461a4e5099 100644
--- a/libs/cua/typescript/src/spaces/errors.ts
+++ b/libs/cua/typescript/src/spaces/errors.ts
@@ -101,13 +101,13 @@ export class SpacesError extends Error {
export type PlanLimitKind = 'sessions' | 'hours';
/**
- * The relay refused a new live session because the account's plan is at its
+ * The relay refused a new computer in use because the account's plan is at its
* cap (HTTP 429, `x-cua-relay-error: plan_limit_sessions|plan_limit_hours`).
- * Live sessions are never cut and retrying gets the same answer: close one,
+ * Computers already in use are never cut and retrying gets the same answer: close one,
* or send the person to {@link PlanLimitError.upgradeUrl}.
*
- * `message` is the plain sentence, such as "You're using 5 of 5 live sessions
- * on Pro. Close one or upgrade to Teams."
+ * `message` is the plain sentence, such as "You have 5 of 5 computers in use at
+ * once on Pro. Close one or upgrade to Teams."
*/
export class PlanLimitError extends SpacesError {
readonly kind: PlanLimitKind;
@@ -134,7 +134,10 @@ export class PlanLimitError extends SpacesError {
}
}
+// The sessions sentence has two wordings: the current one, and the old "live
+// sessions" one that older relays, daemons and SDKs still send. Both are read.
const PLAN_LIMIT_FORMS: ReadonlyArray<readonly [string, PlanLimitKind, string]> = [
+ ["You have ", 'sessions', ' computers in use at once on '],
["You're using ", 'sessions', ' live sessions on '],
["You've used ", 'hours', ' remote hours this month on '],
];
diff --git a/libs/cua/typescript/test/spaces-unit.test.mjs b/libs/cua/typescript/test/spaces-unit.test.mjs
index 3decda089e..688bc776db 100644
--- a/libs/cua/typescript/test/spaces-unit.test.mjs
+++ b/libs/cua/typescript/test/spaces-unit.test.mjs
@@ -574,7 +574,7 @@ test("the control file lives under CUA_HOME, like the Rust core", async () => {
// -- plan limit --------------------------------------------------------------
test("the relay's plan-limit refusal is a PlanLimitError with its numbers and the upgrade link", () => {
- const sentence = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ const sentence = "You have 5 of 5 computers in use at once on Pro. Close one or upgrade to Teams."
const native = Object.assign(new Error(`${sentence} Upgrade: https://app.cua.ai/buy/teams?from=plan_limit`), { tag: "Http" })
const error = toSpacesError(native)
assert.ok(error instanceof PlanLimitError)
@@ -589,6 +589,19 @@ test("the relay's plan-limit refusal is a PlanLimitError with its numbers and th
assert.equal(error.cause, native)
})
+test("the old live-sessions sentence from an older relay still reads", () => {
+ const old = "You're using 5 of 5 live sessions on Pro. Close one or upgrade to Teams."
+ const p = parsePlanLimit(`relay: ${old} Upgrade: https://app.cua.ai/buy/teams?from=plan_limit`)
+ assert.deepEqual(p, {
+ kind: "sessions",
+ plan: "pro",
+ used: 5,
+ limit: 5,
+ upgradeUrl: "https://app.cua.ai/buy/teams?from=plan_limit",
+ message: old,
+ })
+})
+
test("remote hours on the free plan, with no link", () => {
const p = parsePlanLimit("relay: You've used 20.5 of 20 remote hours this month on the free plan. Upgrade to Pro for more.")
assert.deepEqual(p, {
diff --git a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
index 3e49a7f051..9325bcebcd 100644
--- a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
+++ b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
@@ -32453,7 +32453,7 @@ public func FfiConverterTypeAppRefreshReport_lower(_ value: AppRefreshReport) ->
public struct AppRelayAllowanceNotice: Equatable, Hashable {
/**
- * On Free: "You're using 2 of 2 live sessions on the free plan. ..."
+ * On Free: "You have 2 of 2 computers in use at once on the free plan. ..."
*/
public var text: String
/**
@@ -32494,7 +32494,7 @@ public struct AppRelayAllowanceNotice: Equatable, Hashable {
// declare one manually.
public init(
/**
- * On Free: "You're using 2 of 2 live sessions on the free plan. ..."
+ * On Free: "You have 2 of 2 computers in use at once on the free plan. ..."
*/text: String,
/**
* [`UPGRADE`].
@@ -32605,11 +32605,11 @@ public struct AppRelayUsage: Equatable, Hashable {
*/
public var team: AppRelayUsageTeam?
/**
- * Live sessions now.
+ * Computers in use now.
*/
public var liveSessions: UInt32
/**
- * Live sessions allowed at once (none: no limit).
+ * Computers in use allowed at once (none: no limit).
*/
public var liveSessionsLimit: UInt32?
/**
@@ -32653,10 +32653,10 @@ public struct AppRelayUsage: Equatable, Hashable {
* The team whose allowance is pooled.
*/team: AppRelayUsageTeam?,
/**
- * Live sessions now.
+ * Computers in use now.
*/liveSessions: UInt32,
/**
- * Live sessions allowed at once (none: no limit).
+ * Computers in use allowed at once (none: no limit).
*/liveSessionsLimit: UInt32?,
/**
* Relay hours used this month (the team's, when pooled).
@@ -32825,7 +32825,7 @@ public struct AppRelayUsageView: Equatable, Hashable {
*/
public var label: String
/**
- * "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month", then the
+ * "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month", then the
* team pool when there is one.
*/
public var line: String
@@ -32849,7 +32849,7 @@ public struct AppRelayUsageView: Equatable, Hashable {
* [`ROW_LABEL`].
*/label: String,
/**
- * "Live sessions 1 of 2 · Relay hours 6.5 of 20 this month", then the
+ * "Computers in use 1 of 2 · Relay hours 6.5 of 20 this month", then the
* team pool when there is one.
*/line: String,
/**
diff --git a/scripts/docs-generators/cli-specs/cua.json b/scripts/docs-generators/cli-specs/cua.json
index 0205f41b89..fc6ada887c 100644
--- a/scripts/docs-generators/cli-specs/cua.json
+++ b/scripts/docs-generators/cli-specs/cua.json
@@ -20778,7 +20778,7 @@
"usage": "cua ci [OPTIONS] <COMMAND>"
},
{
- "abstract": "Your remote use this month: live sessions, remote hours, and your plan. Remote hours are time spent using your computers from somewhere else; using a computer from itself is free",
+ "abstract": "Your remote use this month: computers in use at once, remote hours, and your plan. Remote hours are time spent using your computers from somewhere else; using a computer from itself is free",
"after_help": "Examples:\n cua usage\n cua usage --json",
"aliases": [],
"arguments": [],