fix: GCP billing retry fails because temp startup script is already deleted (#2361)

The startup script temp file was cleaned up immediately after the first
gcloud call, but the billing retry path re-used the same args array
referencing that file. This meant billing retries always failed with a
file-not-found error. Move cleanup to a try/finally block that runs
after all retry paths. Also add randomness and mode 0o600 to the temp
file path.

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-03-08 20:07:57 -07:00 committed by GitHub
parent e02040e33e
commit 3d7ad51f6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 63 additions and 57 deletions

View file

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