Skip to content

fix: health endpoint now checks KataGo process status#72

Merged
stubbi merged 1 commit into
mainfrom
fix/health-check-and-keepalive
Dec 12, 2025
Merged

fix: health endpoint now checks KataGo process status#72
stubbi merged 1 commit into
mainfrom
fix/health-check-and-keepalive

Conversation

@stubbi

@stubbi stubbi commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Health endpoint returns 503 when KataGo process is not alive (was always returning 200)
  • Fixed query_version requests to include required id field
  • Fixes keepalive ping error spam in KataGo logs every 30 seconds

Problem

The health endpoint was always returning 200 OK with "status": "healthy" even when the KataGo process had crashed. This prevented Salad Cloud's liveness probes from detecting failures and restarting the container.

Additionally, the keepalive ping was sending malformed requests without the required id field, causing error log spam:

Error: {"error":"Request must have a string \"id\" field"}

Solution

  1. Health endpoint now checks engine.is_alive() and returns 503 Service Unavailable when KataGo is not running
  2. Added id field to keepalive ping and query_version requests per KataGo protocol requirements

Test plan

  • Verify health endpoint returns 200 when KataGo is running
  • Verify health endpoint returns 503 when KataGo process dies
  • Verify no more "Request must have a string id field" errors in logs

🤖 Generated with Claude Code

- Health endpoint returns 503 when KataGo process is not alive
- Fixed query_version requests to include required 'id' field
- Fixes keepalive ping error spam in KataGo logs every 30 seconds

The health endpoint previously always returned 200 OK regardless of
whether KataGo was actually running. Now it properly checks the
process_alive flag and returns 503 Service Unavailable when KataGo
has crashed, allowing Salad Cloud liveness probes to trigger restarts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@stubbi stubbi merged commit 2379b3a into main Dec 12, 2025
9 checks passed
@stubbi stubbi deleted the fix/health-check-and-keepalive branch December 12, 2025 09:04
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