feat(commands): offer maxConcurrency automatically for wide plans - #65
Merged
Conversation
…s output maxConcurrency (runDag's optional concurrency cap, since 0.6.15) had no way to reach the interactive commands: /cys:run-plan and /cys:flow never saw the plan's inferred parallelism before launching, so they couldn't decide whether capping was worth offering. computeParallelWidth(graph) already existed (0.6.18, used only in the workflow's own final summary) — both CLIs now report it in their JSON so the commands can read it before the run starts.
runDag has supported an optional maxConcurrency cap since 0.6.15, but neither /cys:run-plan nor /cys:flow ever asked about it or passed it through — a user had to bypass the command and invoke the Workflow tool by hand to use it at all. Both commands now read parallelWidth from the parsed plan's JSON (previous commit) and, only when it exceeds 6, mention that the plan can run that many tasks at once and ask whether to cap it with maxConcurrency. Narrower plans are never asked — a low parallelWidth never benefits from capping. The chosen value (or its absence) now flows through to the Workflow launch args in both commands. Documented in both READMEs.
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
runDag's optionalmaxConcurrencycap has existed since v0.6.15 (semaphore applied after dependencies resolve, default unlimited, no deadlock), but neither/cys:run-plannor/cys:flowever asked about it or passed it through — using it required bypassing the command entirely and invoking theWorkflowtool by hand. This PR wires it into both commands.Type of change
Main changes
bin/parse-plan.js/bin/plan-remainder.js: reportparallelWidth(via the existingcomputeParallelWidth, 0.6.18) in their JSON output./cys:run-planand/cys:flow: whenparallelWidth > 6, mention the plan can run that many tasks at once and ask whether to cap it withmaxConcurrency. Narrower plans are never asked. The chosen value now flows through to theWorkflowlaunch args in both commands.npm run build+git diff --exit-code workflows/parallel-plan-executor.js— no change (bin/commands aren't inlined into the workflow).Version
featrule)Checklist
npm test), TDD (RED confirmed before GREEN for both the CLI output and the command-content assertions)