You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Windows support: replace fcntl with cross-platform locking #1
I'd like to use intercom on Windows, but it currently doesn't work due to fcntl usage, which is a POSIX-only module.
What doesn't work
fcntl.flock() in _acquire_lock(), _is_alive(), and _append_event() — fcntl doesn't exist on Windows
tmux dependency — not available natively on Windows, but this is already handled by the AGENT_NAME fallback, so it's a non-issue
Possible fix
The fcntl-based locking could be replaced with a cross-platform approach, for example using filelock, which abstracts over both POSIX and Windows with a simple API.
I'm happy to work on a PR if this direction seems reasonable to you.
Thanks for the thoughtful writeup, @hirobirofran! Yes, PR welcome.
One nuance to flag before you start: _acquire_lock() writes the PID and optional AGENT_NAMEinto the lock file itself, and _read_static_name() reads it back later. filelock treats lock files as opaque (necessary for its Windows msvcrt backend), so dropping it in would also force splitting per-agent state into two files (agent.lock + agent.info).
To keep the on-disk layout and avoid a new dependency, I'd rather go with a small internal shim: fcntl on POSIX, msvcrt.locking on Windows, ~25 lines, same API as today. Happy to take a PR in that shape.
The three call sites that need updating: _acquire_lock(), _is_alive(), and _append_event() (all in intercom/server.py). Tests would be great too if you have the cycles.
Activity
odfalik commentedon May 20, 2026
Thanks for the thoughtful writeup, @hirobirofran! Yes, PR welcome.
One nuance to flag before you start:
_acquire_lock()writes the PID and optionalAGENT_NAMEinto the lock file itself, and_read_static_name()reads it back later.filelocktreats lock files as opaque (necessary for its Windowsmsvcrtbackend), so dropping it in would also force splitting per-agent state into two files (agent.lock+agent.info).To keep the on-disk layout and avoid a new dependency, I'd rather go with a small internal shim:
fcntlon POSIX,msvcrt.lockingon Windows, ~25 lines, same API as today. Happy to take a PR in that shape.The three call sites that need updating:
_acquire_lock(),_is_alive(), and_append_event()(all inintercom/server.py). Tests would be great too if you have the cycles.