Repository navigation
Report swarm agents as running once they claim a parallel slot - #383
Merged
Merged
Conversation
The dispatcher now acquires the max_parallel permit before spawning each unit and then reports it running, instead of the spawned task acquiring it silently. Units stay queued while they wait for a slot, runtime-for clones and their template row are reported correctly, and the tests check the pending, running, completed sequence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Swarm agents in a parallel tier, loop pass, or runtime
forwere never reported asrunningbefore they finished, so the SWARM panel showed them as queued for their whole run. Units now reportrunningonce they claim amax_parallelslot, and "queued" means "waiting for a slot".Changes
claim_slotinswarm/pipeline.rs. It acquires the semaphore permit in the dispatcher, then emitsAgentStatus::Running. The permit is passed into the spawned task, so the dispatcher never holds one while it waits.claim_slotat the parallel-tier and loop-pass spawn sites. The old in-tasksem.acquire().unwrap()is removed. A closed semaphore is now an error instead of a panic.forclones andmap_reduceworkers), report all units asqueuedup front, thenrunningas each takes a slot. The per-unitqueuedreport that came after the slot is gone.fortemplate row asrunning(N item(s)) while its clones run, since it acts as the barrier.RecordingObserver:swarm_parallel_dispatch.rs: 3 units in a tier with 2 slots, and a parallel loop where every pass reportsrunning.swarm_runtime_for.rs: 3 clones with 2 slots, plus the template row.Testing
git diff --check origin/main...HEADcargo testwas not run (skipped in this run). The new tests were added but not executed here.Risks / Notes
🤖 Generated with Claude Code