Skip to content

--detach without --max-concurrent silently runs the sweep in the foreground (prints 'Lambda (detached)') #1535

Closed

Description

@scttfrdmn

Bug: --detach is silently ignored without --max-concurrent, and the sweep runs in the foreground

cmd/launch_sweep.go dispatches to the orchestrator only when detach && maxConcurrent > 0. Without --max-concurrent, the CLI prints:

   Mode: All at once
   Orchestration: Lambda (detached)

It then launches every member itself, in the foreground. Nothing reaches the orchestrator: no invocation and no spawn-sweep-orchestration record, so spawn sweep status <id> says "not found". A sweep is detached by default when --no-detach is absent, so a plain spawn launch … --param-file f.yaml is affected too.

Found live on 2026-11-05, spore-host-dev, v0.160.0: spawn launch regr160 --param-file plain.yaml --detach --ttl 30m … launched 2 instances directly. spawn-sweep-orchestrator had 0 invocations, and spawn sweep status regr160-20261105-421000 returned "not found". The same command with --max-concurrent 1 went to the orchestrator.

Consequences

Suggested fix

Pick one rule and apply it everywhere:

  • Either make --detach without --max-concurrent run the orchestrator "all at once" (max-concurrent = row count);
  • or refuse --detach without --max-concurrent, and make a default (no flag) sweep run in the foreground with output that says so.

Add a test that the printed orchestration mode matches the path actually taken.

Activity

  1. added this to the v0.161.0 milestone on Nov 6, 2026
  2. added
    bug
    area:launch
    on Nov 6, 2026
  3. scttfrdmn commented on Nov 6, 2026

    @scttfrdmn
    ContributorAuthor

    Owner decision (2026-11-06): foreground by default, and honour --detach.

    • A sweep with no detach flag runs in the foreground. That is what happens today, and the help text and output will now say so.
    • An explicit --detach without --max-concurrent goes to the orchestrator with max-concurrent set to the row count, so all rows launch at once.
    • Detach-only refusals and messages follow the path the sweep actually takes. A test pins that the printed mode matches the path taken.
  4. scttfrdmn commented on Nov 6, 2026

    @scttfrdmn
    ContributorAuthor

    Correction and revised owner decision (2026-11-06). The earlier decision rested on a wrong premise, and that error was mine.

    What is actually true: a parameter sweep with no detach flag is auto-detached. cmd/launch_sweep.go:135-155 sets detach = true and max-concurrent = min(rows, 10), and the sweep goes to the orchestrator. The help text ("auto-enabled for parameter sweeps") and the printed "Lambda (detached)" are accurate for that path. An existing test pins it (#1372), and so does spawn slurm, which passes --no-detach explicitly.

    What is broken is only an explicit --detach without --max-concurrent/--max-concurrent-auto. That skips the auto branch and leaves max-concurrent at 0, so the dispatch check fails and the sweep runs in the foreground while still printing "Lambda (detached)". This is the live repro. The issue body's claim that a plain --param-file sweep is affected too is wrong.

    Decision: keep the default. No-flag sweeps stay auto-detached with min(rows, 10). An explicit --detach without --max-concurrent now really goes to the orchestrator, with the same min(rows, 10) default. Use one dispatch function, key refusals on the path actually taken, and test that the printed mode matches the path. Nothing changes for plain sweeps.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:launchbugcomponent:spawn

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions