fix(claw): allow instance destroy without active subscription#1279
Merged
jeanduplessis merged 2 commits intomainfrom Mar 20, 2026
Merged
fix(claw): allow instance destroy without active subscription#1279jeanduplessis merged 2 commits intomainfrom
jeanduplessis merged 2 commits intomainfrom
Conversation
Change the destroy endpoint from clawAccessProcedure to baseProcedure so users with expired trials or subscriptions can still destroy their running instance. Add a two-step 'Destroy Instance' confirmation button to AccessLockedDialog for trial_expired/subscription_expired states. Clear suspended_at and destruction_deadline after successful destroy so the billing cron doesn't send redundant warnings.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 498,546 tokens |
RSO
approved these changes
Mar 20, 2026
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
Users whose trial or subscription has expired but whose KiloClaw instance is still alive were unable to destroy their instance — the
destroyendpoint requiredclawAccessProcedure, which gates on active billing. This change:destroyfromclawAccessProceduretobaseProcedureso any authenticated user can destroy their instance regardless of billing state.AccessLockedDialogfortrial_expired_instance_aliveandsubscription_expired_instance_alivelock states.suspended_atanddestruction_deadlineon the subscription row after a successful destroy, preventing the billing cron from sending redundant destruction-warning emails or attempting a duplicate destroy.Verification
pnpm typecheck— passpnpm lint— pass (via pre-push hook)pnpm format:check— pass (via pre-push hook)Visual Changes
The dialog change adds a "Destroy Instance" link button below the subscribe/payment CTA. Clicking it reveals a two-step confirmation with a red "Yes, destroy" button and a "Cancel" button. The destroy button shows a loading state while the mutation is in-flight.
Reviewer Notes
destroyendpoint now usesbaseProcedure(auth-only, no billing gate). This is intentional — users should always be able to tear down their own instance. ThemarkActiveInstanceDestroyed/restoreDestroyedInstancerollback pattern is preserved.suspended_at,destruction_deadline) after destroy prevents the billing lifecycle cron from racing against the user-initiated destroy.