Observed problem
On current upstream main (026751ea), gstack-model-benchmark finds the positional prompt with:
process.argv.slice(2).find(a => !a.startsWith("--"))
That means values belonging to options are treated as positional prompts. A normal invocation with options before the prompt file crashes because claude is both the --models value and a directory in this repo:
bun run bin/gstack-model-benchmark --models claude README.md --dry-run
Current behavior:
FATAL: EISDIR: illegal operation on a directory, read
The CLI attempts to read claude as the prompt file instead of reading README.md.
Expected behavior
Flag values for --models, --workdir, --timeout-ms, --output, and --prompt should not be considered positional prompt arguments. The first standalone non-flag token after option parsing should be the prompt file or inline prompt.
Duplicate searches performed
Searched open issues and PRs for:
gstack-model-benchmark --models
model benchmark positional prompt models
gstack-model-benchmark EISDIR --models
benchmark EISDIR
bin/gstack-model-benchmark
The only nearby open PR I found is #1495, which adds an Ollama provider and touches the benchmark CLI, but it does not fix option-value-as-positional parsing or the EISDIR crash.
Candidate fix shape
Replace the first-non-dash positional heuristic with a tiny argument scanner that skips values consumed by known value flags, handles --flag=value, and returns only real positional arguments. Add a CLI regression test for --models claude <prompt-file> --dry-run.
Observed problem
On current upstream
main(026751ea),gstack-model-benchmarkfinds the positional prompt with:That means values belonging to options are treated as positional prompts. A normal invocation with options before the prompt file crashes because
claudeis both the--modelsvalue and a directory in this repo:Current behavior:
The CLI attempts to read
claudeas the prompt file instead of readingREADME.md.Expected behavior
Flag values for
--models,--workdir,--timeout-ms,--output, and--promptshould not be considered positional prompt arguments. The first standalone non-flag token after option parsing should be the prompt file or inline prompt.Duplicate searches performed
Searched open issues and PRs for:
gstack-model-benchmark --modelsmodel benchmark positional prompt modelsgstack-model-benchmark EISDIR --modelsbenchmark EISDIRbin/gstack-model-benchmarkThe only nearby open PR I found is #1495, which adds an Ollama provider and touches the benchmark CLI, but it does not fix option-value-as-positional parsing or the
EISDIRcrash.Candidate fix shape
Replace the first-non-dash positional heuristic with a tiny argument scanner that skips values consumed by known value flags, handles
--flag=value, and returns only real positional arguments. Add a CLI regression test for--models claude <prompt-file> --dry-run.