fix(ui): the backend picker showed two options meaning the same thing

`default` is the generic `rootfs.ext4` and `claude` is the named one, and
`microvm_credential_for` gives them the identical contract — so the list came
back with both under the same label, and whichever a user picked they got the
same thing. Collapsed to the named one where it exists; the generic keeps a
label of its own for a fleet that only has that.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
Omar Sobh
2026-08-09 15:52:30 -07:00
co-authored by Claude Opus 5
parent 529497febb
commit 16cfc29074
+10 -2
View File
@@ -479,12 +479,19 @@ pub async fn backends(
Authed(user): Authed,
) -> Result<Json<Value>, ApiError> {
let ws = user.workspace_id.as_uuid().to_owned();
let list = crate::mission_roster::available_backends(&state.pool, ws)
let mut list = crate::mission_roster::available_backends(&state.pool, ws)
.await
.map_err(|e| {
eprintln!("fleet backends: {e}");
ApiError::Internal
})?;
// `default` is the generic `rootfs.ext4` and `claude` is the named one, and
// `microvm_credential_for` gives them the SAME contract — so a picker
// offering both shows two options with one meaning, and whichever the user
// picks they get the same thing. Collapse to the named one where it exists.
if list.iter().any(|b| b == "claude") {
list.retain(|b| b != "default");
}
Ok(Json(json!({
"backends": list.iter().map(|b| json!({
"id": b,
@@ -498,7 +505,8 @@ pub async fn backends(
/// to know which company each one bills.
fn backend_label(id: &str) -> String {
match id {
"claude" | "default" => "Claude (Anthropic subscription)".into(),
"claude" => "Claude (Anthropic subscription)".into(),
"default" => "Claude (generic image)".into(),
"canary-claude" => "Claude — candidate CLI (canary)".into(),
"glm" => "GLM 4.7 (z.ai)".into(),
"kimi" => "Kimi (Moonshot)".into(),