fix: don't mark server deleted when cloud API delete fails (#1935)

When spawn delete encounters a cloud API error (network timeout, 500,
auth failure), the server is still running. Marking the record as
deleted in this case hides it from spawn delete/spawn list, preventing
retry and causing untracked billing.

Only mark as deleted on: (1) successful deletion, (2) server already
gone/404. Error paths keep the record active for retry.

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-25 15:46:34 -08:00 committed by GitHub
parent 556f32ecfc
commit 2321352a6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2282,7 +2282,6 @@ async function execDeleteServer(record: SpawnRecord): Promise<boolean> {
}
p.log.error(`Delete failed: ${errMsg}`);
p.log.info("The server may still be running. Check your cloud provider dashboard.");
markRecordDeleted(record);
return false;
}
};