Repository navigation
fix(example): disable uvicorn hot reload on Windows - #2434
Merged
DavdGao merged 2 commits intoAug 31, 2026
Merged
Conversation
On Windows, uvicorn's reload mode forces a SelectorEventLoop, which does not support asyncio.create_subprocess_exec — built-in tools such as exec_shell then fail with NotImplementedError (see agentscope-ai#2423). Disable hot reload when sys.platform == "win32" and print a short note, keeping the default subprocess-capable ProactorEventLoop. Other platforms are unaffected.
Fold the is_windows variable and the startup print into the reload argument itself — uvicorn's own startup log drowns the notice anyway. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DvBvzzA12g3S9ww2C7drtN
DavdGao
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2423.
On Windows,
uvicorn.run(..., reload=True)runs the server withuse_subprocess=True, which makes uvicorn select aSelectorEventLoop— andSelectorEventLoopdoes not supportasyncio.create_subprocess_exec. Built-in tools that spawn subprocesses (e.g.exec_shellintool/_builtin/_backend.py) then fail withNotImplementedError, surfacing as the/workspace/skill500 in the report.Verified on Windows (uvicorn 0.52.4):
reload=True→_WindowsSelectorEventLoop,asyncio.create_subprocess_exec→NotImplementedErrorreload=False→ProactorEventLoop(uvicorn's default on Windows), subprocesses workChange: in the
examples/agent_service/main.pyentry point, disable hot reload whensys.platform == "win32"and print a short note. Other platforms keepreload=Trueunchanged.Type of change
Checklist