Skip to content

Conversation

@Redrock453
Copy link

Description

Fixes tool server disconnection issue on Windows 11 caused by multiprocessing spawn behavior.

Problem

On Windows, multiprocessing uses 'spawn' method which re-imports modules in worker processes. This triggered:

  • Argument parsing () at import time → crash
  • RuntimeError check at import time → crash
  • Signal handlers setup at import time → issues

Solution

  • Moved argument parsing to block
  • Created function for initialization
  • now set at startup, not import time
  • Workers can safely import the module without side effects

Testing

✅ Multiprocessing with spawn method (Windows behavior)
✅ Server startup with CLI arguments
✅ Health endpoint responding correctly
✅ Graceful rejection without sandbox mode

Changes

  • strix/runtime/tool_server.py - main fix for multiprocessing
  • strix/runtime/docker_runtime.py - command formatting cleanup
  • .env.example - configuration reference for users

Tested on Linux with spawn context simulation (Windows behavior).

Closes #[issue-number if exists]

- Move argument parsing and sandbox mode check from global scope to __main__
- Prevents multiprocessing spawn issues on Windows
- Add _setup_signals_and_run() function to initialize server
- Fix command formatting in docker_runtime.py
- Add .env.example for configuration reference

Fixes tool server disconnection issue reported on Windows 11
Tested with multiprocessing spawn method (Windows behavior)
@Redrock453 Redrock453 marked this pull request as draft November 12, 2025 07:42
@Redrock453 Redrock453 marked this pull request as ready for review November 12, 2025 07:43
@0xallam 0xallam closed this Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants