Repository navigation
fix(cli): do not glob-expand arguments on Windows, so --skill '*' reaches APM - #4408
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits intoNov 21, 2026
Merged
Conversation
…ches APM (#4407) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 16:26
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new invocation breaks the CLI with supported Click 8.0.0, and Windows path expansion and the documented sentinel command also have unresolved issues.
3 open issues
What changed in this PR
This PR targets #4407 by changing APM’s Click entry point so Windows wildcard skill selectors reach the install command literally instead of expanding into directory contents.
Changes:
- Disables Click’s automatic Windows argument expansion.
- Adds an entry-point regression test and adapts existing CLI test stubs.
- Records the Windows skill-reset fix in the changelog.
| File | Description |
|---|---|
tests/unit/test_cli_sigterm.py |
Updates the SIGTERM test stub to accept additional keywords. |
tests/unit/test_cli_encoding.py |
Checks that main() disables Windows argument expansion. |
tests/integration/test_tls_trust.py |
Updates the TLS bootstrap test stub for the new keyword. |
src/apm_cli/cli.py |
Disables Windows argument expansion when invoking Click. |
CHANGELOG.md |
Documents the Windows wildcard skill-reset fix. |
Review effort: Balanced
| cli(obj={}) | ||
| # Click glob-expands argv on Windows by default, so `--skill '*'` became | ||
| # the current directory's file names (#4407). APM never wants that. | ||
| cli(obj={}, windows_expand_args=False) |
|
|
||
| ### Fixed | ||
|
|
||
| - Windows: `apm install --skill '*'` resets to every skill again instead of receiving the current directory's file names. (#4408) |
| cli(obj={}) | ||
| # Click glob-expands argv on Windows by default, so `--skill '*'` became | ||
| # the current directory's file names (#4407). APM never wants that. | ||
| cli(obj={}, windows_expand_args=False) |
5 of 10 tasks
#4407) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
… so --skill '*' reaches APM Co-authored-by: Copilot App <[email protected]>
… probe, not owner patches (#4407) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-windows-expand-args
branch
November 21, 2026 05:24
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.


Description
On Windows, Click glob-expands
sys.argvinside the process (windows_expand_args=Trueby default). Soapm install <pkg> --skill '*'received the current directory's file names (apm.yml,apm_modules,apm.lock.yaml) instead of*and failed. Shell quoting cannot prevent it. Found by the Windows lifecycle journeys (J04 step 4).src/apm_cli/cli.py:main()callscli(obj={}, windows_expand_args=False).tests/unit/test_cli_encoding.py: newtest_main_does_not_glob_expand_arguments_on_windowsasserts thatmain()disables the expansion. It fails without the fix.tests/unit/test_cli_sigterm.pyandtests/integration/test_tls_trust.py: theirfake_clistubs accept the extra keyword.No other command relies on the expansion. The only variadic arguments (
install,update,deps,approve,uninstall) take package specs, not file paths, and the only documented glob is--skill '*'(consumer/install-packages.md,getting-started/coming-from.md,reference/cli/install.md,reference/package-types.md).install/argv.pyalready reads the rawsys.argvfor--handling, so this also makes the two views agree.Issue and approved scope
Issue: Fixes #4407
Human scope-approval comment: the 0.37 steward ruling relayed by the Stream T lead (Windows journeys triage; every bug found is 0.37 scope).
Does this PR complete the issue, or what remains? It completes it.
Type of change
Testing
Results (local, off main):
pytest tests/unit/test_cli_encoding.py tests/unit/test_cli_sigterm.py tests/integration/test_tls_trust.py: 35 passed.Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)