feat(admin): add stopped status to KiloClaw instances view#1458
Merged
jeanduplessis merged 2 commits intomainfrom Mar 24, 2026
Merged
feat(admin): add stopped status to KiloClaw instances view#1458jeanduplessis merged 2 commits intomainfrom
jeanduplessis merged 2 commits intomainfrom
Conversation
Join kiloclaw_subscriptions to surface suspended_at in the admin instance list, enabling a tri-state status: Active, Stopped, Destroyed. - Add stopped filter option and amber badge in instance table - Add Stopped Instances stats card to overview dashboard - Update active filter to exclude suspended instances
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)N/A Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 357,812 tokens |
pandemicsyn
approved these changes
Mar 24, 2026
Contributor
pandemicsyn
left a comment
There was a problem hiding this comment.
lgtm, one question in line, but good to go either way.
Aligns the UI terminology with the underlying suspended_at field and avoids confusion with the machine-level 'stopped' worker state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The KiloClaw admin dashboard at
/admin/kiloclawonly showed two instance states: Active and Destroyed. When the billing lifecycle cron stops a machine (trial expiry, subscription cancellation, past-due), the instance enters an invisible limbo — still marked "active" in the DB but with its machine stopped and subscription suspended. Admins had no way to distinguish these from truly running instances.Solution
kiloclaw_subscriptionsin the adminlist,get, andstatsendpoints to surfacesuspended_atalongside instance data.destroyed_atandsuspended_at.destroyed_at IS NULL AND suspended_at IS NULL).suspended_atalready exists onkiloclaw_subscriptionswith a unique constraint onuser_id, making the LEFT JOIN 1:1 and safe.Why this approach
The alternative was adding an explicit
statuscolumn tokiloclaw_instances, but that would require a migration, backfill, and keeping it in sync with the billing lifecycle cron that already managessuspended_aton the subscription table. Deriving the state from a JOIN avoids data duplication and is consistent with how the billing system already models suspension.Verification
pnpm typecheck— passed (all 30 workspace projects)pnpm lint(via pre-commit hook) — passedpnpm format:check(via pre-commit hook) — passedVisual Changes
All changes are on the
/admin/kiloclawpage:Overview stats cards (top of page)
suspended_at IS NOT NULLand subtitle "Suspended by billing lifecycle".Status filter dropdown
Instance table status badge
destroyed_atis null but the subscription'ssuspended_atis set (billing lifecycle has stopped the machine).Reviewer Notes
kiloclaw_subscriptions.user_idcolumn has a UNIQUE constraint, so the LEFT JOIN cannot produce duplicate rows. If the future multi-instance-per-user model changes this, the join will need to be updated.suspended_at = nullfrom the LEFT JOIN, correctly mapping to "Active" status.activefilter now excludes suspended instances — this is a behavioral change for anyone relying on the "Active Only" filter to include suspended instances.