fix: use destroy_server for sprite delete to support org users (#1538)

The sprite case in buildDeleteScript called `sprite destroy` directly,
bypassing ensure_sprite_authenticated and destroy_server. This meant
SPRITE_ORG was never detected, so org users got "sprite not found"
errors and orphaned sprites continued incurring charges.

Align with every other cloud (hetzner, digitalocean, fly, gcp, aws,
daytona) by calling ensure_sprite_authenticated then destroy_server,
which applies _sprite_org_flags automatically.

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-20 16:34:58 -08:00 committed by GitHub
parent c7e1c73c8a
commit 38b972f5ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1834,7 +1834,7 @@ function buildDeleteScript(cloud: string, connection: VMConnection): string {
case "daytona":
return `${sourceLib}\nensure_daytona_token\ndestroy_server "${id}"`;
case "sprite":
return `${sourceLib}\nensure_sprite_installed\nsprite destroy "${id}"`;
return `${sourceLib}\nensure_sprite_installed\nensure_sprite_authenticated\ndestroy_server "${id}"`;
default:
return "";
}