Delete a Skill with its only remaining version - #56
Merged
Merged
Conversation
Deleting the default version is still rejected while other versions remain. When the default is the Skill's only version, the delete now removes the Skill under the existing owner row lock through the skills.delete cascade, as the official service does (SFT-01). Real-PostgreSQL tests cover atomic removal without orphaned encrypted rows, unchanged frozen Session contents and Template intent, and both lock orders of a concurrent upload.
Document the deletion rules on the handler and regenerate the OpenAPI schema. A real HTTP and PostgreSQL test covers V1 to V4 across two tenants, and the pinned-SDK Skills acceptance checks the observed deleted-version body and the Skill's disappearance.
Add the SFT-01 behavior to the File and Skill resource semantics, keep immutable version numbers as an intentional difference (SFT-02) and record SFT-03 as an upstream anomaly that Core never emulates. Update operation evidence rows 52 and 57 and the stale Template gap sentence.
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.
Deleting a Skill's only remaining version used to return 400 (
invalid_value, the default version cannot be deleted). The official service deletes that version and removes the Skill. This batch aligns that case. The pinned baseline is unchanged (SDK 3.13.0 / d7c41ef /agents=v1).Behavior
DELETE /v1/skills/{id}/versions/{v}, whenvis the only remaining version (and therefore the default), returns the officialskill.version.deletedbody. The Skill and its encrypted version rows are removed in the same transaction, under the existing Skill row lock. Skill and version reads then return 404 and the list omits the Skill. Frozen Session and Template snapshots keep their committed contents, just as withskills.delete.Evidence
Campaign scan 1 finding SFT-01, from owned official Skill requests (all deleted). Recorded in
contracts/agents-api/file-resource-semantics.mdandoperation-evidence.mdrows 52 and 57.Validation
Independent coordinator replay: a real Core with PostgreSQL, over raw HTTP. On main
beb18fd, deleting the sole version returned 400 and the Skill remained. On this batch, it returned 200 with body fields equal to the official record; the Skill, its version and its list entry were gone; a repeated delete returned 404; the default-with-others 400 was unchanged; and a foreign Skill got the same response as a missing one.Real-PostgreSQL store tests:
HTTP tests cover two tenants. The pinned-SDK
official_skills.pypasses.Integration: rebased onto main
e3d6b95(Add Runtime observability and lightweight PostgreSQL history #30, feat: manage hosted sandboxes across local and remote nodes #46); the patch series is unchanged andmake openapiis byte-identical. The later main commits Add Session runtime metrics tab #51 and docs: add OpenAgentCore branding and README banner #54 touch no files of this batch.Server gate on this head:
make -o check-web checkplus Web typecheck, core-doctor, unit tests and the build all pass. The Playwright browser cases were not run on the server (no Google Chrome; skip approved by the user).make openapiis byte-identical.No live model run: this is a resource-level change.
Independent focused review by a fresh Claude Code subagent: no blockers. It probed concurrent deletes, default updates and Session creation races. Its doc follow-ups are in the last commit, which is docs only.
Deferred
skills.delete. The official behavior is unobserved.No full protocol compatibility is claimed.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.