Skip to content

feat(admin): add dev-only nuke all button to KiloClaw admin page#1321

Open
RSO wants to merge 1 commit intomainfrom
dev-only-nuke-all
Open

feat(admin): add dev-only nuke all button to KiloClaw admin page#1321
RSO wants to merge 1 commit intomainfrom
dev-only-nuke-all

Conversation

@RSO
Copy link
Contributor

@RSO RSO commented Mar 20, 2026

Summary

Add a "Nuke All" button to the KiloClaw admin instances page that destroys all active KiloClaw instances, including their Fly machines via the worker. The button and its backend endpoint are both gated to development mode only (process.env.NODE_ENV !== 'development').

  • Backend: new devNukeAll mutation on adminKiloclawInstancesRouter that iterates active instances, marks each destroyed in Postgres, then calls client.destroy() on the worker. Uses the same mark-then-revert pattern as the existing single-instance destroy endpoint — if the worker call fails, the DB row is restored so state stays consistent.
  • Frontend: DevNukeAllButton component renders null outside development mode. Shows a destructive button with confirmation dialog. Reports results including any partial failures.

Verification

  • pnpm typecheck — 28 packages pass, 0 failures
  • pnpm format — no formatting issues
  • git push — pre-push hooks (format:check, lint, typecheck) all pass

Visual Changes

N/A

Reviewer Notes

  • The button is tree-shaken from production builds via the process.env.NODE_ENV !== 'development' early return. The server endpoint also hard-gates with the same check and returns FORBIDDEN.
  • The destroy loop is sequential per instance to avoid overwhelming the worker. Each instance is independently mark/destroy/revert so partial failures don't affect other instances.

Add a button (visible only in development mode) to destroy all active
KiloClaw instances, tearing down Fly machines via the worker. Uses the
same mark-then-revert pattern as single-instance destroy to keep DB and
Fly state consistent on partial failures.
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/app/admin/components/KiloclawInstances/KiloclawInstancesPage.tsx
  • src/routers/admin-kiloclaw-instances-router.ts

Reviewed by gpt-5.4-20260305 · 137,263 tokens

@RSO RSO requested a review from a team March 20, 2026 10:42
@RSO RSO enabled auto-merge March 20, 2026 10:43
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