feat(kiloclaw) Admin tools for bulk version deployments#2975
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Resolved Previous Findings (2)
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by gpt-5.5-20260423 · 778,977 tokens |
pandemicsyn
approved these changes
Apr 30, 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
Adds bulk version change for kiloclaw instances on the admin instances page. Admins can filter the list by current running version, select multiple rows, and apply a version change synchronously across the selection. Builds on the
tracked_image_tagcolumn landed in PR #2942 (populated by the DO alarm reconciler).Backend (
apps/web/src/routers/admin-kiloclaw-instances-router.ts)bulkChangeVersionadmin tRPC mutation. Validates the target image tag against the catalog (rejects unknown and disabled tags), partitions the selection into applied / skipped / failed, applies in parallel with bounded concurrency of 10 viaPromise.allSettled. Per call ceiling 500 instances. Three predicate atomic delete (instance_id + id + updated_at) on pin override, mirroring the single instance restartMachine. DO state synced to the cleared pin via the existingpushPinToWorkerhelper.destroyed,pinned_by_user,pinned_by_admin,already_on_target. Failed entries surface per row with the underlying error.kiloclaw.instances.bulk_change_versionaction records actor, target tag, override flag, and the partitioned instance ids inmetadata.listandgetprocedures extended with new output fields:tracked_image_tagandpin: { image_tag, pinned_by_user_id, is_admin_pin } | null.listaccepts a new optionalimageTagfilter input with sentinel__unknown__for null tracked image tags.Frontend
KiloclawInstancesPage.tsx): version filter dropdown populated fromlistVersions, checkbox column with select all visible (with indeterminate state when only some visible rows are checked), bulk action toolbar shown when selection is non empty (with a discoverable empty state hint when the selection is empty), Pin column with the canonical translucent /20 badge pattern, Version column pairing the openclaw_version (semver) with the image_tag (technical id) using a memoized lookup against the already fetched catalog.BulkChangeVersionDialog.tsx: selection summary derived from visible rows, target version select with rich two tone display in the dropdown list (preserved on the trigger via RadixtextValue), Override Existing Pins toggle with typed confirm gate, destructive Alert callout warning that the action runs immediately with no user notice and interrupts active sessions, result panel partitioned into Applied / Skipped (grouped by reason) / Failed sections with copy ids buttons.User · Version · Pin · Subscription · Status · Created · Sandbox ID · Destroyed. Sandbox ID demoted (muted, mono, text-xs, max width 110px). Type column dropped to reduce density.design.md: six chunky stat cards collapsed into a single Card with horizontal pills using the eyebrow typography ramp, daily chart slimmed into a tighter Card with inline legend, Search button demoted from yellow primary to secondary so the bulk Change Version CTA is the page's earned primary action.bg-{color}-500/20 text-{color}-400 ring-1 ring-{color}-500/20 border-transparenttranslucent pattern.Checkboxwrapper extended to acceptchecked: boolean | 'indeterminate'. Native HTML checkboxes expose indeterminate only as a DOM property, applied imperatively via ref.Schema
packages/db/src/schema-types.ts: addedkiloclaw.instances.bulk_change_versionto theKiloClawAdminAuditActionZod enum.tracked_image_tagcolumn landed in PR Kiloclaw tracked image tag #2942.Verification
(unknown), all), selection persistence across filter changes, FORBIDDEN guard for non admin caller, single instance happy path, multi instance happy path, user pin skip and override, admin pin skip and override, already on target (UI exclude path), destroyed instance skip, dialog UI edge cases (older version advisory, typed confirm case sensitivity, mid flight cancel disabled, dialog reset on reopen). State verified via direct queries against the local postgres container after each mutating step.pnpm run format:checkclean.pnpm run lint(oxlint) clean.pnpm --filter web typecheckclean.pnpm --filter web test admin-kiloclaw-instances-routerpasses 58 of 58. 12 new tests forbulkChangeVersioncover FORBIDDEN, Zod validation (empty, oversized, malformed), BAD_REQUEST for unknown and disabled tags, mixed batch partitioning, override semantics on user and admin pins, per instance failure isolation viamockResolvedValueOnce/mockRejectedValueOnce,not_foundsurfacing for non existent instance ids, and audit log emission.Visual Changes
N/A
Reviewer Notes
max(500)cap oninstanceIdsreflects the per page UI selection model. If a future select all across pages feature lands, revisit.detectOrphansat line ~1832), notp-limit. Same effective bound, lower friction precedent.RouterOutputstypes.