Spaces:
Sleeping
Sleeping
fix: use health-check loop in start.sh and align openenv.yaml port to 7860
Browse filessleep 3 was too short; uvicorn wasn't ready before inference.py connected.
Health-check loop polls /health until server responds (up to 60s).
Also fixes openenv.yaml port from 8000 to 7860 for HF Spaces.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files changed (2)
- openenv.yaml+1-1
- start.sh+21-2
2 unmodified lines34567892 unmodified linestype: spaceruntime: fastapiapp: debug_env.server.app:appport: 8000description: >A real-world debugging environment where LLM agents fix broken Python code.Tasks range from simple syntax errors to complex logic bugs. Agents use2 unmodified lines34567892 unmodified linestype: spaceruntime: fastapiapp: debug_env.server.app:appport: 7860description: >A real-world debugging environment where LLM agents fix broken Python code.Tasks range from simple syntax errors to complex logic bugs. Agents use
123456#!/bin/bashset -euvicorn debug_env.server.app:app --host 0.0.0.0 --port 7860 &sleep 3python inference.py12345678910111213141516171819202122232425#!/bin/bashset -eecho "Starting OpenEnv server..."uvicorn debug_env.server.app:app --host 0.0.0.0 --port 7860 2>&1 &UVICORN_PID=$!echo "Waiting for server to be ready..."MAX_WAIT=60WAITED=0until curl -sf http://127.0.0.1:7860/health > /dev/null 2>&1; doif [ $WAITED -ge $MAX_WAIT ]; thenecho "ERROR: Server failed to start within ${MAX_WAIT}s — aborting"exit 1fisleep 2WAITED=$((WAITED + 2))echo " waited ${WAITED}s..."doneecho "Server ready after ${WAITED}s"python inference.py# Keep container alive so HF Space stays in Running statewait $UVICORN_PID
openenv.yaml+1-1
start.sh+21-2