mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
_sync_back_once defers a SIGINT that lands mid-sync, then re-delivers it once the sync completes so the user's Ctrl+C isn't lost. It did so with os.kill(os.getpid(), signal.SIGINT). That is not graceful on Windows: os.kill only treats CTRL_C_EVENT(0)/CTRL_BREAK_EVENT(1) as console events; any other value (SIGINT == 2) routes to TerminateProcess(sig), so a Ctrl+C during a remote-backend (ssh/daytona/modal) sync-back hard-kills the whole CLI session (exit code 2) on Windows instead of raising KeyboardInterrupt. Use signal.raise_signal(signal.SIGINT) (3.8+), which invokes the restored handler through C raise() on every platform. Verified on Windows: raise_signal runs the handler (graceful) while os.kill(getpid, SIGINT) TerminateProcess-es the process. Adds a cross-platform regression test that runs on Windows too (it stubs the locked sync body, so unlike test_file_sync_back.py it needs no fcntl). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| base.py | ||
| daytona.py | ||
| docker.py | ||
| file_sync.py | ||
| local.py | ||
| managed_modal.py | ||
| modal.py | ||
| modal_utils.py | ||
| singularity.py | ||
| ssh.py | ||