Skip to content

Chat: show omp's blob-store pictures on macOS and Windows (needs a descriptor-relative open) #2004

Closed

Description

@devswha

Follow-up to #1998 (part of #992).

Problem

#1998 shows omp's pictures in Chat. omp keeps a picture's bytes in its blob store (<data>/blobs/<sha256>) and writes blob:sha256:<digest> in the transcript. To serve such a picture without ever reading bytes from outside the store that was authorized with the transcript, the bridge opens the blob through a descriptor of the store: on Linux it opens the store as a directory without following a link, checks that descriptor is the directory authorized with the transcript (fstat dev:ino) and the one the path names (/proc/self/fd), then opens the blob through it (/proc/self/fd/<fd>/<digest>, O_NOFOLLOW).

Node has no descriptor-relative open (openat) on macOS or Windows. Checked on macOS: /dev/fd/<dir fd>/<name> is ENOENT. A blob opened by name there follows whatever a directory above it is swapped to for that moment; the merge pass's gate reproduced that on the by-name branch. So since #1998, blob-backed omp pictures are not shown on macOS or Windows (fail closed). Inline omp pictures and every Codex picture are shown on all platforms.

What would lift it

A race-free open of a name relative to a held directory descriptor on macOS (openat, or fcntl(F_GETPATH) to bind the opened file to the held directory) and on Windows (a handle-relative open, e.g. NtCreateFile with a root directory handle), for example through the Rust PTY host (crates/pty-sidecar), which already runs as a native helper. The blob read is openBlob in server/codex-images.ts; blobPlatformForTests runs its non-Linux branch in tests.

Where

  • Chat on a macOS or Windows PC running omp (local or remote).

Activity

  1. devswha commented on Oct 27, 2026

    @devswha
    OwnerAuthor

    I reproduced the Windows half on native Windows 11 (DESKTOP-K8DAINV), main 4d5edf3, Bun 1.4.2. A 70-byte PNG stored as <store>/<sha256> with a matching digest is refused: ompBlobPicture(blobs, "image/png", "blob:sha256:<digest>") and ompBlobImageType both return null, because openBlob returns null on every platform except Linux. The same bytes sent inline are typed image/png. So Chat still does not show blob-backed omp pictures on Windows. Fixing it needs the handle-relative open this issue describes.

  2. devswha commented on Oct 28, 2026

    @devswha
    OwnerAuthor

    Still reproduces on current main (checked for the device sweep). Blob-backed omp pictures are not served on macOS. The fail-closed branch is still in place: openBlob returns null unless the platform is linux (server/codex-images.ts).

    • Machine: eamac, macOS 27.0.1, Bun 1.4.3. Code: a fresh clone of origin/main 4d5edf38.
    • Steps: make a store <tmp>/blobs/ holding a 1x1 PNG named by its sha256. Then call ompBlobPicture(blobs, "image/png", "blob:sha256:<digest>"), and open /dev/fd/<dir fd>/<digest> from the store's directory descriptor.
    • macOS result: ompBlobPicture -> null, and /dev/fd/<dirfd>/<name> -> ENOENT.
    • Same probe on Linux (P620, Bun 1.4.3): image/png, and the /dev/fd open succeeds.

    Left open: it still needs the descriptor-relative open (openat or F_GETPATH on macOS) that the issue describes. Windows was not checked in this lane.

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