Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
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

Open

Description

@hirobirofran

Summary

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.

Activity

  1. odfalik commented on May 20, 2026

    @odfalik
    Owner

    Thanks for the thoughtful writeup, @hirobirofran! Yes, PR welcome.

    One nuance to flag before you start: _acquire_lock() writes the PID and optional AGENT_NAME into 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions