Skip to content

feat: Add API support for deleting local benchmark runs#16

Open
GO1984 wants to merge 1 commit into
outsourc-e:mainfrom
GO1984:feature/delete-local-runs
Open

feat: Add API support for deleting local benchmark runs#16
GO1984 wants to merge 1 commit into
outsourc-e:mainfrom
GO1984:feature/delete-local-runs

Conversation

@GO1984
Copy link
Copy Markdown

@GO1984 GO1984 commented Jun 1, 2026

Summary

Adds a local dashboard API endpoint to delete persisted benchmark runs from disk.

Changes

  • Add DELETE /api/benchmark/runs/{run_id}.
  • Delete only direct child directories under ~/.bench-loop/runs/.
  • Reject path traversal attempts.
  • Return 404 when the run does not exist.
  • Return 409 when the run is still active/running.
  • Remove completed/failed/cancelled runs from in-memory active state after deletion.
  • Add tests for successful deletion, missing runs, active runs, and path traversal.

Why

BenchLoop can currently list and inspect local runs, including partial and failed runs, but users have no API-backed way to delete a single stored run. This forces manual filesystem cleanup.

This endpoint provides the backend support needed for a dashboard delete action.

Validation

uv run --extra dev pytest tests
14 passed

Related frontend PR

A matching UI change is available in bench-loop-web:

outsourc-e/bench-loop-web#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant