Repository navigation
Description
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
- On Windows, have a work tree that contains a unix socket file, e.g.
%USERPROFILE%\.codex\app-server-control\app-server-control.sock. - Open
%USERPROFILE%(or the containing folder) as the project in OpenCode Desktop. - Send a prompt.
- Check
~/.local/share/opencode/log/opencode.logforfailed 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
- core: session never drains when Snapshot.capture() stalls on huge untracked tree — git add hangs, execution claim never released #48657 —
Snapshot.capture()stalls on a huge untracked tree ($HOMEas project, same failure area)
Activity
opencode-agent commentedon Oct 23, 2026
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 togit update-index --add, the step capture uses to add files, it failed withfatal: 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
$HOMEstalls on a huge untracked tree).