fix(install): fail loudly when a package deploys to no target (closes #2796) - #2806
Open
Daniel Meppiel (danielmeppiel) wants to merge 3 commits into
Open
fix(install): fail loudly when a package deploys to no target (closes #2796)#2806Daniel Meppiel (danielmeppiel) wants to merge 3 commits into
Daniel Meppiel (danielmeppiel) wants to merge 3 commits into
Conversation
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
September 4, 2026 19:05
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
force-pushed
the
bbs/fix-2796-plugin-target-noop
branch
from
September 4, 2026 19:06
5ec924f to
444636e
Compare
Copilot started reviewing on behalf of
Daniel Meppiel (danielmeppiel)
September 4, 2026 19:08
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The changes correctly implement the specified failure condition with targeted diagnostics and comprehensive unit coverage for the new behavior (pure no-op, mixed batch, and dry-run).
Review tier: Lite
Findings: None
What changed in this PR
This PR updates the apm install outcome logic so that an Agent Plugins v1.0.0 package that is excluded by target selection (i.e., no selected target can receive it) is no longer treated as a successful no-op. Instead, the install fails (non-zero exit) only when that exclusion results in zero packages being deployed, matching the intent described in issue #2796.
Changes:
- Add a dedicated diagnostic subtype/count for “Agent Plugin target excluded” warnings and plumb it into install outcome classification.
- Update the install outcome owner to fail when
installed_count == 0and at least one Agent Plugin was target-excluded. - Expand/adjust unit tests to cover: pure-no-op failure, mixed-batch non-fatal behavior, dry-run preview remaining non-fatal, and the actionable “install via /skills/” hint.
| File | Description |
|---|---|
| tests/unit/install/test_agent_plugin_deployment_boundary.py | Updates and adds regression tests for the new “fail loudly on pure no-op” behavior, including hint wording and dry-run parity. |
| src/apm_cli/utils/diagnostics.py | Extends DiagnosticCollector.warn() with a severity subtype and adds a first-class Agent Plugin target-exclusion warning + counter. |
| src/apm_cli/install/template.py | Builds an actionable skip message (including /skills/<skill> workaround) and records target exclusion using the new diagnostic subtype. |
| src/apm_cli/install/outcome.py | Adds agent_plugin_target_excluded_count() helper and fails the install when exclusion caused a zero-deploy run. |
| CHANGELOG.md | Documents the breaking change and migration guidance under [Unreleased]. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Addresses panel follow-ups to keep Agent Plugin target-exclusion recovery commands pinned to the selected ref, document the breaking no-op contract, and add real CLI lifecycle coverage for total no-op failure plus mixed-install success. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addresses the CI regression from the legacy exit-0 expectation by rewriting the Agent Plugin non-Copilot target test for issue #2796: a total target-exclusion no-op now fails and commits no durable state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Context: Agent Plugins v1.0.0 packages can only register natively with the copilot target today. When every selected target was non-copilot,
apm install --skill ... --target codexskipped the package, deployed nothing, printedNo changes, and exited 0.WHY: A successful no-op hid an unsatisfied install request. The install outcome now fails only when target exclusion leaves the run with zero deployed packages, while mixed installs that deploy at least one package still exit 0.
BREAKING CHANGE:
apm installnow exits non-zero when Agent Plugin target exclusion means no package was deployed. Migration: install a direct skill subpath such asapm install kunchenguid/lavish-axi/skills/lavish#main --target codex, or select--target copilotfor native Agent Plugin registration.Scenario Evidence:
tests/integration/test_required_lifecycle_state_machine.py::test_required_agent_plugin_target_exclusion_noop_fails_without_mutating_stateAPM_E2E_TESTS=1 uv run --extra dev pytest tests/integration/test_required_lifecycle_state_machine.py::test_required_agent_plugin_target_exclusion_noop_fails_without_mutating_state -q->1 passed in 2.50stests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_does_not_hard_fail_when_the_rest_of_the_batch_installsuv run --extra dev pytest tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_hint_names_remote_skill_subpath_form tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_fails_when_no_package_is_deployed tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_does_not_hard_fail_when_the_rest_of_the_batch_installs -q->10 passed in 2.44sHow to test:
uv run --extra dev pytest tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_hint_names_remote_skill_subpath_form tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_fails_when_no_package_is_deployed tests/unit/install/test_agent_plugin_deployment_boundary.py::test_target_exclusion_does_not_hard_fail_when_the_rest_of_the_batch_installs -quv run --extra dev pytest tests/unit/copilot_plugins/test_install_lifecycle.py -qAPM_E2E_TESTS=1 uv run --extra dev pytest tests/integration/test_required_lifecycle_state_machine.py::test_required_agent_plugin_target_exclusion_noop_fails_without_mutating_state -quv run --extra dev ruff check src/ tests/uv run --extra dev ruff format --check src/ tests/Architecture: owner-extension. The deterministic owner-touch gate reports
src/apm_cli/install/outcome.pyunder the canonical decisionInstall success / failure outcome; this PR extends that existing owner with the target-excluded no-deploy failure case while keeping per-package target exclusion detection in the Agent Plugin deployment boundary and diagnostics collector.apm-spec-waiver: APM CLI-specific Agent Plugin target-exclusion UX; OpenAPM manifest and registry semantics are unchanged.
closes #2796