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
feat(load): argument placeholders and --load-args-file so calls are not identical - #2908
{{seq}} is the call's number in start order, from 1. {{worker}} is the worker index, from 0. {{uuid}} is a fresh UUID v4. {{rand:<min>-<max>}} is a random integer, inclusive at both ends.
A value that is exactly one numeric placeholder (page={{rand:1-50}}) is sent as a number, so an integer-typed argument gets an integer. A placeholder embedded in other text yields a string.
Any other double-brace text ({{name}}) is sent as written, so a Mustache-style argument is untouched.
A reversed or unsafe rand range is refused before anything connects, with load_args_invalid (exit 1).
--load-args-file <file> (NDJSON, one argument object per line): call n takes row (n-1) mod rows, merged over the flag arguments with the row winning on a key. --load-args-random picks a row at random instead.
Rows are validated up front: each line must be a JSON object, a number that overflows to Infinity is refused, and placeholders are checked.
It is refused with --load-scenario, whose steps carry their own args.
Like the scenario file, it is read by the front-end process (the CLI, or mcpdo's client), so relative paths resolve against the caller's cwd.
How
New core/cli/handlers/load-template.ts: placeholder check and compile (once per run, before the clock starts; values with no placeholder are reused rather than copied), args-file parsing and reading, and the per-call argument template for a tool load.
Engine: runLoad's call now receives the 1-based seq, and runLoadAcrossConnections hands each call a { seq, worker } context. LoadOptions.argRows carries the rows to the daemon.
Templating applies only under --load. A plain tools/call still sends {{seq}} literally.
Tests
clients/cli/__tests__/load-template.test.ts: compile, check and args-file unit tests, plus end-to-end runs against the HTTP test server that assert on the arguments the server actually received (call-1..4, row cycling over --tool-arg, random rows), and the refusals.
clients/mcpdo/__tests__/load.test.ts: flag rules, and a live-daemon run whose alternating valid/invalid rows show the rows reached the daemon (2 ok, 2 failed).
Docs: CLI README (flag rows + "Varying the arguments" section), mcpdo README, skills/mcpdo/SKILL.md. npm run local:gate green.
…ot identical (#2840)
{{seq}}, {{worker}}, {{uuid}} and {{rand:min-max}} in --load argument values
(and scenario args/uri) are substituted per call; a whole numeric placeholder
becomes a number. --load-args-file supplies NDJSON argument rows merged over
--tool-arg, in turn or (--load-args-random) at random.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved issues cause oversized datasets to fail at the IPC limit, drop own __proto__ keys during templating, and pass numeric URIs to a resource API that requires strings.
Adds per-call argument variation to load testing in the one-shot CLI and mcpdo, helping exercise caching and per-key behavior through the shared load engine.
Changes:
Adds placeholders and NDJSON argument rows with sequential or random selection.
Passes sequence and worker context through load calls and expands scenario arguments and resource URIs.
Adds flag validation, automated coverage, and usage documentation.
File
Description
skills/mcpdo/SKILL.md
Documents varying load arguments.
core/cli/handlers/load-test.ts
Threads call context through execution and applies templates.
core/cli/handlers/load-template.ts
Implements placeholder expansion and argument-file handling.
core/cli/handlers/load-scenario.ts
Validates placeholders in scenario inputs.
clients/mcpdo/src/connection/mcp.ts
Registers argument-file flags.
clients/mcpdo/src/connection/load-flags.ts
Validates options and loads rows before daemon dispatch.
clients/mcpdo/README.md
Documents new flags and argument variation.
clients/mcpdo/__tests__/load.test.ts
Tests flag rules and row delivery through the daemon.
clients/cli/src/cli.ts
Integrates flags, validation, and argument-file loading.
clients/cli/README.md
Explains placeholders and argument-file behavior.
clients/cli/__tests__/load-template.test.ts
Adds unit and end-to-end coverage for varying arguments.
- Refuse a scenario or args file too large for one daemon request up front,
instead of failing as an unreachable daemon.
- Build templated objects with Object.fromEntries so an own __proto__ key is
copied as data.
- Send a resources/read URI that is one numeric placeholder as a string.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
Copilot round 1 (review 5782502661), all three fixed in be13a2f:
Oversized args file or scenario vs. the 1 MiB daemon request line: now refused up front in mcpdo (load_args_invalid / load_scenario_invalid), naming the size and the limit.
Own __proto__ keys dropped by templating: objects are now built with Object.fromEntries.
A numeric-placeholder URI passed as a number: now converted to a string.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Safe integer endpoints can still yield an unsafe inclusive range size, making the upper bound unreachable; unsafe spans need validation before connecting and a boundary regression test.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Reject unsafe inclusive random range spans
core/cli/handlers/load-template.ts:63
Safe integer endpoints can still produce an unsafe inclusive range size. For example, {{rand:-9007199254740991-1}} passes validation, but rounding makes its upper endpoint 1 unreachable, even with the largest representable random draw below 1. Reject unsafe inclusive spans before connecting, and add a boundary regression test.
Copilot round 2 (review 5782718751): no inline comments. The one finding was in the "previously missed issue" block, so it has no thread and is answered here. Fixed in ec24895:
Safe endpoints with an unsafe inclusive span ({{rand:-9007199254740991-1}}): the check now also requires max - min + 1 to be a safe integer, so such a range is refused before connecting (load_args_invalid). There are boundary tests for that case and for the widest allowed span ({{rand:0-9007199254740990}}), and the README notes the span rule.
Copilot review loop closed: round 3 (review 5782913645) was clean, with no inline comments, no headline finding and no suppressed block. All findings from rounds 1 and 2 were fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2840
What
Calls in a
--loadrun no longer have to be identical. This adds two mechanisms, usable together, in the one-shot CLI andmcpdo tools/call --load:--tool-arg,--tool-args-json, an args-file row, and a scenario step'sargsanduri(--load: scenario file with a weighted mix of tools, resources/read and prompts/get #2839).{{seq}}is the call's number in start order, from 1.{{worker}}is the worker index, from 0.{{uuid}}is a fresh UUID v4.{{rand:<min>-<max>}}is a random integer, inclusive at both ends.page={{rand:1-50}}) is sent as a number, so an integer-typed argument gets an integer. A placeholder embedded in other text yields a string.{{name}}) is sent as written, so a Mustache-style argument is untouched.randrange is refused before anything connects, withload_args_invalid(exit 1).--load-args-file <file>(NDJSON, one argument object per line): callntakes row(n-1) mod rows, merged over the flag arguments with the row winning on a key.--load-args-randompicks a row at random instead.Infinityis refused, and placeholders are checked.--load-scenario, whose steps carry their ownargs.How
core/cli/handlers/load-template.ts: placeholder check and compile (once per run, before the clock starts; values with no placeholder are reused rather than copied), args-file parsing and reading, and the per-call argument template for a tool load.runLoad's call now receives the 1-basedseq, andrunLoadAcrossConnectionshands each call a{ seq, worker }context.LoadOptions.argRowscarries the rows to the daemon.--load. A plaintools/callstill sends{{seq}}literally.Tests
clients/cli/__tests__/load-template.test.ts: compile, check and args-file unit tests, plus end-to-end runs against the HTTP test server that assert on the arguments the server actually received (call-1..4, row cycling over--tool-arg, random rows), and the refusals.clients/mcpdo/__tests__/load.test.ts: flag rules, and a live-daemon run whose alternating valid/invalid rows show the rows reached the daemon (2 ok, 2 failed).Docs: CLI README (flag rows + "Varying the arguments" section), mcpdo README,
skills/mcpdo/SKILL.md.npm run local:gategreen.🤖 Generated with Claude Code