Body
Describe the bug
On Windows, importing agents.sandbox.sandboxes fails with ModuleNotFoundError: No module named 'fcntl'.
The sandboxes package eagerly imports the Unix-only backend from src/agents/sandbox/sandboxes/unix_local.py, which depends on Unix-only stdlib modules (e.g. fcntl, termios). This causes the entire agents.sandbox.sandboxes package import to fail on Windows even if callers never use the Unix local backend.
Debug information
- Agents SDK version:
0.14.2
- Python version:
3.14.2
- OS: Windows (win32)
Repro steps
python -c "import agents.sandbox.sandboxes"
Expected behavior
import agents.sandbox.sandboxes should succeed on Windows. Unix-only backends should not be imported/available on Windows (or should fail with a clear ImportError only when explicitly imported/used).
Actual behavior
The import fails immediately with ModuleNotFoundError: fcntl.
Proposed fix
Guard the Unix-only backend import behind a platform check in src/agents/sandbox/sandboxes/init.py and add a small regression test to prevent the Windows import regression.
Body
Describe the bug
On Windows, importing
agents.sandbox.sandboxesfails withModuleNotFoundError: No module named 'fcntl'.The sandboxes package eagerly imports the Unix-only backend from src/agents/sandbox/sandboxes/unix_local.py, which depends on Unix-only stdlib modules (e.g.
fcntl,termios). This causes the entireagents.sandbox.sandboxespackage import to fail on Windows even if callers never use the Unix local backend.Debug information
0.14.23.14.2Repro steps
python -c "import agents.sandbox.sandboxes"Expected behavior
import agents.sandbox.sandboxesshould succeed on Windows. Unix-only backends should not be imported/available on Windows (or should fail with a clear ImportError only when explicitly imported/used).Actual behavior
The import fails immediately with
ModuleNotFoundError: fcntl.Proposed fix
Guard the Unix-only backend import behind a platform check in src/agents/sandbox/sandboxes/init.py and add a small regression test to prevent the Windows import regression.