feat(s12_agent): parallel orchestrator with bounded semaphore#200
Merged
Conversation
Phase D2 of the LLM backend upgrade. Sub-agent dispatch now supports mixed serial + parallel groups. Serial requests run first in input order; parallel-marked requests fan out through asyncio.gather, with the group's semaphore sized at min(max_concurrent) of the involved descriptors. SubagentTypeOrchestrator.orchestrate - Two-pass: partition state.delegate_requests by descriptor.parallel, dispatch serial sequentially (preserves input order for deterministic logging), then fan out the parallel group bounded by asyncio.Semaphore. - Unknown agent_types and parallel=False go through the serial path. - Existing failure-isolation contract preserved: one factory crash becomes a structured sub_result without aborting siblings. Tests (tests/unit/test_subagent_parallel.py, NEW) - 7 cases: wall-time budget proves parallel pair runs concurrently, max_concurrent cap respected, mixed-cap group uses min(), serial input-order preserved, parallel-failure isolation, empty delegate_requests no-op, pure-serial path unchanged from D1. Full suite: 3221 passed, 8 skipped, 0 failed. Plan reference: docs/llm-backend-upgrade-plan/07_rollout_phases.md (Phase D2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Phase D2 of the LLM backend upgrade cycle. Sub-agent dispatch now supports mixed serial + parallel groups. Serial requests run first in input order; parallel-marked requests fan out through `asyncio.gather` bounded by a semaphore sized at `min(max_concurrent)` of the involved descriptors.
What's new
Test plan
Plan reference: `docs/llm-backend-upgrade-plan/07_rollout_phases.md` (Phase D2).