Skip to content

Status: count plugins that fail to resolve as install failures - #358

Merged
Minitour merged 3 commits into
developfrom
fix/status-plugin-resolve-failures
Oct 23, 2026
Merged

Minitour merged 3 commits into
developfrom
fix/status-plugin-resolve-failures

Conversation

@Minitour

Copy link
Copy Markdown
Member

Summary

Found while verifying the v2.4.0 release (#351) locally. When one plugin failed to resolve and the others resolved, capa install only printed a warning. The failure wasn't recorded, so capa status showed "✓ Installed" and --strict exited 0.

What changed

  • reportPluginResults (install-tasks/resolve-plugins.ts) takes over the result handling from the resolve-plugins task:
    • Each plugin that failed to resolve is recorded as an install failure, the same way a failed skill is. The other plugins still install.
    • capa status then reports "Installed, with problems" with the error, --strict exits 1, and the install summary counts it as failed. Under onInstallError: stop, install exits non-zero at the end, as it does for a failed skill.
    • The failure is reported once. Before, when every plugin failed, the same message was printed twice: once as a warning and once as the failure.
  • It's a separate function so it can be tested without mocking resolvePlugins.

Screenshots / logs

Release build, a project with five plugins where glab fails on Windows (symlinks without Developer Mode):

Before:

✓ Done in 21.2s · 38 added · 74 skipped
Status: ✓ Installed            (status --strict exit 0)

After:

✓ Done in 11.7s · 38 added · 1 failed · 74 skipped
Status: ⚠ Installed, with problems            (status --strict exit 1)

Test plan

  • reportPluginResults tests: a partial failure is counted and reported once; all plugins failing returns false with one message; a clean resolve is untouched; stop mode records an error.
  • Re-ran the five-plugin project against a release build: summary, status and status --strict as shown above.
  • bunx tsc --noEmit; the CLI suite has no assertion failures (only the known Windows EBUSY/EPERM temp cleanup).
  • Not changed: passthrough installs, which don't record install state for status.

Checklist

  • Tests added or updated
  • bunx tsc --noEmit passes
  • Docs updated (if user-facing): not needed

🤖 Generated with Claude Code

With other plugins resolving, the failure was only a warning, so capa
status showed Installed and --strict exited 0. It is now recorded like a
failed skill, and reported once instead of twice when every plugin fails.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Count plugin resolution failures as install failures

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Record skipped plugins that fail to resolve as install failures, even when other plugins succeed.
• Show those failures in install summaries and status, and make strict status fail.
• Avoid duplicate failure warnings and test partial, complete, clean, and stop-mode results.
Diagram

graph TD
  A["Plugin resolver"] --> B["Result reporter"] --> C{"All failed?"}
  C -- "Yes" --> D["Raise failure"] --> F["Install state"] --> G["Status and strict"]
  C -- "No" --> E["Record failures"] --> F
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Return structured plugin outcomes
  • ➕ Avoids identifying failures by matching warning text.
  • ➕ Makes individual plugin outcomes explicit to callers.
  • ➖ Requires a broader change to the resolver result contract and its callers.

Recommendation: Use the PR's focused result handler for this fix: it reuses the existing install failure policy and preserves partial installs. Consider structured resolver outcomes if other callers need to distinguish failures from warnings; the current message match depends on warning wording.

Files changed (2) +71 / -13

Bug fix (1) +22 / -13
resolve-plugins.tsRecord skipped plugin resolutions as install failures +22/-13

Record skipped plugin resolutions as install failures

• Extracts resolver-result handling into 'reportPluginResults'. It records each failed plugin through the install failure policy, preserves unrelated warnings and partial installs, and avoids adding the same failure as both an ordinary warning and a failure.

src/cli/commands/install-tasks/resolve-plugins.ts

Tests (1) +49 / -0
resolve-plugins.test.tsTest plugin resolution result reporting +49/-0

Test plugin resolution result reporting

• Adds focused tests for partial and complete resolution failure, clean resolution, and stop-mode error recording. The partial-failure test checks that the failure is counted and reported once.

src/cli/commands/install-tasks/tests/resolve-plugins.test.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Valid plugins can count as failed installs ✓ Resolved
Description
reportPluginResults treats any warning containing failed to resolve and was skipped as a
plugin-resolution failure, even when the warning came from a successfully resolved plugin's
manifest. If an Agent Plugins mcp.json has an unknown field with that name, its non-fatal warning
increments the install failure count and makes strict status report a problem despite the plugin
resolving.
Code

src/cli/commands/install-tasks/resolve-plugins.ts[22]

+  const failures = pluginWarnings.filter((w) => w.includes('failed to resolve and was skipped'));
Evidence
The MCP parser puts unknown top-level field names into a non-fatal warning. Plugin resolution
forwards manifest warnings after adding the plugin to resolvedPlugins; the new substring filter
then records a matching warning as a failure, and recordInstallFailure increments the failure
count.

src/shared/plugin-manifest/agent-plugins-parser.ts[307-316]
src/shared/plugin-manifest/agent-plugins-parser.ts[342-350]
src/cli/commands/plugin-install.ts[711-726]
src/cli/commands/install-tasks/resolve-plugins.ts[21-30]
src/cli/commands/install-tasks/install-error-policy.ts[27-35]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`reportPluginResults` identifies failed plugins by searching warning text, so unrelated warnings containing the same phrase become install failures.
## Fix Focus Areas
- src/cli/commands/install-tasks/resolve-plugins.ts[21-30]
- src/cli/commands/plugin-install.ts[1077-1081]
- src/cli/commands/plugin-install.ts[1136-1137]
## Recommended Fix
Have `resolvePlugins` return structured per-plugin resolution failures separately from ordinary warnings. Record only those failures in `reportPluginResults`, while preserving all non-fatal warnings as warnings.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/cli/commands/install-tasks/resolve-plugins.ts Outdated
resolvePlugins now returns failures alongside warnings. The install
task and passthrough install use that list, so a warning from a plugin
that resolved can't count as a failure because of its text.
Plugin resolve failures: structured list instead of text match
@Minitour
Minitour merged commit 524ba88 into develop Oct 23, 2026
8 checks passed
@Minitour Minitour mentioned this pull request Oct 23, 2026
8 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant