[Bug] agent-eval: --help starts real model runs, unknown flags are ignored, fixture order is not sorted, and interrupted runs leave temp folders
Description
benchmarks/agent/run.ts reads its flags with argv.indexOf(...) (run.ts:43-62) and has no --help and no check for unknown flags. So --help starts the full suite of model runs (6 fixtures x 5 runs), and a typo such as --fixtrue single-file-edit quietly runs everything. loadFixtures sorts directory entries without a comparator (harness.ts:228), so the order depends on the file system. If a run is interrupted, its temp workspace (harness.ts:355) is not removed.
Environment
- OS: Windows 11 (10.0.26300)
- Node version: 22.22.3
- Nanocoder version: 1.31.0 (main at 9d88dda7)
- Provider: Ollama
- Model: qwen2.5:1.5b
Steps to Reproduce
- Run
npx tsx benchmarks/agent/run.ts --helpand stop it after 30 seconds. - Run it with
--fixtrue single-file-edit --runs 1and stop it after 30 seconds. - Run it with
--bogusflagand stop it after 30 seconds. - List the temp folder for
agent-eval-*.
Expected Behavior
--help prints usage and exits. Unknown flags are an error. Fixtures run in a fixed order. Stopping a run removes its workspace.
Actual Behavior
--help -> "failing-test 1/5", "failing-test 2/5" ... (still running when stopped)
--fixtrue single-file-edit --runs 1 -> "failing-test 1/1", "guard-json-parse 1/1" ... (all fixtures run)
--bogusflag -> runs the full suite
after stopping, temp folder: agent-eval-failing-test-udwoVY, agent-eval-failing-test-yYawV3, agent-eval-guard-json-parse-bKnaiB
Sorting (shown on its own, because Windows already returns sorted names):
input order : guard-json-parse, failing-test, multi-file-rename
current .sort(): guard-json-parse, failing-test, multi-file-rename <- unchanged: every entry becomes "[object Object]"
with comparator: failing-test, guard-json-parse, multi-file-rename
Suggested Fix
- Replace the
indexOfparsing inrun.tswithnode:utilparseArgs({strict: true}), and add a--helptext. harness.ts:228: use.sort((a, b) => a.name.localeCompare(b.name)).- Remove the workspace on
SIGINTandSIGTERM(the normal path already does it in thefinallyatharness.ts:448). - Add tests for
--helpand for an unknown flag.
Additional Context
- Harness: #1544. A paid provider makes
--helpcostly, because it starts 30 real runs. - [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs with the latest version of nanocoder
I can take #1745. I will verify the CLI argument and fixture-order behavior with offline tests, then add strict parsing, deterministic ordering, and signal-safe workspace cleanup if reproduced. I will not run the benchmark against a live model/provider.