From ca7fa1fc629f9188810fb03453bf8af15ccae929 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Tue, 17 Nov 2026 09:31:04 -0800 Subject: [PATCH 1/5] feat(sandbox,ca): drop experimental warnings Sandboxes and cloud agents are leaving experimental, so `railway sandbox`, `railway code` and the `railway ca` launcher no longer print the "experimental and APIs may change" banner. Co-Authored-By: Claude Opus 5.5 --- src/commands/cloud_agent/mod.rs | 5 ----- src/commands/code.rs | 6 ------ src/commands/sandbox.rs | 7 ------- 3 files changed, 18 deletions(-) diff --git a/src/commands/cloud_agent/mod.rs b/src/commands/cloud_agent/mod.rs index 38093f93e..60141d59d 100644 --- a/src/commands/cloud_agent/mod.rs +++ b/src/commands/cloud_agent/mod.rs @@ -278,11 +278,6 @@ async fn browse_into(initial_screen: Option) -> Result<()> { pub async fn launch_in_pane(args: LaunchArgs) -> Result<()> { let mut configs = Configs::new()?; let client = GQLClient::new_authorized(&configs)?; - eprintln!( - "{}", - "Warning: Railway cloud agents are experimental and APIs may change or break during testing." - .yellow() - ); // The flag check races target resolution instead of preceding it: an // un-flagged user is still stopped the moment the check answers — before diff --git a/src/commands/code.rs b/src/commands/code.rs index 74723f859..33f1b1f2d 100644 --- a/src/commands/code.rs +++ b/src/commands/code.rs @@ -3053,12 +3053,6 @@ pub async fn launch(args: LaunchArgs) -> Result<()> { return destroy_agent(&mut configs, &client, &environment_id).await; } - eprintln!( - "{}", - "Warning: Railway cloud agents are experimental and APIs may change or break during testing." - .yellow() - ); - let progress = CliProgress::default(); // The flag check races prepare instead of preceding it: an un-flagged user // is still stopped the moment the check answers — before any mint or diff --git a/src/commands/sandbox.rs b/src/commands/sandbox.rs index ee6c3cd2c..05e16f117 100644 --- a/src/commands/sandbox.rs +++ b/src/commands/sandbox.rs @@ -474,13 +474,6 @@ impl DestroyArgs { } pub async fn command(args: Args) -> Result<()> { - use colored::Colorize; - eprintln!( - "{}", - "Warning: Railway sandboxes are experimental and APIs may change or break during testing." - .yellow() - ); - let mut configs = Configs::new()?; let client = GQLClient::new_authorized(&configs)?; let project = args.project; From 0d99a72d91c9be2942cf7bc12556feb784bdbf56 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Tue, 17 Nov 2026 09:33:07 -0800 Subject: [PATCH 2/5] feat(ca): cloud agents are GA, drop the Priority Boarding preflight Cloud agents no longer sit behind the CLOUD_AGENTS flag, so `railway ca`, `railway code`, `ca desktop` and the Codex/OpenCode clients stop asking for the account's feature flags before launching. This removes the access module, the CloudAgentAccess query, the flag_missing telemetry event and the "Requires Cloud Agents access" lines in help and docs. Older CLIs that still run the preflight keep working because the backend reports CLOUD_AGENTS for every user. Co-Authored-By: Claude Opus 5.5 --- docs/cloud-agents.md | 4 +- src/commands/cloud_agent/access.rs | 85 ------------------- src/commands/cloud_agent/desktop.rs | 9 -- src/commands/cloud_agent/mod.rs | 48 ++--------- src/commands/cloud_agent/telemetry.rs | 14 --- src/commands/code.rs | 25 +----- src/commands/code/client.rs | 6 +- src/commands/code/railway_client.rs | 2 - src/gql/queries/mod.rs | 11 --- .../queries/strings/CloudAgentAccess.graphql | 5 -- 10 files changed, 12 insertions(+), 197 deletions(-) delete mode 100644 src/commands/cloud_agent/access.rs delete mode 100644 src/gql/queries/strings/CloudAgentAccess.graphql diff --git a/docs/cloud-agents.md b/docs/cloud-agents.md index 0a1a4de97..a79af2982 100644 --- a/docs/cloud-agents.md +++ b/docs/cloud-agents.md @@ -1,8 +1,8 @@ # Cloud-agent command guide Use `railway ca` to browse and manage VMs, `railway code` to launch a coding -session, and `railway ca desktop` to configure a desktop app. Cloud Agents access -is required. Run any command with `--help` for its options. +session, and `railway ca desktop` to configure a desktop app. Run any command +with `--help` for its options. ## Launch and reconnect diff --git a/src/commands/cloud_agent/access.rs b/src/commands/cloud_agent/access.rs deleted file mode 100644 index 0a87b60d0..000000000 --- a/src/commands/cloud_agent/access.rs +++ /dev/null @@ -1,85 +0,0 @@ -//! The `CLOUD_AGENTS` preflight. -//! -//! Cloud agents are behind a Priority Boarding flag. The CLI and the dashboard -//! enforce it; the API does not check it on create. This asks before a launch -//! resolves a credential, a target and an agent, and answers with what is -//! missing (the flag) and where to turn it on. -//! -//! Best-effort. Only a query that succeeds and comes back without the flag -//! stops a launch; anything else (a project token, which cannot read `me`, or a -//! transient failure) proceeds and lets the API's own access checks decide. - -use anyhow::{Result, bail}; -use colored::Colorize; - -use crate::client::post_graphql; -use crate::config::Configs; -use crate::gql::queries; - -/// Stop before provisioning when the account doesn't have `CLOUD_AGENTS`. -pub async fn ensure_enabled(client: &reqwest::Client, configs: &Configs) -> Result<()> { - let flags = match post_graphql::( - client, - configs.get_backboard(), - queries::cloud_agent_access::Variables {}, - ) - .await - { - Ok(data) => data.me.feature_flags, - Err(_) => return Ok(()), - }; - if has_cloud_agents(&flags) { - return Ok(()); - } - super::telemetry::track_access_blocked().await; - bail!(not_enabled_message(configs.get_host())); -} - -fn has_cloud_agents(flags: &[queries::cloud_agent_access::ActiveFeatureFlag]) -> bool { - use queries::cloud_agent_access::ActiveFeatureFlag; - flags - .iter() - .any(|flag| matches!(flag, ActiveFeatureFlag::CLOUD_AGENTS)) -} - -/// What to say when the flag is off. Names the flag, says where it -/// lives, and gives the URL — a flag nobody can find is the same as no flag. -fn not_enabled_message(host: &str) -> String { - format!( - "Cloud agents are not enabled for your account yet.\n\n {} Turn on {} in Priority Boarding:\n {}\n\nThen run this command again.", - "→".cyan(), - "Cloud Agents".bold(), - format!("https://{host}/account/feature-flags").underline() - ) -} - -#[cfg(test)] -mod tests { - use super::*; - use queries::cloud_agent_access::ActiveFeatureFlag; - - #[test] - fn the_flag_is_matched_exactly() { - assert!(has_cloud_agents(&[ - ActiveFeatureFlag::PRIORITY_BOARDING, - ActiveFeatureFlag::CLOUD_AGENTS, - ])); - // Priority Boarding on its own is the door, not the room behind it. - assert!(!has_cloud_agents(&[ActiveFeatureFlag::PRIORITY_BOARDING])); - assert!(!has_cloud_agents(&[])); - // An unknown flag from a newer API must not read as a match. - assert!(!has_cloud_agents(&[ActiveFeatureFlag::Other( - "CLOUD_AGENTS_V2".into() - )])); - } - - #[test] - fn the_message_points_at_the_flag_and_the_page() { - let message = not_enabled_message("railway.com"); - assert!(message.contains("Priority Boarding"), "{message}"); - assert!( - message.contains("https://railway.com/account/feature-flags"), - "{message}" - ); - } -} diff --git a/src/commands/cloud_agent/desktop.rs b/src/commands/cloud_agent/desktop.rs index 63dde6788..0631ca7c0 100644 --- a/src/commands/cloud_agent/desktop.rs +++ b/src/commands/cloud_agent/desktop.rs @@ -195,15 +195,6 @@ pub async fn command(args: Args) -> Result<()> { .any(|app| app.is_opencode()) .then(opencode::generate_password); - // Same preflight as a launch, and for the same reason: without the flag the - // create at the end of provisioning is refused, after a credential has - // already been spent on it. - { - let configs = Configs::new()?; - let client = GQLClient::new_authorized(&configs)?; - super::access::ensure_enabled(&client, &configs).await?; - } - // Provision once per app, on one agent. The first pass resolves (or creates) // it; later passes are pinned to that id, so `--claude --codex` seeds two // credentials on one machine rather than spending two VMs. diff --git a/src/commands/cloud_agent/mod.rs b/src/commands/cloud_agent/mod.rs index 60141d59d..adc0a9b25 100644 --- a/src/commands/cloud_agent/mod.rs +++ b/src/commands/cloud_agent/mod.rs @@ -8,7 +8,6 @@ //! preferences file, so the choice between them is only whether you want to //! browse first. `railway ca start` is the one that skips the TUI entirely. -pub mod access; pub mod bootstrap; pub(crate) mod client_sessions; pub(crate) mod codex; @@ -65,7 +64,6 @@ Agent flags here launch on the VM. Use --new to create a fresh VM. Flags override preferences; the linked project overrides the saved project. An idle VM sleeps after 5 minutes and wakes when you connect. Sleeping ends its processes and keeps the disk. -Requires Cloud Agents access. Guide: https://github.com/railwayapp/cli/blob/master/docs/cloud-agents.md"# )] pub struct Args { @@ -101,7 +99,6 @@ Launches on the VM directly, without the management interface. Uses your configured agent and project defaults; --new creates a fresh VM. Available local credentials are copied to the VM; Claude can mint a setup token. An idle VM sleeps after 5 minutes; railway ca sleep sleeps it now. -Requires Cloud Agents access. Guide: https://github.com/railwayapp/cli/blob/master/docs/cloud-agents.md"#)] Start(LaunchArgs), @@ -279,31 +276,7 @@ pub async fn launch_in_pane(args: LaunchArgs) -> Result<()> { let mut configs = Configs::new()?; let client = GQLClient::new_authorized(&configs)?; - // The flag check races target resolution instead of preceding it: an - // un-flagged user is still stopped the moment the check answers — before - // any prompt is worth their time — while everyone else no longer pays a - // serialized round-trip. `browse_with` checks again beside its tree load, - // which is what actually gates the create. Its own `Configs` because - // resolve_launch holds the mutable borrow. - let resolved = { - let ensure_fut = async { - let flag_configs = Configs::new()?; - access::ensure_enabled(&client, &flag_configs).await - }; - let resolve_fut = crate::commands::code::resolve_launch(&args, &mut configs, &client); - tokio::pin!(ensure_fut); - tokio::pin!(resolve_fut); - tokio::select! { - enabled = &mut ensure_fut => { - enabled?; - resolve_fut.await? - } - resolved = &mut resolve_fut => { - ensure_fut.await?; - resolved? - } - } - }; + let resolved = crate::commands::code::resolve_launch(&args, &mut configs, &client).await?; let mut args = args; args.local_name_project = resolved.local_name_project; let launch = tui::LaunchRequest { @@ -360,9 +333,9 @@ async fn browse_with_inner(opts: BrowseOpts) -> Result<()> { let client = GQLClient::new_authorized(&configs)?; let backboard = configs.get_backboard(); - // All under one spinner: the flag check and the key check are small - // queries against the same client, and running them beside the tree load - // rather than before it keeps them off the clock. + // All under one spinner: the key check is a small query against the same + // client, and running it beside the tree load rather than before it keeps + // it off the clock. // // An arriving launch starts its pipeline in here too, the moment the key // check answers Ready — the tree is for drawing the manage screen, not @@ -377,12 +350,7 @@ async fn browse_with_inner(opts: BrowseOpts) -> Result<()> { let (key_ready_tx, key_ready_rx) = tokio::sync::oneshot::channel::(); let spinner = create_spinner("Loading your projects".to_string()); let (loaded, ssh_key, inflight) = tokio::join!( - async { - tokio::try_join!( - access::ensure_enabled(&client, &configs), - tui::load_tree(&client, &configs), - ) - }, + async { tui::load_tree(&client, &configs).await }, async { let state = check_ssh_key(&client, &configs).await; let _ = key_ready_tx.send(matches!(state, tui::app::SshKeyState::Ready)); @@ -397,11 +365,11 @@ async fn browse_with_inner(opts: BrowseOpts) -> Result<()> { }, ); spinner.finish_and_clear(); - let (_, tree) = match loaded { - Ok(pair) => pair, + let tree = match loaded { + Ok(tree) => tree, Err(e) => { // The early pipeline may already have created an agent; exiting on - // the tree/flag error without saying so would orphan a billing VM + // the tree error without saying so would orphan a billing VM // with no user-visible record. if let Some(inflight) = inflight && let Some(note) = inflight diff --git a/src/commands/cloud_agent/telemetry.rs b/src/commands/cloud_agent/telemetry.rs index c14b7e3da..a9062de3a 100644 --- a/src/commands/cloud_agent/telemetry.rs +++ b/src/commands/cloud_agent/telemetry.rs @@ -192,20 +192,6 @@ pub async fn track_login_forwarded(error: Option<&str>) { .await; } -/// Someone ran a cloud agent command without the `CLOUD_AGENTS` flag and was -/// stopped by the preflight. Counts the demand sitting behind the flag, which -/// the API-side rejection never surfaced as its own event. -pub async fn track_access_blocked() { - telemetry::send(event( - "cloud_agent", - "flag_missing".to_string(), - 0, - false, - None, - )) - .await; -} - /// `railway ca setup` or the TUI wizard saved preferences. `entry` is /// `"cli"` or `"wizard"` — the two call sites share this mapping so both /// land in the same shape. diff --git a/src/commands/code.rs b/src/commands/code.rs index 33f1b1f2d..f220943f5 100644 --- a/src/commands/code.rs +++ b/src/commands/code.rs @@ -141,7 +141,6 @@ Claude can mint a setup token. Codex saves Desktop setup; OpenCode configures detected Desktop installs. An idle VM sleeps after 5 minutes; railway ca sleep sleeps it now. -Requires Cloud Agents access. Guide: https://github.com/railwayapp/cli/blob/master/docs/cloud-agents.md"# )] pub struct Args { @@ -3054,29 +3053,7 @@ pub async fn launch(args: LaunchArgs) -> Result<()> { } let progress = CliProgress::default(); - // The flag check races prepare instead of preceding it: an un-flagged user - // is still stopped the moment the check answers — before any mint or - // create completes — while everyone else no longer pays a serialized - // round-trip for a question whose answer is almost always yes. If prepare - // somehow finishes first, the gate is still enforced before anything runs. - let ensure_fut = async { - let configs = Configs::new()?; - let client = GQLClient::new_authorized(&configs)?; - crate::commands::cloud_agent::access::ensure_enabled(&client, &configs).await - }; - let prepare_fut = prepare(&args, &progress, SessionStyle::FullTerminal); - tokio::pin!(ensure_fut); - tokio::pin!(prepare_fut); - let prepared = tokio::select! { - enabled = &mut ensure_fut => { - enabled?; - prepare_fut.await? - } - prepared = &mut prepare_fut => { - ensure_fut.await?; - prepared? - } - }; + let prepared = prepare(&args, &progress, SessionStyle::FullTerminal).await?; progress.finish(); let harness = crate::commands::cloud_agent::harness_label(prepared.harness); diff --git a/src/commands/code/client.rs b/src/commands/code/client.rs index 3df09f7cf..c9d020cf7 100644 --- a/src/commands/code/client.rs +++ b/src/commands/code/client.rs @@ -10,7 +10,7 @@ use super::{CliProgress, ConnectInfo, LaunchArgs, Progress, RelayAccess, Session use crate::client::GQLClient; use crate::commands::cloud_agent::client_sessions::Connection; use crate::commands::cloud_agent::{ - access, codex, desktop, + codex, desktop, opencode::{self, local}, }; use crate::config::Configs; @@ -225,9 +225,6 @@ pub(super) async fn start(mut args: LaunchArgs, harness: Harness, mode: LaunchMo desktop::preflight_codex_desktop()?; } let json = args.connection_json; - let configs = Configs::new()?; - let client = GQLClient::new_authorized(&configs)?; - access::ensure_enabled(&client, &configs).await?; pin_agent(&mut args).await?; let directory = args.remote_dir.take().unwrap_or_else(|| "/app".into()); args.app_mode = true; @@ -533,7 +530,6 @@ pub(super) async fn connect( let json = args.connection_json; let mut configs = Configs::new()?; let client = GQLClient::new_authorized(&configs)?; - access::ensure_enabled(&client, &configs).await?; let backboard = configs.get_backboard(); let scoped = if args.project.is_some() || args.environment.is_some() { Some( diff --git a/src/commands/code/railway_client.rs b/src/commands/code/railway_client.rs index fca9edd35..9685917af 100644 --- a/src/commands/code/railway_client.rs +++ b/src/commands/code/railway_client.rs @@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize}; use super::{ClientAction, LaunchArgs, Progress, SessionStyle, saved_config::SavedConfig}; use crate::{ client::{GQLClient, post_graphql}, - commands::cloud_agent::access, config::Configs, controllers::cloud_agent as ca, gql::{mutations, queries}, @@ -43,7 +42,6 @@ pub(super) async fn command(mut args: LaunchArgs, action: ClientAction) -> Resul validate_args(&args)?; let configs = Configs::new()?; let gql = GQLClient::new_authorized(&configs)?; - access::ensure_enabled(&gql, &configs).await?; let progress = ConnectionProgress::new(json); let result: Result<_> = async { // Check before provisioning, including JSON and reconnect invocations. diff --git a/src/gql/queries/mod.rs b/src/gql/queries/mod.rs index 326bc0da3..219dbe204 100644 --- a/src/gql/queries/mod.rs +++ b/src/gql/queries/mod.rs @@ -48,17 +48,6 @@ impl std::fmt::Display pub struct UserMeta; pub type RailwayUser = user_meta::UserMetaMe; -/// The account's active feature flags, for the `railway ca` preflight. Its own -/// query rather than a field on `UserMeta`: that one is on the login path and -/// has no use for them. -#[derive(GraphQLQuery)] -#[graphql( - schema_path = "src/gql/schema.json", - query_path = "src/gql/queries/strings/CloudAgentAccess.graphql", - response_derives = "Debug, Serialize, Clone, PartialEq" -)] -pub struct CloudAgentAccess; - #[derive(GraphQLQuery)] #[graphql( schema_path = "src/gql/schema.json", diff --git a/src/gql/queries/strings/CloudAgentAccess.graphql b/src/gql/queries/strings/CloudAgentAccess.graphql deleted file mode 100644 index bc772bd6e..000000000 --- a/src/gql/queries/strings/CloudAgentAccess.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query CloudAgentAccess { - me { - featureFlags - } -} From 8b5197e0160ae886dc6b9558bdd852fc8acb4d12 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Tue, 17 Nov 2026 09:41:50 -0800 Subject: [PATCH 3/5] feat(sandbox,ca): one create output for sandboxes and cloud agents A cloud agent is a sandbox with agent tooling on top, so `railway sandbox create` and `railway ca create` now print the same block from one renderer (commands/output/machine.rs): a "Created sandbox|cloud agent