Skip to content

Windows: import agents.sandbox.sandboxes fails with ModuleNotFoundError: fcntl #2938

@DhanushKenkiri

Description

@DhanushKenkiri

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions