fix: disable uvicorn reload on Windows to fix async event loop issue (#4538)

This commit is contained in:
Celal Zamanoglu
2026-01-24 21:20:07 +03:00
committed by GitHub
parent eaefc572fc
commit 3922998f5d

View File

@@ -1,4 +1,5 @@
import os
import sys
import structlog
import uvicorn
@@ -16,7 +17,9 @@ if __name__ == "__main__":
LOG.info("Agent server starting.", host="0.0.0.0", port=port)
load_dotenv()
reload = settings.ENV == "local"
# Disable reload on Windows - uvicorn forces WindowsSelectorEventLoopPolicy when reload=True,
# but Windows needs WindowsProactorEventLoopPolicy for async subprocess operations
reload = settings.ENV == "local" and sys.platform != "win32"
# Configure reload settings
# Convert TEMP_PATH to relative path if it's absolute to avoid pathlib.glob() issues