Skip to content

feat: --concurrency-limit and --parallel#309

Merged
branchseer merged 21 commits intomainfrom
feat/concurrency-parallel
Mar 31, 2026
Merged

feat: --concurrency-limit and --parallel#309
branchseer merged 21 commits intomainfrom
feat/concurrency-parallel

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Mar 29, 2026

Summary

  • Add --concurrency-limit flag to control the number of tasks running at the same time.
  • Add --parallel flag to ignore task dependencies and run all tasks at once with unlimited concurrency (unless --concurrency-limit is also specified)

🤖 Generated with Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@branchseer branchseer changed the title feat: add --concurrency and --parallel flags feat: add --concurrency-limit and --parallel flags Mar 29, 2026
@branchseer branchseer marked this pull request as draft March 29, 2026 10:24
@branchseer branchseer marked this pull request as ready for review March 29, 2026 13:01
@branchseer branchseer changed the title feat: add --concurrency-limit and --parallel flags feat: --concurrency-limit and --parallel Mar 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

branchseer and others added 12 commits March 29, 2026 21:13
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>
@branchseer branchseer force-pushed the feat/concurrency-parallel branch from cc179dc to 7735322 Compare March 29, 2026 13:16
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>
@branchseer branchseer force-pushed the feat/concurrency-parallel branch from 7735322 to 48cbdea Compare March 31, 2026 07:35
branchseer and others added 4 commits March 31, 2026 15:55
…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>
branchseer and others added 3 commits March 31, 2026 17:20
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>
@branchseer branchseer merged commit 1ef4e2f into main Mar 31, 2026
9 checks passed
@branchseer branchseer deleted the feat/concurrency-parallel branch March 31, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants