Skip to content

gstack-model-benchmark treats --models value as the prompt when options precede a file #1603

@jbetala7

Description

@jbetala7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions