feat(den-api): delete imported plugin components#2606
Draft
reachjalil wants to merge 1 commit into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
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.
Intent
Delete paths deserve a little extra seatbelt, so this PR adds a dedicated plugin
removelifecycle path that cleans up imported plugin components without sweeping up shared resources.When an imported plugin is removed, we want it gone from active Den plugin surfaces and we also want to clean up the Den-managed skill/MCP rows created by that import. The goal is boring-in-a-good-way cleanup: no orphaned Den skills, skill hubs, external MCP connections, access grants, connected accounts, or OAuth client rows, and no surprise deletion of things another active config object still uses.
What changed
POST /v1/plugins/:pluginId/removefor plugin removal.mcpServerspayload shapes.Delete Safety
Since this is a delete flow, the PR intentionally keeps the cleanup narrow:
sourceMode: "import"and object typeskill/mcpare considered for underlying component cleanup.denSkillId.externalMcpConnectionOwnedByPlugin === true.Reviewer Focus
The most important review target is the planner. This is the small gatekeeper that decides what underlying resources are actually safe to delete:
Worth double-checking: the
ownedOnly: trueMCP branch and the active reference checks. That is where the PR avoids turning a plugin delete into a tiny chaos button.Validation
pnpm --filter @openwork-ee/den-api exec bun test test/plugin-system-lifecycle-cleanup.test.ts- passed, 4 testspnpm --filter @openwork-ee/den-api build- passedFraimz/video not captured: this is a backend lifecycle cleanup path with focused unit coverage plus den-api build validation.