Skip to content

Add admin cleanup: delete tasks and orphaned previews#151

Open
fedacking wants to merge 3 commits intomainfrom
admin-cleanup-delete-tasks
Open

Add admin cleanup: delete tasks and orphaned previews#151
fedacking wants to merge 3 commits intomainfrom
admin-cleanup-delete-tasks

Conversation

@fedacking
Copy link
Copy Markdown
Contributor

Summary

  • Add admin endpoint to cascade-delete a task and all its descendants, including destroying associated agent containers, previews, and optionally remote git branches
  • Add endpoint to list orphaned previews (containers with no corresponding task in the DB)
  • Add Cleanup section to the Admin UI with task deletion (with confirmation dialog) and orphaned preview management

Test plan

  • Verify admin can delete a task and its subtasks are also removed
  • Confirm agent containers and previews are destroyed on task deletion
  • Test the "also delete remote branch" checkbox works correctly
  • Verify orphaned previews are listed and can be individually destroyed
  • Confirm non-admin users cannot access the cleanup endpoints

🤖 Generated with Claude Code

Add cascade task deletion (DELETE /api/admin/tasks/{id}) that destroys
agent containers, previews, optionally remote branches, and all DB
records (logs, messages, actions, transitions) for the task and its
descendants. Add orphaned preview detection (GET /api/admin/cleanup/
orphaned-previews) that finds containers with no matching DB task.

Frontend adds a Cleanup section to the Admin page with task and
orphaned preview tables, confirmation dialogs, and a danger zone banner.
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