Repository navigation
Conversation
Both options were declared with nargs="+" and argparse's default store action, so a second occurrence replaced the first instead of extending the list. reference/evaluation.md documents the repeated form for both flags, so -e API_KEY=... -e DEBUG=true launched the server with only DEBUG, and -H "Authorization: ..." -H "X-Custom-Header: ..." sent no Authorization header - silently, with no warning from parse_env_vars()/parse_headers(). action="extend" keeps the single-occurrence form working and makes the documented repeated form accumulate.
This was referenced Sep 27, 2026
|
Reviewed at head
|
8 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #1895
The change
One file, two lines —
skills/mcp-builder/scripts/evaluation.pylines 329 and 333:nargs="+"with the defaultstoreaction rebindsargs.env/args.headersonevery occurrence, so repeating the flag discards everything before the last
occurrence.
reference/evaluation.mdtells users to repeat both flags(
:440-446for-e,:454-459for-H), and nothing reports the loss —parse_env_vars()/parse_headers()only warn about malformed values, andAPI_KEY=abc123is well-formed.Red / green, measured
Both runs use the same script and the same case table; the "red" file is
git show origin/main:skills/mcp-builder/scripts/evaluation.pyextracted explicitly(so it is not affected by the working tree). Only
anthropicandconnectionsarestubbed — this box has no
ANTHROPIC_API_KEYand neither dependency installed, sothe observable output is the argument set
main()hands tocreate_connection().origin/main's blob and the branch differ on exactly lines 329 and 333, verified byline-by-line comparison.
Cases 1, 2 and 4 are the defect; 3 and 5 are the two shapes that already worked,
re-run to show
extendadds rather than changes them.default=Noneis safe withextend(case 5): argparse's_copy_itemsturnsNoneinto[]before extending,and
main()guards withif args.env/if args.headers.action="extend"needs Python 3.8+; this module already requires 3.10+ (-> str | Noneat line 79,list[str]/dict[str, str]at 275/290), so it adds no floor.Scope
-a/--args(line 328) has the same declaration and the same overwrite behaviour, butno documented usage repeats
-a, so it is left untouched here rather than changed onspeculation. It is named in #1895.
Also recorded in #1895 and deliberately not part of this diff: 4 of the 6
python scripts/evaluation.py ...lines inreference/evaluation.mdexit witherror: the following arguments are required: eval_filebefore reaching this code,because the last
nargs="+"option eats the trailing positional. The minimal repairthere is prose (move the operand, or add
--), so it is disclosed rather thanbundled. That is why the cases above put the XML file first — it is the shape that
parses on both
mainand the branch, so the comparison isolates this change.Duplicates
24 open PRs touch this file (#657 #747 #1321 #1377 #1386 #1397 #1588 #1602 #1674
#1676 #1683 #1690 #1720 #1724 #1780 #1837–#1845); all 24 were re-confirmed open and
all 24 patches re-downloaded before filing. Grepping added/removed lines for the two
options and the two parse helpers, only #747 rewrites these declarations, and it is a
pure line-wrap reformat that keeps
nargs="+"and adds noaction=— the overwritesurvives it. No PR touches
parse_headers()orparse_env_vars().