Merge PR #1958: fix(restart): use -m nanobot for Windows compatibility

fix(restart): use -m nanobot for Windows compatibility
This commit is contained in:
Xubin Ren 2026-03-13 11:19:57 +08:00 committed by GitHub
commit 62a2e71748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -292,7 +292,9 @@ class AgentLoop:
async def _do_restart():
await asyncio.sleep(1)
os.execv(sys.executable, [sys.executable] + sys.argv)
# Use -m nanobot instead of sys.argv[0] for Windows compatibility
# (sys.argv[0] may be just "nanobot" without full path on Windows)
os.execv(sys.executable, [sys.executable, "-m", "nanobot"] + sys.argv[1:])
asyncio.create_task(_do_restart())