Skip to content

fix(kiloclaw): avoid controller probes for stopped runtimes#3144

Merged
pandemicsyn merged 3 commits intomainfrom
florian/fix/admin-wake
May 8, 2026
Merged

fix(kiloclaw): avoid controller probes for stopped runtimes#3144
pandemicsyn merged 3 commits intomainfrom
florian/fix/admin-wake

Conversation

@pandemicsyn
Copy link
Copy Markdown
Contributor

@pandemicsyn pandemicsyn commented May 8, 2026

Summary

  • Add a Durable Object-level guard so gateway/controller RPCs fail fast unless the KiloClaw instance state is running, preventing stopped runtimes from being probed through provider routing.
  • Keep morning briefing status polling graceful by treating the new non-running guard as a warm-up/unavailable state instead of surfacing repeated errors.
  • Tighten the admin instance detail polling gate so gateway status and controller version queries only run when the DO-reported runtime state is running.

Verification

  • stopped instance, messed with admin ui
  • stopped instance, cruised around user ui

Visual Changes

none

Reviewer Notes

  • The main behavior change is architectural: controller RPC safety now lives in requireGatewayControllerContext, so future controller-backed UI paths inherit the stopped-runtime protection automatically.
  • waitForHealthy() is intentionally unchanged because lifecycle/start reconciliation still needs to probe while a runtime is starting.
  • User/admin controller mutations now return a 409 conflict when the DO state is not running instead of attempting provider routing.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 8, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • apps/web/src/app/admin/components/KiloclawInstanceDetail.tsx — no issues
  • services/kiloclaw/src/durable-objects/kiloclaw-instance.test.ts — updated test correctly inverts expectation to match new stopped-runtime guard
  • services/kiloclaw/src/durable-objects/kiloclaw-instance/gateway.test.ts — no issues
  • services/kiloclaw/src/durable-objects/kiloclaw-instance/gateway.ts — no issues
  • services/kiloclaw/src/routes/platform.ts — no issues

Reviewed by claude-4.6-sonnet-20260217 · 1,040,105 tokens

@pandemicsyn pandemicsyn merged commit 0fd35b8 into main May 8, 2026
13 checks passed
@pandemicsyn pandemicsyn deleted the florian/fix/admin-wake branch May 8, 2026 20:58
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