Skip to content

🗑️ feat: Expose Skill Deletion in Management API - #17005

Merged
dustinhealy merged 6 commits into
feat/agent-management-skill-file-crudfrom
feat/agent-management-skill-delete
Oct 16, 2026
Merged

dustinhealy merged 6 commits into
feat/agent-management-skill-file-crudfrom
feat/agent-management-skill-delete

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The machine-authenticated Skills management API can create and update Skills, but it cannot delete a whole Skill. Callers must switch to the browser API to complete that lifecycle. This PR adds DELETE /api/agents/v1/skills/{id} for inline Skills, using the existing browser deletion handler and requiring the same DELETE resource permission, Skills mutation role permissions, and tenant boundary as other management mutations.

This PR is stacked on #16878 and should be retargeted to dev after that PR merges. A follow-up PR will add durable deletion cleanup; merge both before including this route in a release.

How it works

OIDC management request
  -> Skills mutation and tenant checks
  -> DELETE resource permission
  -> existing Skill deletion handler
  -> normalized { id, deleted, cleanupComplete } response

The handler retains its current cleanup behavior. A response with cleanupComplete: false means the Skill was removed but dependent cleanup did not finish; this PR does not add durable cleanup retries.

Type of change

  • Feature
  • Tests / tooling / CI

Testing

Tested environments/configuration: Local Node workspace with the repository's disposable MongoDB test server and machine-authenticated contract fixture.

Automated tests: Focused management handler, Express route, and HTTP contract tests; npx tsc --noEmit in the changed TypeScript workspaces; openapi:check; affected static checks; Lighthouse on port 3098 (passed, median LCP 3.61 s against the 4.5 s budget). The first Lighthouse attempt could not start because port 3080 was occupied.

Screenshots / recordings

No user-facing UI change.

Risk / compatibility

This adds a management route without changing the underlying cleanup semantics or adding a migration. Only inline Skills can be mutated through this API. The known incomplete-cleanup result remains visible to callers and is documented rather than being presented as a guaranteed retry. The dependent durable-cleanup PR must be merged before a release containing this route is deployed; old instances and in-flight uploads should be drained before invoking whole-Skill deletion through the management API.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published — 🧩 feat: Add Skill Creation and File Deletion to Management API #16878 remains open
  • Required documentation PR: N/A (the in-repository API contract document is updated)

@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T17:10:26.327280Z 6c2a94b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ebf9d9053

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/api/src/skills/management.ts
@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 5a17bc452c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: c22f8477dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Skills UI codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 12, 2026
@dustinhealy
dustinhealy added this pull request to stack #17039 October 13, 2026 00:14
@dustinhealy
dustinhealy removed this pull request from stack #17039 October 13, 2026 02:44
@dustinhealy
dustinhealy added this pull request to stack #17045 October 13, 2026 02:44
@dustinhealy
dustinhealy force-pushed the feat/agent-management-skill-delete branch from c22f847 to 9483cd7 Compare October 13, 2026 02:56
Copilot AI balanced review requested due to automatic review settings October 13, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The OpenAPI response incorrectly makes the guaranteed cleanupComplete field optional.

1 open finding
What changed in this PR

Adds machine-authenticated whole-Skill deletion with existing authorization, tenant isolation, and cleanup behavior.

Changes:

  • Adds and documents DELETE /api/agents/v1/skills/{id}.
  • Normalizes deletion responses and hides storage details.
  • Adds handler, routing, authorization, and OpenAPI contract tests.
File Description
packages/​api/​src/​skills/​management.ts Adds authorized deletion adapter and response schema.
packages/​api/​src/​skills/​management.spec.ts Tests deletion, permissions, isolation, and cleanup responses.
packages/​api/​src/​openapi/​skills.ts Registers the deletion contract.
packages/​api/​openapi/​agents.openapi.json Adds generated endpoint and response definitions.
docs/​skills-management-api.md Documents deletion and incomplete cleanup behavior.
api/​server/​routes/​agents/​skills.js Registers the DELETE route.
api/​server/​routes/​agents/​__tests__/​skills.spec.js Tests route dispatch and authentication ordering.
api/​server/​routes/​agents/​__tests__/​openapi.contract.spec.js Validates the live HTTP deletion contract.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/api/src/skills/management.ts Outdated
@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c2a94b038

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/server/routes/agents/skills.js
@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 6c2a94b038

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dustinhealy
dustinhealy marked this pull request as ready for review October 13, 2026 20:17
@dustinhealy
dustinhealy force-pushed the feat/agent-management-skill-delete branch from 6c2a94b to 226522d Compare October 16, 2026 13:55
@dustinhealy
dustinhealy force-pushed the feat/agent-management-skill-delete branch from 226522d to 9fdaef1 Compare October 16, 2026 14:27
@dustinhealy
dustinhealy merged commit ec587c2 into dev Oct 16, 2026
50 of 82 checks passed
@dustinhealy
dustinhealy deleted the feat/agent-management-skill-delete branch October 16, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Skills UI codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants