refactor: Remove dead code and stale references (#1950)

Remove the `runWithRetry` function exported from 4 cloud modules (aws, hetzner, gcp, digitalocean)
that were defined but never called anywhere in the codebase. Only `fly.ts` uses its own
`runWithRetry` internally, so that definition is preserved.

Also bump CLI version to 0.10.22 per version policy.

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-26 05:36:08 -08:00 committed by GitHub
parent 0a8d9b7440
commit 95d4ca93bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1 additions and 92 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.10.21",
"version": "0.10.22",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -1132,28 +1132,6 @@ export async function interactiveSession(cmd: string): Promise<number> {
return exitCode;
}
// ─── Retry + Wait Helpers ───────────────────────────────────────────────────
export async function runWithRetry(
maxAttempts: number,
sleepSec: number,
timeoutSecs: number,
cmd: string,
): Promise<void> {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
await runServer(cmd, timeoutSecs);
return;
} catch {
logWarn(`Command failed (attempt ${attempt}/${maxAttempts}): ${cmd.slice(0, 80)}...`);
if (attempt < maxAttempts) {
await sleep(sleepSec * 1000);
}
}
}
throw new Error(`runWithRetry exhausted: ${cmd.slice(0, 80)}...`);
}
// ─── Server Name ────────────────────────────────────────────────────────────
export async function getServerName(): Promise<string> {

View file

@ -1095,29 +1095,6 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
return exitCode;
}
// ─── Retry Helper ────────────────────────────────────────────────────────────
export async function runWithRetry(
maxAttempts: number,
sleepSec: number,
timeoutSecs: number,
cmd: string,
): Promise<void> {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
await runServer(cmd, timeoutSecs);
return;
} catch {
logWarn(`Command failed (attempt ${attempt}/${maxAttempts}): ${cmd}`);
if (attempt < maxAttempts) {
await sleep(sleepSec * 1000);
}
}
}
logError(`Command failed after ${maxAttempts} attempts: ${cmd}`);
throw new Error(`runWithRetry exhausted: ${cmd}`);
}
// ─── Server Name ─────────────────────────────────────────────────────────────
export async function getServerName(): Promise<string> {

View file

@ -948,29 +948,6 @@ export async function interactiveSession(cmd: string): Promise<number> {
return exitCode;
}
// ─── Retry Helper ───────────────────────────────────────────────────────────
export async function runWithRetry(
maxAttempts: number,
sleepSec: number,
timeoutSecs: number,
cmd: string,
): Promise<void> {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
await runServer(cmd, timeoutSecs);
return;
} catch {
logWarn(`Command failed (attempt ${attempt}/${maxAttempts}): ${cmd}`);
if (attempt < maxAttempts) {
await sleep(sleepSec * 1000);
}
}
}
logError(`Command failed after ${maxAttempts} attempts: ${cmd}`);
throw new Error(`runWithRetry exhausted: ${cmd}`);
}
// ─── Lifecycle ──────────────────────────────────────────────────────────────
export async function destroyInstance(name?: string): Promise<void> {

View file

@ -662,29 +662,6 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
return exitCode;
}
// ─── Retry Helper ────────────────────────────────────────────────────────────
export async function runWithRetry(
maxAttempts: number,
sleepSec: number,
timeoutSecs: number,
cmd: string,
): Promise<void> {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
await runServer(cmd, timeoutSecs);
return;
} catch {
logWarn(`Command failed (attempt ${attempt}/${maxAttempts}): ${cmd}`);
if (attempt < maxAttempts) {
await sleep(sleepSec * 1000);
}
}
}
logError(`Command failed after ${maxAttempts} attempts: ${cmd}`);
throw new Error(`runWithRetry exhausted: ${cmd}`);
}
// ─── Server Name ─────────────────────────────────────────────────────────────
export async function getServerName(): Promise<string> {