openai / openai/codex

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

Open
#38,737 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug computer-use skills
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the installed Computer Use skill's screenshot reader around line 116, then compare its file-URL assumption with @oai/sky/docs/sky-window-api.md and the Screenshot.d.ts contract. Add pure fixtures for base64 and percent-encoded data URLs, file URLs, and an unsupported scheme; verify expected bytes and MIME types without launching a UI session.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, macos, node.js
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.