[PR #396] [MERGED] feat: add DELETE /snapshots/{snapshotID} endpoint #402

Closed
opened 2026-10-29 14:23:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/396
Author: @guozy18
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @yingdi-shan

Base: main ← Head: sync/snapshot-delete-api


📝 Commits (1)

  • 8c591bd feat: add DELETE /snapshots/{snapshotID} endpoint

📊 Changes

6 files changed (+237 additions, -1 deletions)

View changed files

📝 docs/src/concepts/snapshots/manage.md (+10 -0)
📝 src/api/generated/src/apis/snapshots.rs (+25 -0)
📝 src/api/generated/src/models.rs (+6 -0)
📝 src/api/generated/src/server/mod.rs (+138 -1)
📝 src/api/impls/snapshots.rs (+38 -0)
📝 src/api/openapi.yml (+20 -0)

📄 Description

What

Add DELETE /snapshots/{snapshotID} for sandbox-sourced snapshots, accepting either an ID or alias.

Why

Sandbox snapshots currently require the template deletion API despite having dedicated list/get endpoints.

N/A — focused synchronization of an existing implementation.

Scope and non-goals

OpenAPI schema and regenerated server, snapshot handler, and endpoint documentation.

Design and behavior changes

Resolve the supplied reference, reject template records, and delete through SnapshotManager using the resolved immutable ID. Return 204 on success and 404 for missing/deleted/template records. Use the current main-branch security schemes. Generated code was produced through make agentenv-server.

Compatibility and operations

  • Public API or generated protocol: Additive DELETE endpoint. Existing template deletion remains available.
  • Configuration or defaults: No configuration changes.
  • Snapshot manifest, artifact layout, or storage format: unchanged.
  • Upgrade and rollback: ordinary code upgrade/revert; no data migration.
  • Host requirements, permissions, ports, or dependencies: unchanged.

Validation

Validated on upstream main 949cec2 plus this single commit, independently of the other synchronization PRs.

PASS: make fmt
PASS: cargo clippy --locked -p agentenv --all-targets --all-features -- -D warnings
PASS: cargo test --locked -p agentenv --lib snapshot::catalog::tests (9 tests)
PASS: cargo test --locked -p agentenv --lib snapshot::backends::tests (10 tests)
PASS: make agentenv-server (Linux; normalized with the local repository formatter)
PASS: regenerated tracked files match the commit after formatting
PASS: git diff --check

Clippy and all 19 catalog/backend tests ran on Linux as a non-root user. Full workspace and HTTP/VM E2E suites were not run for this isolated branch.

Risks and reviewer notes

Deletion delegates to existing repository cleanup. Existing catalog/backend tests cover repository deletion and publication; a full HTTP deletion E2E was not run for this PR.

The original author, author date and commit message are preserved. Main-branch adaptations are described above.

Checklist

  • One coherent change with no unrelated refactors.
  • Validation scope and execution limitations are stated.
  • No credentials or private deployment configuration included.
  • Generated code, where changed, was regenerated from the updated schema.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/396 **Author:** [@guozy18](https://github.com/guozy18) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `sync/snapshot-delete-api` --- ### 📝 Commits (1) - [`8c591bd`](https://github.com/kvcache-ai/AgentENV/commit/8c591bd4eb840947053a1fb747b506e39afd7dfa) feat: add DELETE /snapshots/{snapshotID} endpoint ### 📊 Changes **6 files changed** (+237 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/src/concepts/snapshots/manage.md` (+10 -0) 📝 `src/api/generated/src/apis/snapshots.rs` (+25 -0) 📝 `src/api/generated/src/models.rs` (+6 -0) 📝 `src/api/generated/src/server/mod.rs` (+138 -1) 📝 `src/api/impls/snapshots.rs` (+38 -0) 📝 `src/api/openapi.yml` (+20 -0) </details> ### 📄 Description ## What Add DELETE /snapshots/{snapshotID} for sandbox-sourced snapshots, accepting either an ID or alias. ## Why Sandbox snapshots currently require the template deletion API despite having dedicated list/get endpoints. ## Related issue N/A — focused synchronization of an existing implementation. ## Scope and non-goals OpenAPI schema and regenerated server, snapshot handler, and endpoint documentation. ## Design and behavior changes Resolve the supplied reference, reject template records, and delete through SnapshotManager using the resolved immutable ID. Return 204 on success and 404 for missing/deleted/template records. Use the current main-branch security schemes. Generated code was produced through make agentenv-server. ## Compatibility and operations - Public API or generated protocol: Additive DELETE endpoint. Existing template deletion remains available. - Configuration or defaults: No configuration changes. - Snapshot manifest, artifact layout, or storage format: unchanged. - Upgrade and rollback: ordinary code upgrade/revert; no data migration. - Host requirements, permissions, ports, or dependencies: unchanged. ## Validation Validated on upstream main `949cec2` plus this single commit, independently of the other synchronization PRs. ```text PASS: make fmt PASS: cargo clippy --locked -p agentenv --all-targets --all-features -- -D warnings PASS: cargo test --locked -p agentenv --lib snapshot::catalog::tests (9 tests) PASS: cargo test --locked -p agentenv --lib snapshot::backends::tests (10 tests) PASS: make agentenv-server (Linux; normalized with the local repository formatter) PASS: regenerated tracked files match the commit after formatting PASS: git diff --check ``` Clippy and all 19 catalog/backend tests ran on Linux as a non-root user. Full workspace and HTTP/VM E2E suites were not run for this isolated branch. ## Risks and reviewer notes Deletion delegates to existing repository cleanup. Existing catalog/backend tests cover repository deletion and publication; a full HTTP deletion E2E was not run for this PR. The original author, author date and commit message are preserved. Main-branch adaptations are described above. ## Checklist - [x] One coherent change with no unrelated refactors. - [x] Validation scope and execution limitations are stated. - [x] No credentials or private deployment configuration included. - [x] Generated code, where changed, was regenerated from the updated schema. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:23:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#402
No description provided.