Skip to content

fix: send workersStandby for scale-to-zero + read runpodctl config - #375

Open
Swigler wants to merge 2 commits into
runpod:mainfrom
Swigler:fix/scale-to-zero-and-config-compat
Open

fix: send workersStandby for scale-to-zero + read runpodctl config#375
Swigler wants to merge 2 commits into
runpod:mainfrom
Swigler:fix/scale-to-zero-and-config-compat

Conversation

@Swigler

@Swigler Swigler commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Two fixes in one branch (separate commits):

1. Scale-to-zero broken by missing workersStandby (Fixes #364)

When deploying with workers=(0, N), Flash sends workersMin: 0 but never sends workersStandby. RunPod's API defaults workersStandby to 1, so a warm worker stays up 24/7 even though the user asked for scale-to-zero.

Fix: Add workersStandby field to ServerlessResource and set it to workersMin in the deploy payload. workers=(0, 4) now sends workersStandby: 0 — true scale-to-zero.

2. Flash can't read runpodctl's config.toml (Fixes #363)

runpodctl writes credentials as a top-level apikey field. Flash only looks for [default].api_key. Users who set up runpodctl first get "please run flash login" despite valid credentials existing in the same file.

Fix: Add a fallback in get_api_key() to check the top-level apikey when no [default] section is found. [default].api_key still wins when both exist.

Test plan

  • All 25 credential tests pass (23 existing + 2 new)
  • New test: runpodctl-only config file → get_api_key() returns the key
  • New test: both formats present → [default].api_key takes precedence

Closes #364
Closes #363

When deploying with workers=(0, N) for scale-to-zero, Flash never sent
the workersStandby field to the API. RunPod's backend defaults it to 1,
so a warm worker stays up 24/7 regardless of workersMin=0.

- Add workersStandby field to ServerlessResource model
- Set workersStandby = workersMin in the deploy payload, so
  workers=(0, N) correctly sends workersStandby=0

Closes runpod#364
runpodctl writes credentials as a top-level `apikey` field, while Flash
only looked for `[default].api_key`. Users who set up runpodctl first
were told to run `flash login` despite valid credentials existing.

- Add fallback in get_api_key() to check top-level `apikey` when no
  [default] section is found
- [default].api_key still takes precedence when both exist
- Add tests for runpodctl-only config and precedence behavior

Closes runpod#363
@Swigler
Swigler force-pushed the fix/scale-to-zero-and-config-compat branch from a41fc7b to 2b8d108 Compare September 3, 2026 17:56
@Swigler

Swigler commented Sep 3, 2026

Copy link
Copy Markdown
Author

Friendly ping — this is ready for review. Hit this while running scale-to-zero deployments; happy to adjust if the approach doesn't fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant