fix(mcp): treat a bare help positional as --help in parseOptions (#6257) - #6362
Conversation
…SONbored#6257) decision-pack/repo-decision/review-pr are dispatched with parsed `options` and only check `options.help === true`, but parseOptions dropped any non-`--` arg, so a dashless `loopover-mcp decision-pack help` never set options.help and fell through to a confusing "Pass --login…" error instead of printing usage — while the raw-args commands (lint-pr-text/validate-config/slop-risk/issue-slop) already special-cased `args[0] === "help"`. Set options.help = true for a standalone `help` positional, symmetric with how `--help` already resolves to options.help. A `help` consumed as a `--key value` value is skipped before this check, so only a bare positional is affected. Adds a bare-`help` test for all three commands alongside their existing --help tests.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6362 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 598 598
Lines 47202 47202
Branches 15022 15022
=======================================
Hits 45128 45128
Misses 1290 1290
Partials 784 784
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 05:13:07 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
loopover-mcp decision-pack help(andrepo-decision help/review-pr help) threw a confusing "Pass --login…" error instead of printing usage, because a barehelppositional (no dashes) was silently dropped. These three commands are dispatched with a parsedoptionsobject and only checkoptions.help === true, butparseOptionsskips any non---argument — sooptions.helpwas never set. The other four command-dispatch siblings (lint-pr-text/validate-config/slop-risk/issue-slop) receive rawargsand already special-caseargs[0] === "help".Fix
In
parseOptions, setoptions.help = truefor a standalonehelppositional — symmetric with how--helpalready resolves tooptions.help = true, and the DRY equivalent of the siblingargs[0] === "help"special-case that fixes all three option-consuming commands at once:A
helpconsumed as a--key valuevalue (e.g.--query help) is skipped via the--key valuebranch'sindex += 1before ever reaching this check, so only a genuinely standalonehelppositional is affected. The four already-correct commands are unchanged (they checkargs[0]before parsing).loopover-mcp decision-pack helpnow prints usage; verified manually and by tests.Scope / Validation / Safety
Closes #6257.helptest for all three commands (decision-pack/repo-decision/review-pr), asserting they printUsage:and not thePass --loginerror, alongside their existing--helptests.parseOptions;npm run build:mcp(syntax) green.helppassed as a flag value; no secrets; noapps//site//CNAMEchanges.packages/loopover-mcp/bin/**isn't in Codecov's collected scope (onlysrc/**,packages/loopover-engine/src/**,packages/loopover-miner/lib/**are); the fix is verified by thetest/unit/mcp-cli-*suite that invokes the real bin.Closes #6257