Skip to content

feat(resume): --max-concurrent-auto derives concurrency from real quota - #496

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/494-resume-max-concurrent-auto
Aug 11, 2026
Merged

feat(resume): --max-concurrent-auto derives concurrency from real quota#496
scttfrdmn merged 1 commit into
mainfrom
feat/494-resume-max-concurrent-auto

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Extends #492's quota-derived concurrency ceiling (spawn launch --max-concurrent-auto, shipped in v0.99.0) to spawn resume — the follow-up filed as #494 when #492 shipped.

  • New spawn resume --max-concurrent-auto: re-derives the concurrency ceiling from the account's real AWS quota headroom for the PENDING parameter sets, instead of the sweep's original ceiling or a user-typed override.
  • Refactored the shared quota-derivation core out of resolveAutoMaxConcurrent into deriveMaxConcurrentFromCombos, so a new resolveAutoMaxConcurrentFromConfigs can reuse it directly from resume's already-built []*aws.LaunchConfig (the pending param sets, already defaults-merged and per-entry-overridden) — avoiding a second, subtly different merge pass over data that's already been merged once.
  • Mutually exclusive with --max-concurrent (same validation pattern as launch).

Scope: foreground only

Per the discussion when #494 was filed, --detach (Lambda-orchestrated resume) is explicitly out of scope here and rejected with a clear error rather than silently ignored. That path's stored parameters live in S3 with no download helper yet (only UploadParamsToS3 exists), and there's no route today from resume into the orchestrator's stored SweepRecord.MaxConcurrent before re-invoking Lambda — building that is a bigger, separate piece of work than this fix.

Also found (filed separately, not fixed here)

While implementing this, found resume.go's region-resolution has an unchecked type assertion (paramFormat.Defaults["region"].(string)) that panics instead of falling through to its own "us-east-1" default when the param file has no region default and at least one instance was already launched. Filed as spawn#495 — out of scope for this PR, flagging since --max-concurrent-auto's correctness now depends on region being reliably set.

Fixes #494.

Test plan

Extends #492's quota-derived concurrency ceiling to `spawn resume`
(#494), which had the same class of gap: its --max-concurrent override
was a plain user-typed int, same as launch's was before #492.

Refactored the shared quota-derivation core out of
resolveAutoMaxConcurrent into deriveMaxConcurrentFromCombos, so a
second entry point -- resolveAutoMaxConcurrentFromConfigs -- can reuse
it directly from resume's already-built []*aws.LaunchConfig (the
pending parameter sets, already defaults-merged and per-entry
overridden) instead of re-parsing raw params through a second merge
pass.

Scope: foreground (local-state) resume only. --detach is explicitly
rejected with --max-concurrent-auto: the Lambda-orchestrated path's
stored params live in S3 with no download helper yet (only upload
exists via UploadParamsToS3), and there's no route today from resume
into the orchestrator's stored MaxConcurrent before re-invoking. That
gap is real but bigger than this fix -- not silently ignored, just not
built yet.

Also found and filed (not fixed here, out of scope): resume's
region-from-defaults type assertion (`paramFormat.Defaults["region"].
(string)`) panics rather than falling through to its own "us-east-1"
default when the params file has no region default and at least one
instance was already launched (spawn#495).

Fixes #494.
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.42105% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/resume.go 33.33% 10 Missing ⚠️
cmd/launch_sweep_quota.go 91.30% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 9a215c1 into main Aug 11, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/494-resume-max-concurrent-auto branch August 11, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn resume: --max-concurrent has no quota-derived --max-concurrent-auto equivalent

1 participant