Skip to content

Conversation

@interplanetarychris
Copy link

Summary

Add Docker HEALTHCHECK to bot containers so the dashboard can show accurate startup status instead of using a time-based heuristic.

Problem

Previously, the dashboard used an 8-second timer to guess when a bot was ready. This was unreliable - OpenClaw can take 10+ seconds to start, leading to "running" status while the bot was still initializing.

Solution

  • Add Docker HEALTHCHECK config when creating bot containers (polls /health endpoint)
  • Extract health status from Docker inspect API
  • Dashboard uses actual health status (startinghealthy) instead of time heuristic
  • Containers without healthcheck (created before this update) show as "running" immediately

Changes

File Change
src/services/DockerService.ts Add HEALTHCHECK config, extract health from inspect
src/types/container.ts Add HealthStatus type and health field
dashboard/src/types.ts Add HealthStatus type and health field
dashboard/src/dashboard/BotCard.tsx Use health status instead of 8s timer

Health check config

Healthcheck: {
  Test: ['CMD', 'wget', '-q', '--spider', 'http://localhost:{port}/health'],
  Interval: 2_000_000_000,  // 2s
  Timeout: 3_000_000_000,   // 3s
  Retries: 30,
  StartPeriod: 5_000_000_000,  // 5s
}

Test plan

  • Create new bot - verify "starting" shows until /health responds
  • Existing bots (no healthcheck) show "running" immediately
  • Unhealthy containers show error status

🤖 Generated with Claude Code

interplanetarychris and others added 2 commits February 3, 2026 16:36
Add HEALTHCHECK to bot containers that polls the OpenClaw /health endpoint.
Dashboard now uses actual container health status instead of time-based
heuristic to determine when bot is ready.

- Add Healthcheck config when creating containers (2s interval, 30 retries)
- Add health field to ContainerStatus type (none/starting/healthy/unhealthy)
- Update getContainerStatus to extract health from Docker inspect
- Update BotCard to use health status for starting/running distinction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Containers created before the healthcheck feature was added have
health='none'. These should be treated as running, not starting.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant