Allow failed runs to always be deleted

Failed runs have no output to protect, so they can be deleted
without checking L2 shared status or activity records.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-08 01:48:23 +00:00
parent 0e4f596401
commit 6142c8bbab

View File

@@ -406,6 +406,8 @@ async def discard_run(run_id: str, username: str = Depends(get_required_user)):
if run.username not in (username, actor_id):
raise HTTPException(403, "Access denied")
# Failed runs can always be deleted (no output to protect)
if run.status != "failed":
# Check if activity exists for this run
activity = cache_manager.get_activity(run_id)