Repository navigation
Conversation
pnpm appends every token after a script's name to the script, the `--`
included, so the program the script invokes reads what follows as operands.
clap instead treats the first `--` as its own escape and drops it:
$ pnpm run show -- --other=1
pnpm: node -e "…" -- --other=1 -> ARGS:["--other=1"]
pacquet: node -e "…" --other=1 -> node: bad option: --other=1
Only the separator in the first argument position is affected. clap keeps
later ones as ordinary values, because a trailing-var-arg positional that
has started taking values no longer treats `--` as an escape — the same
reason `exec`, whose whole command is one such positional, never lost it.
Preserve it in argv space, the way the neighbouring shorthand and
flag-relocation passes already normalize argv for clap: write a second
`--` at that position so the token clap consumes is the inserted one.
`stop` and `restart` take script arguments through the same shape and are
covered too; `test` and `start` accept no trailing arguments at all, which
is #13301.
Closes #13295
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThe CLI now preserves ChangesScript separator forwarding
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Out-of-scope changes
Sequence Diagram(s)sequenceDiagram
participant CLI as run_cli
participant Preserver as preserve_script_separator
participant Clap as clap
participant Script as executed script
CLI->>Preserver: transform command argv
Preserver->>Clap: provide inserted escape separator
Clap->>Script: forward user-provided separator and arguments
Possibly related issues
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/src/script_separator.rs (1)
23-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse regular comments for private implementation and test rationale.
pnpm/crates/cli/src/script_separator.rs#L23-L30: Change///to//for the private command tables.pnpm/crates/cli/tests/run.rs#L666-L671: Change the private test rationale to a regular comment.pnpm/crates/cli/tests/run.rs#L697-L698: Change the private test rationale to a regular comment.As per coding guidelines, rustdoc comments are for public API contracts, while implementation rationale uses regular comments.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/script_separator.rs` around lines 23 - 30, Replace the rustdoc comments with regular comments for the private command tables SCRIPT_COMMANDS and TAKES_SCRIPT_NAME in pnpm/crates/cli/src/script_separator.rs:23-30, and for the private test rationale comments in pnpm/crates/cli/tests/run.rs:666-671 and pnpm/crates/cli/tests/run.rs:697-698; preserve all comment text and behavior.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm/crates/cli/src/script_separator.rs`:
- Around line 23-30: Replace the rustdoc comments with regular comments for the
private command tables SCRIPT_COMMANDS and TAKES_SCRIPT_NAME in
pnpm/crates/cli/src/script_separator.rs:23-30, and for the private test
rationale comments in pnpm/crates/cli/tests/run.rs:666-671 and
pnpm/crates/cli/tests/run.rs:697-698; preserve all comment text and behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 33fcff5e-671a-452e-974a-319a02f0696e
📒 Files selected for processing (5)
.changeset/pacquet-run-argument-separator.mdpnpm/crates/cli/src/lib.rspnpm/crates/cli/src/script_separator.rspnpm/crates/cli/src/script_separator/tests.rspnpm/crates/cli/tests/run.rs
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Redundant ArgTable rebuilds
|
Confidence Score: 3/5This PR should not merge until separators following option-shaped script arguments are left unchanged. The new scanner does not recognize that a hyphenated token after the script name has already started the trailing argument vector, so it can insert an additional separator and alter the script’s argv. Files Needing Attention: pnpm/crates/cli/src/script_separator.rs Reviews (1): Last reviewed commit: "fix(cli): forward the argument separator..." | Re-trigger Greptile |
| if let Some(rest) = token.strip_prefix("--") { | ||
| let (name, has_inline_value) = | ||
| rest.split_once('=').map_or((rest, false), |(name, _)| (name, true)); | ||
| let consumes_value = top_level | ||
| .long_consumes_value(name) | ||
| .or_else(|| subcommand_union.long_consumes_value(name)) | ||
| .unwrap_or(false); | ||
| index += token_width(consumes_value, has_inline_value); | ||
| } else if let Some(rest) = token.strip_prefix('-').filter(|rest| !rest.is_empty()) { | ||
| let short = rest.chars().next().expect("checked non-empty"); |
There was a problem hiding this comment.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13303 +/- ##
==========================================
+ Coverage 86.96% 87.02% +0.05%
==========================================
Files 530 532 +2
Lines 90954 91494 +540
==========================================
+ Hits 79099 79621 +522
- Misses 11855 11873 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4799319895800003,
"stddev": 0.15747520029590156,
"median": 2.3917111994800004,
"user": 1.5359181799999997,
"system": 1.2921285999999998,
"min": 2.35226426548,
"max": 2.75101741248,
"times": [
2.38498351648,
2.44095278248,
2.38281662948,
2.35226426548,
2.3726034614800002,
2.74784531448,
2.75101741248,
2.59250188348,
2.3984388824800003,
2.37589574748
]
},
{
"command": "pacquet@main",
"mean": 2.56553315518,
"stddev": 0.13078709346542777,
"median": 2.54558781898,
"user": 1.54598738,
"system": 1.306613,
"min": 2.35305446948,
"max": 2.7576015124800004,
"times": [
2.67835905648,
2.66129362648,
2.52388374148,
2.43719266248,
2.53952902948,
2.7576015124800004,
2.45249105848,
2.70027978648,
2.55164660848,
2.35305446948
]
},
{
"command": "pnpr@HEAD",
"mean": 1.59625822318,
"stddev": 0.14232208944604058,
"median": 1.63966027048,
"user": 1.05873718,
"system": 1.1371481,
"min": 1.40513550948,
"max": 1.7742677174800001,
"times": [
1.4506974784800002,
1.7041838174800001,
1.76287156348,
1.6331319664800001,
1.4290773384800002,
1.47590519948,
1.40513550948,
1.68112306648,
1.7742677174800001,
1.64618857448
]
},
{
"command": "pnpr@main",
"mean": 1.51033518358,
"stddev": 0.1539341148878107,
"median": 1.4617685699800003,
"user": 1.05609548,
"system": 1.1151617,
"min": 1.3514630594800001,
"max": 1.7623643504800002,
"times": [
1.3858274294800002,
1.4891457524800003,
1.53444042948,
1.3514630594800001,
1.43439138748,
1.6627949294800002,
1.37259638848,
1.7623643504800002,
1.3878806844800002,
1.72244742448
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25254533404,
"stddev": 0.007395201202495003,
"median": 0.25138778774000003,
"user": 0.20592497999999998,
"system": 0.51584186,
"min": 0.24380452374,
"max": 0.26603443974,
"times": [
0.24380452374,
0.25381466774,
0.25265699074000003,
0.24691400474000003,
0.25976520374,
0.26020104474,
0.24588150174,
0.25011858474000004,
0.24626237874,
0.26603443974
]
},
{
"command": "pacquet@main",
"mean": 0.25695951164,
"stddev": 0.005660673032140107,
"median": 0.25642030124000004,
"user": 0.20939037999999996,
"system": 0.51900666,
"min": 0.25023962174000003,
"max": 0.26790210474000004,
"times": [
0.25116542374,
0.25693794474000003,
0.26119683874,
0.26039049974,
0.25023962174000003,
0.26790210474000004,
0.25038656874000004,
0.25590265774000004,
0.26044454274,
0.25502891374000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26992545514000005,
"stddev": 0.006361785878832161,
"median": 0.26835924474,
"user": 0.21958487999999998,
"system": 0.52832526,
"min": 0.26169966474,
"max": 0.28053568474,
"times": [
0.26891832674,
0.26575575574,
0.27628188074000004,
0.26169966474,
0.27037982574,
0.26780016274,
0.28053568474,
0.26396343374000003,
0.27815096674,
0.26576884974000003
]
},
{
"command": "pnpr@main",
"mean": 0.26799158554,
"stddev": 0.005424464127629831,
"median": 0.26751280174000003,
"user": 0.21036267999999997,
"system": 0.53199346,
"min": 0.26027244774,
"max": 0.27689839074,
"times": [
0.27195778474000004,
0.27238473874,
0.26027244774,
0.26143248174,
0.26694406074,
0.27266314274000003,
0.27689839074,
0.26575149774,
0.26808154274,
0.26352976774000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7803334053,
"stddev": 0.013687758452649555,
"median": 2.779842376,
"user": 1.7043607600000001,
"system": 1.30627712,
"min": 2.7596878124999997,
"max": 2.7995207614999997,
"times": [
2.7652716004999998,
2.7995207614999997,
2.7817946785,
2.7673537855,
2.7985794105,
2.7778900735,
2.7596878124999997,
2.7761348805,
2.7897289415,
2.7873721084999996
]
},
{
"command": "pacquet@main",
"mean": 2.7725696735999996,
"stddev": 0.015381784510168766,
"median": 2.7689435435,
"user": 1.74490556,
"system": 1.2784935199999998,
"min": 2.7523299435,
"max": 2.7977916085,
"times": [
2.7585705414999997,
2.7894891625,
2.7745822904999997,
2.7782336085,
2.7880169515,
2.7631008825,
2.7977916085,
2.7633047965,
2.7523299435,
2.7602769504999998
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6091078936000003,
"stddev": 0.10705819443170744,
"median": 1.6138099870000002,
"user": 1.00793746,
"system": 1.1264069200000002,
"min": 1.4564397275,
"max": 1.7685575005,
"times": [
1.5335575065,
1.7685575005,
1.5063604584999999,
1.5109592085,
1.5725020375,
1.7201261955,
1.7120545815000001,
1.6554037835,
1.4564397275,
1.6551179365000002
]
},
{
"command": "pnpr@main",
"mean": 1.5578355761,
"stddev": 0.1719358941445709,
"median": 1.4684427405,
"user": 1.0614204600000001,
"system": 1.1110642199999998,
"min": 1.4226809185,
"max": 1.8605440085,
"times": [
1.4239201295000001,
1.4226809185,
1.6943181605000002,
1.4414406355,
1.4780715375,
1.5441780315,
1.8272871925,
1.8605440085,
1.4588139435,
1.4271012035000001
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.58622929958,
"stddev": 0.0072308788480290485,
"median": 0.5861946703800001,
"user": 0.7188079999999999,
"system": 0.68276842,
"min": 0.56928412238,
"max": 0.59498767038,
"times": [
0.59127102838,
0.59237451438,
0.58452685338,
0.59498767038,
0.58586780538,
0.58652153538,
0.58522023738,
0.59055712638,
0.58168210238,
0.56928412238
]
},
{
"command": "pacquet@main",
"mean": 0.5756006004800001,
"stddev": 0.01193430480934997,
"median": 0.57266727588,
"user": 0.6894335,
"system": 0.6707885199999999,
"min": 0.56318606238,
"max": 0.60352547838,
"times": [
0.58554111038,
0.57246530538,
0.56802425238,
0.56794300038,
0.57810864238,
0.60352547838,
0.56318606238,
0.57286924638,
0.56561490138,
0.57872800538
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3007565280800001,
"stddev": 0.004935804782758836,
"median": 0.30066161538,
"user": 0.19438869999999997,
"system": 0.51962062,
"min": 0.29171602338,
"max": 0.30829657138000005,
"times": [
0.30128151638000006,
0.30674735838000006,
0.30004171438000005,
0.29171602338,
0.30338352038000005,
0.29990825438,
0.29575895938,
0.30254146538000004,
0.30829657138000005,
0.29788989738000005
]
},
{
"command": "pnpr@main",
"mean": 0.30832383238000005,
"stddev": 0.0049408348033697725,
"median": 0.30789676538,
"user": 0.19485009999999997,
"system": 0.53830592,
"min": 0.30126429438,
"max": 0.31521938438,
"times": [
0.31376710138,
0.30489981238,
0.31164580238000006,
0.30561891538,
0.31521938438,
0.31017461538,
0.30126429438,
0.30332188338000005,
0.31278275138000006,
0.30454376338000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9085260147600003,
"stddev": 0.008661516394618913,
"median": 1.90984379286,
"user": 0.9416520599999998,
"system": 0.73912958,
"min": 1.8935894798600001,
"max": 1.91813606986,
"times": [
1.91813606986,
1.90655316386,
1.9160971238600002,
1.9060391968600001,
1.90230789686,
1.89752358786,
1.8935894798600001,
1.9131344218600002,
1.91508313686,
1.9167960698600002
]
},
{
"command": "pacquet@main",
"mean": 1.9091347090600004,
"stddev": 0.010201059135156622,
"median": 1.90885295586,
"user": 0.9267155600000001,
"system": 0.76774168,
"min": 1.89248722586,
"max": 1.92357007286,
"times": [
1.89248722586,
1.90957232186,
1.92006343486,
1.9176012938600002,
1.89924236786,
1.90813358986,
1.9161863548600002,
1.92357007286,
1.89939847986,
1.90509194886
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29995101166000004,
"stddev": 0.0066934913285807696,
"median": 0.30049277936,
"user": 0.18694726,
"system": 0.53481168,
"min": 0.28962228286,
"max": 0.30975972786,
"times": [
0.29391381486,
0.28962228286,
0.30093337786,
0.30379679186,
0.29115614786,
0.30005218086,
0.30423386486000004,
0.30711835086,
0.30975972786,
0.29892357686000004
]
},
{
"command": "pnpr@main",
"mean": 0.3055577114600001,
"stddev": 0.004201284145571433,
"median": 0.30661965286000004,
"user": 0.19704335999999997,
"system": 0.53945758,
"min": 0.30008659486,
"max": 0.31211907686,
"times": [
0.30675472686,
0.30200075486,
0.30648457886,
0.30888348986,
0.30008659486,
0.30182821086,
0.30029947586,
0.30893484786000003,
0.30818535786,
0.31211907686
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36236037854,
"stddev": 0.007937820330306091,
"median": 0.36117519644000007,
"user": 0.35501473999999994,
"system": 0.054260199999999995,
"min": 0.35426916244,
"max": 0.38358567244,
"times": [
0.38358567244,
0.35426916244,
0.36220252344000003,
0.36046893344000003,
0.36188145944000005,
0.36300524344,
0.36197202944,
0.35987095844000005,
0.35982483144000005,
0.35652297144000006
]
},
{
"command": "pacquet@main",
"mean": 0.35817569374,
"stddev": 0.005840557115614418,
"median": 0.35884610544000006,
"user": 0.35507414,
"system": 0.050568199999999994,
"min": 0.34684877544000003,
"max": 0.36447901444,
"times": [
0.35612101544,
0.36275894044,
0.36273200944000006,
0.36429918744,
0.35526523544000005,
0.35775909644000004,
0.35993311444000003,
0.35156054844,
0.34684877544000003,
0.36447901444
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08704623438117651,
"stddev": 0.0016591069436966992,
"median": 0.08681666594000001,
"user": 0.019764151764705883,
"system": 0.009487814705882353,
"min": 0.08379810844,
"max": 0.08981027644,
"times": [
0.08379810844,
0.08774528244,
0.08667484844000001,
0.08749268744000001,
0.08967583344,
0.08540254644,
0.08679450444,
0.08661073844,
0.08465036244,
0.08683882744,
0.08759344644,
0.08626135144000001,
0.08834042144,
0.08842997944,
0.08504210744,
0.08981027644,
0.08617740444000001,
0.08737811144,
0.08626811444,
0.08383969644,
0.08942700544,
0.08656333944,
0.08866482244,
0.08747878044,
0.08490384844,
0.08919037044,
0.08597175644,
0.08964188044,
0.08554581544,
0.08785838544,
0.08608450944,
0.08952235444000001,
0.08670197944000001,
0.08719247244
]
},
{
"command": "pnpr@main",
"mean": 0.08699432886424241,
"stddev": 0.001610740977368783,
"median": 0.08714380144,
"user": 0.02018413393939394,
"system": 0.00881660303030303,
"min": 0.08240648144,
"max": 0.08994986944,
"times": [
0.08579909244,
0.08711378544000001,
0.08762386444,
0.08709143244,
0.08859417044000001,
0.08615613344,
0.08812309344000001,
0.08718804444,
0.08785170244,
0.08688213844,
0.08782057344000001,
0.08714380144,
0.08735426644000001,
0.08806507344,
0.08834144344,
0.08636672944,
0.08681132644,
0.08713607744,
0.08254697444,
0.08789400244000001,
0.08736023844,
0.08766391944,
0.08701192244,
0.08845499744,
0.08659741444,
0.08703538744,
0.08240648144,
0.08740444144000001,
0.08825672344,
0.08677307444,
0.08706810844,
0.08292654844,
0.08994986944
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.535090998459999,
"stddev": 0.1522900067772248,
"median": 4.46933875166,
"user": 1.73372232,
"system": 1.36148524,
"min": 4.424064898659999,
"max": 4.841420879659999,
"times": [
4.44823738466,
4.424064898659999,
4.79426619966,
4.47023016866,
4.52478023866,
4.44418373866,
4.4684473346599995,
4.841420879659999,
4.438212097659999,
4.4970670436599995
]
},
{
"command": "pacquet@main",
"mean": 4.51945584816,
"stddev": 0.08246737675950762,
"median": 4.48226146116,
"user": 1.7528317200000003,
"system": 1.33757184,
"min": 4.44966648666,
"max": 4.72090729266,
"times": [
4.72090729266,
4.47759693866,
4.44966648666,
4.461670734659999,
4.5726402426599995,
4.48692598366,
4.531319121659999,
4.46165439466,
4.556536718659999,
4.475640567659999
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5502447363600007,
"stddev": 0.1492276553565166,
"median": 3.50952581816,
"user": 1.15382882,
"system": 1.2464418399999997,
"min": 3.42554392566,
"max": 3.89141556566,
"times": [
3.49518119066,
3.5567771886600004,
3.44183365066,
3.45020042866,
3.89141556566,
3.5319142076600003,
3.4532617346600003,
3.7324490256600003,
3.52387044566,
3.42554392566
]
},
{
"command": "pnpr@main",
"mean": 3.51043751686,
"stddev": 0.10721528420290423,
"median": 3.4799268156600003,
"user": 1.23041322,
"system": 1.2047629399999997,
"min": 3.43637833366,
"max": 3.80568143066,
"times": [
3.5195858216600002,
3.46483008166,
3.45047367366,
3.43637833366,
3.4896607516600002,
3.80568143066,
3.49515264766,
3.4580669946600002,
3.4701928796600003,
3.51435255366
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13303 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,456.44 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 289.62 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 291.72 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 83.80 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,405.14 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,425.54 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 261.70 ms |
|
Superseded by #13300, which landed the same fix with a better mechanism. Closing. That PR fixes the root cause structurally — giving
I picked argv pre-processing over restructuring Still open after #13300
Written by an agent (Claude Code, claude-opus-5). |
Summary
pnpm run <script> -- <args>dropped the--, so the program a script invokes read the following tokens as its own options. The reported case turns a working command into a hard failure:The loss is at parse time, not in the executor: clap treats the first
--as its own escape token and removes it.runis exposed because its script name is a separate single-value positional — once that is consumed, clap is no longer mid-positional and the next--is taken as the escape.execcollects its whole command into onetrailing_var_argpositional, which is why it was never affected, and why a separator that follows an argument (pnpm run build x -- y) already survived.This restores it in argv space, where the neighbouring
shorthandsandflag_relocationpasses already normalize argv for clap: write a second--at that position, so the token clap consumes is the inserted one and the user's own separator reaches the script.stopandrestartpass script arguments through the same shape and are covered too.Verified against the TypeScript CLI
Every form checked by running both binaries against a script that prints its own argv (
node args.js→OUT:[…]):run mytask -- --other=1["--","--other=1"]["--other=1"]["--","--other=1"]run mytask -- -x a["--","-x","a"]["-x","a"]["--","-x","a"]run mytask x -- y["x","--","y"]["x","--","y"]["x","--","y"]run mytask -- x -- y["--","x","--","y"]["x","--","y"]["--","x","--","y"]run mytask a b["a","b"]["a","b"]["a","b"]mytask -- --other=1["--","--other=1"]["--","--other=1"]["--","--other=1"]stop -- --other=1["--","--other=1"]["--other=1"]["--","--other=1"]stop x -- y["x","--","y"]["x","--","y"]["x","--","y"]Tests
Unit tests cover the argv transformation (leading separator doubled, non-leading left alone, options stepped over, non-script commands untouched,
pnpm runwith no script name untouched). Two integration tests assert on the arguments the script receives rather than on the echoed command line — that is what catches the separator going missing. I confirmedrun_forwards_the_argument_separator_to_the_scriptfails when the pass is disabled, and thatrun_keeps_a_separator_that_follows_an_argumentstill passes then, so it genuinely pins the "don't double it" half.Not included
pnpm testandpnpm startaccept no trailing arguments at all —pnpm test --watchfails with a usage error. That is a different defect (arguments not accepted, rather than the separator dropped) and is filed as #13301.script_separator.rsnotes the two commands so whoever implements it knows to extend the list.Closes #13295
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
pnpm run,pnpm stop, andpnpm restartso--is correctly forwarded to the underlying script.--are no longer incorrectly interpreted as options by the package manager or executed command.--appears as a regular script argument.Tests