Skip to content

snapshot: capture fails when the work tree contains a unix socket (non-regular file) #58371

Open

Description

@JinShuo-Li

snapshot: capture fails when the work tree contains a unix socket (non-regular file)

Description

Snapshot capture fails outright when the work tree contains a non-regular file — specifically a unix-domain socket.

Git.tree.capture invokes git add --intent-to-add --force --sparse --ignore-errors --pathspec-from-file=... in the snapshot repo. When a socket path exists in the tree, git aborts:

error: open(".codex/app-server-control/app-server-control.sock"): Function not implemented
fatal: Unable to process path .codex/app-server-control/app-server-control.sock

Capture then throws Git.OperationError and the server logs:

level=WARN message="failed to capture snapshot" cause="Git.OperationError: warning: in the working copy of ...
error: open(".codex/app-server-control/app-server-control.sock"): Function not implemented
fatal: Unable to process path .codex/app-server-control/app-server-control.sock"

Expected: non-regular paths (sockets, FIFOs, device nodes) are skipped during capture, and the rest of the tree is still snapshotted.

Actual: the entire capture aborts. No snapshot exists for that step, so Review/diff/revert is unavailable, and the next capture attempt fails identically (observed twice in one session). The warning also embeds the full per-file CRLF notice list as a single multi-KB log line, which makes the failure hard to spot.

Why this surfaces on Windows: $HOME commonly carries socket paths created by other tools (.codex/app-server-control/app-server-control.sock is an AF_UNIX socket, which Windows 10+ supports), and using $HOME as the project is a common choice. This is the second half of the same "snapshotting $HOME is pathological" problem as #48657, which covers the pathspec blowup.

Steps to reproduce

  1. On Windows, have a work tree that contains a unix socket file, e.g. %USERPROFILE%\.codex\app-server-control\app-server-control.sock.
  2. Open %USERPROFILE% (or the containing folder) as the project in OpenCode Desktop.
  3. Send a prompt.
  4. Check ~/.local/share/opencode/log/opencode.log for failed to capture snapshot.

Log excerpt (paths redacted)

timestamp=2026-10-23T02:18:57.236Z level=WARN message="failed to capture snapshot"
cause="Git.OperationError: warning: in the working copy of '.cargo/registry/src/..../Cargo.lock', LF will be replaced by CRLF the next time Git touches it
... (one line per file) ...
error: open(".codex/app-server-control/app-server-control.sock"): Function not implemented
fatal: Unable to process path .codex/app-server-control/app-server-control.sock"

OpenCode version

Desktop 2.1.3 (bundled sidecar 2.1.3)

Operating System

Windows 11 26H2, build 26300.9711, x64

Terminal

n/a — Desktop app

Plugins

none

Related

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report. I couldn't reproduce this here, because it needs Windows and my sandbox only runs Linux.

    On Linux, git ls-files --others (which snapshot capture uses to find untracked files) leaves sockets and FIFOs out, so capture never passes them to git. When I passed a socket straight to git update-index --add, the step capture uses to add files, it failed with fatal: Unable to process path, the same error as in your log. So the failing step matches your report. My guess is that Git for Windows lists the AF_UNIX socket as a regular file and then can't open it, but I haven't confirmed that.

    The capture code adds every listed path without checking whether it is a regular file, so one socket stops the whole snapshot. A maintainer with a Windows machine will need to confirm it.

    Related: #48657 (snapshotting $HOME stalls on a huge untracked tree).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions