[app/computer-use] Screenshot reader assumes file URLs but packaged Sky returns data URLs

Open 💬 0 comments Opened Aug 15, 2026 by 100yenadmin

Installed versions

  • Codex Desktop app: 26.810.41047, bundle 6570, macOS arm64
  • Bundled Computer Use plugin: 1.0.1000717
  • Packaged @oai/sky: 0.6.11

Reproduction

The installed Computer Use skill says at line 116 that screenshot.url is always a file:// URL. Its example imports fileURLToPath and reads:

await fs.readFile(fileURLToPath(state.screenshot.url))

The packaged Sky contract says the opposite:

  • @oai/sky/docs/sky-window-api.md line 103: screenshot image is a data URL.
  • @oai/sky/.../types/window/Screenshot.d.ts line 2: screenshot image is a data URL.
  • The packaged Mac window_result.js forwards the service screenshot URL unchanged.

A minimal reproduction against Node 24.19.0 is:

const { fileURLToPath } = require('node:url');
fileURLToPath('data:image/png;base64,AA==');

Actual result:

ERR_INVALID_URL_SCHEME: The URL must be of scheme file

No app was launched and no desktop state was accessed for this reproduction.

Expected behavior

The documented reader should accept the screenshot URL scheme returned by the packaged Sky runtime.

Actual behavior

A contract-compliant data URL reaches fileURLToPath and the documented screenshot inspection path throws before the image can be read.

Proposed narrow fix

Branch on the URL scheme. Decode data: URLs into bytes, continue reading file: URLs when present, and fail closed on unknown schemes. Preserve the returned image MIME type rather than hard-coding PNG.

Acceptance test

Add pure fixtures for:

  1. A base64 data URL.
  2. A percent-encoded data URL.
  3. A file URL.
  4. An unsupported URL scheme that must fail closed.

Assert each supported fixture produces the expected bytes and MIME type without launching a UI session.

This report does not request editing the managed cache or packaged binary; the fix belongs in the upstream skill/runtime bundle.

View original on GitHub ↗