Skip to content

vp run: an option to stop the other tasks when one fails, for local runs #3694

Backlog

Description

@amitkaps

vp run reports a failure only once every task in the run has finished. When a check script runs several tasks side by side, like lint, tests and build, a test that fails early is still reported only once the slowest task ends. On a laptop, that wait is most of the time it takes to learn what failed.

Request: an option, such as --fail-fast, that stops the running tasks when one fails and prints that task's output. It would also be settable through an environment variable, so a script like "verify": "vp run all" can turn it on locally without a second script. Arguments after the task name go to the task, so a flag alone can't reach it through pnpm run verify.

Behaviour:

  • Tasks that were stopped write nothing to the cache.
  • Tasks that finished keep their results.
  • The exit code is the failed task's.

CI would leave it off, since a full report there costs nothing extra.

Tested with vite-plus 1.8.0, where vp run --help lists no such option.

Activity

  1. voidzero-bot commented on Dec 4, 2026

    @voidzero-bot
    Contributor
    • Reproduced: No — the reported wait-for-all behavior does not occur on current main; stop-on-failure already happens.
    • Exploration: Already fixed on main
    • Unit Test: No — no code change was made; behavior was verified manually with temporary projects (workspace and dependsOn task graphs).
    • Priority: P1: chore. Current main already behaves as the reporter requested, so there is no user-facing incorrect behavior left; the only remaining work is an optional toggle/flag, which is enhancement rather than a defect.

    On main, when any task in a vp run fails, the runner immediately stops the other running tasks (they exit with SIGKILL/137), exits with the failed task's exit code, and skipped tasks write nothing to the cache — verified in both --parallel and default modes, for dependsOn graphs and --recursive workspace runs. This comes from the upstream vite-task scheduler (crates/vt/src/session/execute/scheduler.rs in the pinned rev 69ff9fc), which cancels a fast_fail_token on any task failure. That behavior landed in chore(deps): bump vite-task to 69ff9fc (#3637) on 2026-12-02 — after both 1.8.0 and 1.9.0 — which explains why the reporter saw tasks waiting for each other on 1.8.0.

    This issue has already been fixed. Upgrading past the upcoming release that includes the vite-task bump from #3637 (or building from main) gives you the requested behavior by default: stopped tasks write nothing to the cache, finished tasks keep their results, and the exit code is the failed task's. Note the one remaining gap versus the request: there is no flag or environment variable to turn the behavior off, so a CI run that wants a full report of all tasks currently cannot opt out — that configurability would still be new feature work.

    Full Triage Report

    Triage report: issue #3694 — vp run: option to stop other tasks when one fails

    • Step: reproduce
    • Date: 2026-12-04
    • Checkout: vite-plus main @ branch triagebot/fix-3694, vp v1.9.0 (local vite-plus v1.9.0)
    • Environment: Ubuntu x64 (GitHub runner), Node.js v24.23.0, pnpm v12.11.2
    • Reporter environment: vite-plus 1.8.0

    Issue summary

    The reporter asks for a --fail-fast option (and a matching environment variable) for vp run, so that when one task in a parallel run fails, the other running tasks are stopped immediately and the failed task's output/exit code is reported, instead of waiting for every task to finish. Requested semantics:

    1. Tasks that were stopped write nothing to the cache.
    2. Tasks that finished keep their results.
    3. The exit code is the failed task's.

    The reporter observed on 1.8.0 that vp run --help lists no such option and that a failure is reported only once every task in the run has finished.

    Classification

    Feature — a request for new functionality (a flag plus an environment variable), not a report of incorrect behavior.

    Reproduction

    TRIAGE_DIR=/tmp/vite-plus-triage/gh-3694, two projects under $TRIAGE_DIR:

    • repro/ — single package with vite.config.ts tasks (fastok, fastfail, slow, and all with dependsOn); local vite-plus linked via pnpm link "$VITE_PLUS_REPO/packages/cli" --ignore-scripts.
    • repro-ws/ — pnpm workspace ws-root with pkgs/alpha (fails after ~2s) and pkgs/beta (sleep 6), task name check.

    Commands and results

    1. vp run --help — confirmed: no --fail-fast (or equivalent) option exists. The only related flag is --continue-on-error for vp check, not vp run.
    2. vp run check --parallel --recursive (flags after the task name) — flags after the task specifier are passed to the task as ADDITIONAL_ARGS; the run fails with "Task check not found". Confirms the reporter's note that a flag cannot be passed through pnpm run verify after the task name.
    3. vp run --parallel --recursive check with alpha failing at ~2s and beta sleeping 6s:
      • stdout shows both tasks starting; beta prints its first timestamp only.
      • Run ends at 2.09s; vp run --last-details shows beta#check ✗ (exit code: 137) (SIGKILL) and alpha#check ✗ (exit code: 1).
      • Exit code of the run: 1 (the failed task's code).
    4. Same scenario without --parallel (default mode): identical — sibling killed at ~2.09s, run exit code 1.
    5. vp run all (single package, dependsOn: ['fastok', 'fastfail', 'slow'], caching enabled on all three tasks): run ends at 0.098s. Summary: fastok ✓, fastfail ✗ (exit code: 1) → "Cache miss: no previous cache entry found", slow ✗ (exit code: 137) → "Cache miss: no previous cache entry found". The stopped task (slow) wrote nothing to the cache; the completed/failed tasks recorded their results; run exit code 1.
    6. Control: alpha changed to succeed (echo alpha ok), beta unchanged (sleep 6) — the run waits for beta, ends at 6.08s, exit 0, 2/2 successful.

    Result

    Not reproduced / already addressed on main. The reported behavior — failure reported only after every task finishes — does not occur on the current checkout. When a task fails, vp run immediately stops the other running tasks and exits with the failed task's exit code, in both --parallel and default modes and both for dependsOn graphs and workspace --recursive runs. All three requested semantics are already the default: stopped tasks write nothing to the cache, finished tasks keep their results, and the run exits with the failed task's code.

    Skipped as a feature request (not a bug report); the reproduction above was still run to characterize current behavior.

    Observations (no fix proposed)

    • The stop-on-failure behavior is implemented unconditionally in the upstream vite-task runner pinned by Cargo.toml (rev 69ff9fcbde1bff9ec05b733dddcd86972cbc9eb9, scheduler in crates/vt/src/session/execute/scheduler.rs): any task failure cancels a fast_fail_token, which prevents scheduling new tasks, kills running children (observed exit 137), and skips cache writes.
    • That behavior is very recent: chore(deps): bump vite-task to 69ff9fc (#3637) landed 2026-12-02, i.e. after vite-plus 1.8.0 (and after 1.9.0, released in release: v1.9.0 #3646 on 2026-11-28 per git log). The previous pin was 6a23096a (bumped in chore: bump vite-task to 7d69d65 #2813). This plausibly explains why the reporter saw wait-for-all behavior on 1.8.0.
    • Remaining gap versus the request: there is no user-facing toggle. The reporter wants the behavior settable (flag/env var) so a local "verify": "vp run all" script can enable it and CI can leave it off. On main, stop-on-failure is always on and cannot be disabled, and no --fail-fast-style flag or environment variable appears in vp run --help or in crates/vp_shared/src/env_vars.rs.

    This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions