Skip to content

Comments

feat(kiloclaw): add remote OpenClaw Doctor, rename Restart Gateway to Redeploy#424

Merged
pandemicsyn merged 2 commits intomainfrom
florian/feat/doctor
Feb 20, 2026
Merged

feat(kiloclaw): add remote OpenClaw Doctor, rename Restart Gateway to Redeploy#424
pandemicsyn merged 2 commits intomainfrom
florian/feat/doctor

Conversation

@pandemicsyn
Copy link
Contributor

Summary

  • Add OpenClaw Doctor button to the claw dashboard that remotely runs openclaw doctor --fix --non-interactive on the user's Fly Machine
  • Rename "Restart Gateway""Redeploy" to better reflect actual behavior (stops machine, updates config, starts)
  • Collapse changelog to show 4 most recent entries with a "See more" toggle

Changes

Worker (kiloclaw/)

  • KiloClawInstance.runDoctor() — new DO method, execs openclaw doctor --fix --non-interactive via Fly Machines exec API (60s timeout)
  • POST /api/platform/doctor — new platform route, always returns 200 with { success, output }

Next.js

  • DoctorResponse type, KiloClawInternalClient.runDoctor(), tRPC runDoctor mutation
  • useKiloClawMutations().runDoctor hook
  • RunDoctorDialog — modal that fires the mutation on open, shows spinner while pending, displays ASCII output in a read-only monospace textarea with pass/fail indicator
  • InstanceControls — renamed Redeploy, added cyan OpenClaw Doctor button (gated on status === 'running')
  • ChangelogCard — shows first 4 entries, "See more (N older)" toggle for the rest

Auth

Same gate as all claw operations: baseProcedure (authenticated) → kiloclawProcedure (kiloclaw feature flag) → internal API key → DO scoped to user

… Redeploy

- Add runDoctor() DO method to exec 'openclaw doctor --fix --non-interactive' on the Fly Machine
- Add POST /api/platform/doctor worker route
- Wire through internal client, tRPC router, and React hook
- Add RunDoctorDialog: modal with read-only monospace textarea for ASCII output
- Rename 'Restart Gateway' button to 'Redeploy'
- Collapse changelog to 4 most recent entries with 'See more' toggle
- Add changelog entry for doctor feature and rename
@pandemicsyn pandemicsyn marked this pull request as ready for review February 20, 2026 20:01
}
if (!open) {
hasFired.current = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Stale result flashes on reopen

When the dialog is closed and reopened, mutation.data from the previous run persists. The result && !isPending check on line 72 will briefly render the old output before the new mutation sets isPending = true.

Call mutation.reset() when the dialog closes to clear stale state:

Suggested change
}
hasFired.current = false;
mutation.reset();

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 20, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/app/(app)/claw/components/InstanceControls.tsx 71 WARNING: Toast message still says 'Gateway restarting' but the button was renamed from "Restart Gateway" to "Redeploy". Should update to e.g. 'Redeploying gateway' or 'Redeploy initiated' for consistency.
Files Reviewed (10 files)
  • kiloclaw/src/durable-objects/kiloclaw-instance.ts - 0 issues
  • kiloclaw/src/routes/platform.ts - 0 issues
  • src/app/(app)/claw/components/ChangelogCard.tsx - 0 issues
  • src/app/(app)/claw/components/InstanceControls.tsx - 1 issue (not in diff)
  • src/app/(app)/claw/components/RunDoctorDialog.tsx - 0 issues
  • src/app/(app)/claw/components/changelog-data.ts - 0 issues
  • src/hooks/useKiloClaw.ts - 0 issues
  • src/lib/kiloclaw/kiloclaw-internal-client.ts - 0 issues
  • src/lib/kiloclaw/types.ts - 0 issues
  • src/routers/kiloclaw-router.ts - 0 issues

Fix these issues in Kilo Cloud

@pandemicsyn pandemicsyn merged commit 43de82f into main Feb 20, 2026
12 checks passed
@pandemicsyn pandemicsyn deleted the florian/feat/doctor branch February 20, 2026 21:12
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.

2 participants