fix(plugin): isolate per-skill reattach failures + surface degraded plugins (#496) - #509
Draft
TYRMars wants to merge 1 commit into
Draft
fix(plugin): isolate per-skill reattach failures + surface degraded plugins (#496)#509TYRMars wants to merge 1 commit into
TYRMars wants to merge 1 commit into
Conversation
…lugins (#496) `#reattachOne` iterated a plugin's skills with no per-skill error guard, and the MCP-server loop ran after it. On restart, one unreadable/unparseable SKILL.md threw, aborting the rest of that plugin's reattach — every sibling skill AND every MCP server the plugin declares. `reattachInstalled` swallowed the rejection with a bare `.catch(() => {})`, so the failure was completely silent while `GET /v1/plugins` kept reporting the plugin as fully healthy (the ledger, not live state, backs that response). - Wrap each skill's reattach in its own try/catch: a bad skill is recorded and skipped, so it can't take out sibling skills or the MCP servers below it (matches `SkillCatalog.scanRoot` and the MCP loop's own best-effort intent). - Record MCP add failures instead of silently swallowing them. - Add `degraded` / `last_error` to the ledger entry, recomputed on every reattach (cleared on a clean pass). `reattachInstalled` now records a manifest read/parse failure onto the entry too, so a partially-reattached plugin stops reporting as fully installed. Both fields flow through `list()`/`get()` to `GET /v1/plugins` and the web client type. - Tests: broken-skill isolation, failed-MCP degradation, and stale-flag clearing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EHctPZgnTPnPvzQUHCWNzC
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.
Summary
Fixes #496.
PluginManager.#reattachOneiterated a plugin's skills with no per-skill error guard, and the MCP-server loop ran after it. On server restart, one unreadable or unparseableSKILL.mdthrew and aborted the rest of that plugin's reattach — every sibling skill and every MCP server the plugin declares.reattachInstalledthen swallowed the rejection with a bare.catch(() => {}), and the package keeps no logger, so the failure was completely silent. Worse,GET /v1/pluginskept reporting the plugin as fully installed, because that response is backed by the ledger, not live state.Changes
packages/plugin/src/manager.ts): each skill's reattach is wrapped in its owntry/catch. A badSKILL.mdis recorded and skipped so it can no longer take out sibling skills or the MCP servers below it — matchingSkillCatalog.scanRootand the MCP loop's own best-effort intent..catch(() => {}).degraded/last_errorfields to theInstalledPluginledger entry. They're recomputed on every reattach (cleared on a clean pass), andreattachInstalledalso records a manifest read/parse failure onto the entry. Both fields flow throughlist()/get()toGET /v1/plugins(and theapps/jarvis-webclient type), so a partially-reattached plugin stops reporting as fully healthy.Testing
pnpm --filter @jarvis/plugin test(17/17) andtypecheckpass; the changed files lint clean. New tests cover:degraded+last_errornaming the bad skill;degradedwithout aborting the skill reattach;degradedflag is cleared once the plugin becomes healthy again.🤖 Generated with Claude Code
https://claude.ai/code/session_01EHctPZgnTPnPvzQUHCWNzC
Generated by Claude Code