Repository navigation
fix(agents): merge separate --provider/-m flags into combined form #7434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
apurvvkumaria
merged 4 commits into
NVIDIA:main
from
kagura-chen:fix/hermes-wrapper-merge-provider-flags
Jul 25, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
672dd6f
fix(agents): merge separate --provider/-m flags into combined form (#…
kagura-chen 4a846ee
merge(main): sync Hermes provider flags fix
prekshivyas 7257574
test(hermes): close provider flag review blockers
prekshivyas a0af57c
test(hermes): exercise split flags through live inference
prekshivyas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // Coverage for the hermes CLI wrapper's provider/model flag merging | ||
| // (agents/hermes/hermes-wrapper.py, #7361): separate --provider and -m/--model | ||
| // flags must be merged into the combined provider/model form so the invocation | ||
| // routes through the OpenShell proxy rewrite path that resolves credential | ||
| // placeholders. | ||
| // | ||
| // Linux + python3 gated: the wrapper is a Python script invoked via its | ||
| // `#!/usr/bin/python3 -I` shebang. CI runs on Linux with python3 available, so | ||
| // the suite runs every PR; the gate exists so a maintainer cloning on macOS or | ||
| // Windows does not see a spurious red on `npm test`. See `.github/workflows/` | ||
| // for the canonical CI runner image. | ||
|
|
||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { canRun, runWrapper } from "./helpers/hermes-wrapper-harness.ts"; | ||
|
|
||
| describe.skipIf(!canRun)("agents/hermes/hermes-wrapper.py provider/model merge", () => { | ||
| it("merges separate --provider and -m flags into the combined form (#7361)", () => { | ||
| const run = runWrapper(["--provider", "opencode-zen", "-m", "nemotron-3-ultra-free"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["-m", "opencode-zen/nemotron-3-ultra-free"]); | ||
| }); | ||
|
|
||
| it("passes through model that already contains a slash (#7361)", () => { | ||
| const run = runWrapper( | ||
| ["--provider", "opencode-zen", "-m", "opencode-zen/already-prefixed"], | ||
| {}, | ||
| ); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual([ | ||
| "--provider", | ||
| "opencode-zen", | ||
| "-m", | ||
| "opencode-zen/already-prefixed", | ||
| ]); | ||
| }); | ||
|
|
||
| it("passes through --provider alone without -m (#7361)", () => { | ||
| const run = runWrapper(["--provider", "opencode-zen"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["--provider", "opencode-zen"]); | ||
| }); | ||
|
|
||
| it("passes through -m alone without --provider (#7361)", () => { | ||
| const run = runWrapper(["-m", "nemotron-3-ultra-free"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["-m", "nemotron-3-ultra-free"]); | ||
| }); | ||
|
|
||
| it("merges equals-form --provider and --model flags (#7361)", () => { | ||
| const run = runWrapper(["--provider=opencode-zen", "--model=some-model"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["--model=opencode-zen/some-model"]); | ||
| }); | ||
|
|
||
| it("merges when model appears before provider (#7361)", () => { | ||
| const run = runWrapper(["-m", "nemotron-3-ultra-free", "--provider", "opencode-zen"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["-m", "opencode-zen/nemotron-3-ultra-free"]); | ||
| }); | ||
|
|
||
| it("passes through empty provider value (#7361)", () => { | ||
| const run = runWrapper(["--provider", "", "-m", "nemotron-3-ultra-free"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["--provider", "", "-m", "nemotron-3-ultra-free"]); | ||
| }); | ||
|
|
||
| it("passes through combined form without --provider (#7361)", () => { | ||
| const run = runWrapper(["-m", "opencode-zen/nemotron-3-ultra-free"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["-m", "opencode-zen/nemotron-3-ultra-free"]); | ||
| }); | ||
|
|
||
| it("passes through duplicate provider flags as ambiguous (#7361)", () => { | ||
| const argv = [ | ||
| "--provider=opencode-zen", | ||
| "--provider", | ||
| "opencode-zen", | ||
| "-m", | ||
| "nemotron-3-ultra-free", | ||
| ]; | ||
|
|
||
| const run = runWrapper(argv, {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(argv); | ||
| }); | ||
|
|
||
| it("passes through mixed duplicate model flags as ambiguous (#7361)", () => { | ||
| const argv = [ | ||
| "--provider", | ||
| "opencode-zen", | ||
| "-m", | ||
| "nemotron-3-ultra-free", | ||
| "--model=nemotron-3-ultra-free", | ||
| ]; | ||
|
|
||
| const run = runWrapper(argv, {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(argv); | ||
| }); | ||
|
|
||
| it("merges flags before -- and preserves arguments after (#7361)", () => { | ||
| const run = runWrapper( | ||
| ["--provider", "opencode-zen", "-m", "nemotron-3-ultra-free", "--", "extra"], | ||
| {}, | ||
| ); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual(["-m", "opencode-zen/nemotron-3-ultra-free", "--", "extra"]); | ||
| }); | ||
|
|
||
| it("does not merge flags that appear only after -- (#7361)", () => { | ||
| const run = runWrapper(["--", "--provider", "opencode-zen", "-m", "nemotron-3-ultra-free"], {}); | ||
|
|
||
| expect(run.status).toBe(0); | ||
| expect(run.realArgv).toEqual([ | ||
| "--", | ||
| "--provider", | ||
| "opencode-zen", | ||
| "-m", | ||
| "nemotron-3-ultra-free", | ||
| ]); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.