You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
collect-remote: --out, --workflow or --ref with no value is used as the string "true" #270
parseFlags stores a flag with no value as true. bin/collect-remote.mjs runs checkFlagValues on --max-pages, --depth, --runner, --search-transport and --timeout, but not on --out, --workflow or --ref:
So a bare --out becomes path.resolve(String(true)), which is <cwd>/true. usableOutDir() then creates that folder (fs.mkdirSync(dir, { recursive: true }) in lib/dispatch.mjs), and only after that is the token checked:
node research-kit/bin/collect-remote.mjs --repository o/r --topic t --out
This exits 3 with "no GitHub token" and leaves an empty ./true/ folder behind. With a token set, a bare --workflow or --ref would dispatch a run with the literal value "true".
The fix
Add out: 'value', workflow: 'value', ref: 'value' to that checkFlagValues spec. It already turns a valueless flag into --<name> needs a value and exits with EXIT.CANNOT_START, before anything is created or dispatched.
Test
research-kit/test/cli.test.mjs already has several "collect-remote refuses ... before it asks for a token" tests. Add one that runs the command above in a temporary project and asserts:
exit status 3
stderr matches /--out needs a value/
no folder named true exists in the project afterwards
Fix is in #281 (out: {}, workflow: {}, ref: {} in the checkFlagValues spec, the regression test this issue asked for, README inventory 1787, map row and CHANGELOG). It is the remedy #276 carried, with @bonilokesh credited as co-author.
Activity
StepenkoAnatoli commentedon Oct 11, 2026
Fix is in #281 (
out: {}, workflow: {}, ref: {}in thecheckFlagValuesspec, the regression test this issue asked for, README inventory 1787, map row and CHANGELOG). It is the remedy #276 carried, with @bonilokesh credited as co-author.Generated by Claude Code