Skip to content

Windows Computer Use reuses a stale node_repl exec context across JS calls #37013

Description

@metyatech

Summary

On Codex Desktop for Windows, the bundled Computer Use client works only while all @oai/sky calls remain inside the same node_repl/js execution.

After the first JS execution finishes, the next node_repl/js call reuses the same @oai/sky Windows helper transport but fails with:

Error: node_repl exec context not found

This prevents the documented safe observe-then-act workflow, which requires observing the window in one JS call and acting from a later JS call.

Environment

  • Codex Desktop AppX: 26.730.7989.0 (x64)
  • Bundled Computer Use plugin: 26.730.61309
  • Bundled @oai/sky: 0.6.2
  • Windows 11 Home x64, version/build 10.0.26200
  • Native Windows agent using PowerShell
  • Computer Use plugin installed and enabled

Deterministic reproduction

Start with a fresh Node REPL kernel.

First node_repl/js call:

if (!globalThis.sky) {
  const { sky } = await import("@oai/sky");
  globalThis.sky = sky;
}

globalThis.windows = await sky.list_windows();
globalThis.target = windows.find(
  (window) => /\\explorer\.exe$/i.test(window.app || ""),
);

globalThis.firstState = await sky.get_window_state({
  window: target,
  include_screenshot: false,
  include_text: true,
});

nodeRepl.write(JSON.stringify({
  ok: true,
  hasAccessibility: !!firstState.accessibility,
}));

Result:

{"ok":true,"hasAccessibility":true}

Second node_repl/js call, reusing the returned window exactly as instructed by the Computer Use skill:

try {
  globalThis.secondState = await sky.get_window_state({
    window: target,
    include_screenshot: false,
    include_text: true,
  });

  nodeRepl.write(JSON.stringify({ ok: true }));
} catch (error) {
  nodeRepl.write(JSON.stringify({
    ok: false,
    message: error?.message,
    stack: error?.stack,
  }));
}

Result:

Error: node_repl exec context not found

The stack ends in:

@oai/sky/dist/project/cua/sky_js/src/targets/windows/internal/helper_transport.js:1:8940

Resetting the Node REPL kernel and repeating the same two calls produces the same result.

If list_windows() and get_window_state() are both performed inside the first JS execution, the state read succeeds. Moving the state read to the next JS execution makes it fail.

Local integrity checks

The following files have identical SHA-256 hashes between the installed AppX resources and the extracted local cua_node runtime:

  • node_repl.exe
  • @oai/sky/package.json
  • helper_transport.js

This rules out a stale or corrupted extracted runtime.

The bundled implementation also keeps a shared WindowsHelperTransport in a module-level map, while node_repl.exe validates operations against the currently active per-execution context. The same-execution success and next-execution failure are consistent with a helper/native-pipe connection retaining a stale execution context.

Expected behavior

A window returned from one node_repl/js observation should remain usable in the next JS call, as required by the Computer Use skill's two-cell observe/action workflow.

The persistent @oai/sky client should refresh or rebind its native-pipe execution context for each node_repl/js invocation without losing the window/screenshot/action state required for safe follow-up input.

Actual behavior

The first JS execution can enumerate and inspect the target window. Every later Computer Use state or input call through the reused client fails before interaction with node_repl exec context not found.

Restarting Codex, resetting the Node REPL kernel, and verifying the installed runtime against the AppX copy do not resolve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcomputer-usetool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions