Skip to content

Conversation

@yurekami
Copy link

Summary

  • Fix duplicate function name bug in controller.py where worker_api_get_status was defined twice, causing the /test_connection endpoint handler to shadow the /worker_get_status endpoint handler
  • Fix PEP 8 violation: use is None instead of == None in model_worker.py
  • Fix type comparison: use isinstance() instead of type() == in openai_api_server.py for better Pythonic style
  • Add /health endpoint to both controller and openai_api_server for load balancer and orchestration system compatibility (e.g., Kubernetes liveness probes)

Test plan

  • Verified Python syntax with python -m py_compile on all modified files
  • Manual testing of /health endpoint returns {"status": "ok"}
  • Verify existing functionality is not affected

Details

Bug Fix: Duplicate Function Name

In controller.py, the function worker_api_get_status was defined twice:

  1. Line 344: Handler for POST /worker_get_status
  2. Line 349: Handler for GET /test_connection

The second definition shadowed the first, which could cause issues. Renamed the second to test_connection.

Health Check Endpoints

Added simple /health endpoints that return {"status": "ok"} for:

  • Controller service
  • OpenAI API server

This is useful for:

  • Kubernetes health checks (liveness/readiness probes)
  • Load balancer health checks
  • Monitoring systems

🤖 Generated with Claude Code

- Fix duplicate function name bug in controller.py where `worker_api_get_status`
  was defined twice, causing the test_connection endpoint to shadow the worker
  status endpoint
- Fix PEP 8 violation: use `is None` instead of `== None` in model_worker.py
- Fix type comparison: use `isinstance()` instead of `type() ==` in
  openai_api_server.py for better Pythonic style
- Add `/health` endpoint to both controller and openai_api_server for load
  balancer and orchestration system compatibility

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fuckgitb
Copy link

fuckgitb commented Dec 28, 2025 via email

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