feat: --concurrency-limit and --parallel#309
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90292b3452
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
--concurrency-limit and --parallel
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9480733bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add `--concurrency` to limit the number of concurrent tasks per execution graph level (supports numbers and percentages like `50%`), and `--parallel` to discard dependency edges and run tasks independently. Both flags are per-level: nested `vp run` inherits the parent's concurrency unless it specifies its own `--concurrency`. When `--parallel` is used without `--concurrency`, concurrency is unlimited. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename flag from --concurrency to --concurrency-limit - Reduce default concurrency from 10 to 4 - Remove percentage format support (e.g. 50%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Flags must appear before the task name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…IT env var Remove the implicit context-based concurrency inheritance. Instead, use the VP_RUN_CONCURRENCY_LIMIT environment variable (which naturally passes through to child processes since VP_* is already untracked). Priority order: --concurrency-limit flag > VP_RUN_CONCURRENCY_LIMIT env > --parallel (unlimited) > default (4). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Only show the interactive task selector when no execution flags (--concurrency-limit, --parallel) are present - Cap semaphore permits to Semaphore::MAX_PERMITS to avoid panic when concurrency_limit is usize::MAX (from --parallel) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
--parallel takes priority over VP_RUN_CONCURRENCY_LIMIT, not the other way around. The code was correct; the docs and comments were not. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cc179dc to
7735322
Compare
Package b depends on a, so without --parallel they run sequentially. Both use a barrier requiring 2 participants — completing without timeout proves --parallel discards edges and runs them concurrently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7735322 to
48cbdea
Compare
…napshot tests Each plan case now gets its own Session initialized with the correct env vars and cwd upfront, instead of mutating a shared session. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce a separate `interrupt_token` (CancellationToken) that is cancelled by the Ctrl-C handler. Unlike the existing `fast_fail_token` (renamed from `cancellation_token`) which kills child processes on task failure, the interrupt token only prevents scheduling new tasks and caching results — running processes are left to handle SIGINT naturally from the OS. - Add `Cancelled` variant to `CacheNotUpdatedReason` - Add `ExecutionContext::cancelled()` helper that checks both tokens - Wire `ctrlc::set_handler` to cancel the interrupt token - Expand ctrl-c e2e fixture into a workspace to test both behaviors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On Windows, an ancestor process created with CREATE_NEW_PROCESS_GROUP sets a per-process flag (CONSOLE_IGNORE_CTRL_C) that silently drops CTRL_C_EVENT before it reaches registered handlers. Clear this flag so the interrupt_token handler fires when Ctrl-C is pressed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
--concurrency-limitflag to control the number of tasks running at the same time.--parallelflag to ignore task dependencies and run all tasks at once with unlimited concurrency (unless--concurrency-limitis also specified)🤖 Generated with Claude Code