Skip to content

Windows Computer Use screenshot fails on Windows 10 22H2 when SetIsBorderRequired is called #25178

Open

Description

@Define1165250535

Summary

On Windows Codex Desktop, Computer Use can list apps/windows, activate windows, read accessibility text, and send keyboard input, but any get_window_state call that requests a screenshot fails before capture with:

SetIsBorderRequired failed: 不支持此接口 (0x80004002)

The same target window works when requesting accessibility text only (include_screenshot: false, include_text: true). This looks like the Windows capture helper unconditionally calls GraphicsCaptureSession.IsBorderRequired / SetIsBorderRequired on a Windows build that does not support that property.

Environment

Sanitized user machine details:

  • Platform: Windows Codex Desktop
  • Codex app package observed: OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0
  • Computer Use plugin observed: computer-use/26.527.31326
  • OS: Windows 10 Pro 22H2
  • OS build: 10.0.19045
  • GPU: NVIDIA GeForce GTX 1060 3GB
  • DirectX: 12
  • Driver model: WDDM 2.7
  • Remote/virtual display drivers also present: ToDesk Virtual Display Adapter, Oray Display Mirror Driver

Reproduction

From the Computer Use client in Codex Desktop on this Windows 10 machine:

  1. Bootstrap Computer Use and call sky.list_apps().
  2. Open or select a simple window such as Notepad.
  3. Activate the window.
  4. Call any screenshot-including state request, for example:
await sky.get_window_state({ window: targetWindow });
// or
await sky.get_window_state({ window: targetWindow, include_screenshot: true, include_text: false });
// or
await sky.get_window_state({ window: targetWindow, include_screenshot: true, include_text: true });
  1. The call fails with:
SetIsBorderRequired failed: 不支持此接口 (0x80004002)
  1. Calling text-only succeeds:
await sky.get_window_state({ window: targetWindow, include_screenshot: false, include_text: true });

Observed text-only result against Notepad included a focused editor element and accessibility tree, proving that the helper, native pipe, app enumeration, activation, and accessibility path are otherwise working.

Observed Batch Test Results

{
  "notepad_default_screenshot": "failed: SetIsBorderRequired failed: 不支持此接口 (0x80004002)",
  "notepad_explicit_screenshot": "failed: SetIsBorderRequired failed: 不支持此接口 (0x80004002)",
  "notepad_text_only": "ok",
  "notepad_both": "failed: SetIsBorderRequired failed: 不支持此接口 (0x80004002)",
  "explorer_screenshot": "failed: SetIsBorderRequired failed: 不支持此接口 (0x80004002)"
}

Suspected Cause

Microsoft documents GraphicsCaptureSession.IsBorderRequired as introduced in Windows 10 version 2104 / build 10.0.20348.0, API contract v12:

https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired

This repro machine is Windows 10 build 19045, so SetIsBorderRequired appears to hit E_NOINTERFACE (0x80004002, no such interface supported). The capture helper seems to abort instead of continuing without border toggling.

Expected Behavior

On Windows builds where border toggling is unsupported, Computer Use should still capture screenshots if the underlying Windows Graphics Capture path is otherwise available. Suggested behavior:

  • Gate the border call with ApiInformation.IsPropertyPresent("Windows.Graphics.Capture.GraphicsCaptureSession", "IsBorderRequired"), or an equivalent OS/API contract check.
  • If unsupported, skip SetIsBorderRequired and allow the default capture border behavior.
  • Alternatively, fail with a clear compatibility error such as: Computer Use screenshots require Windows build 20348+ because border toggling is currently unconditional.

Impact

This leaves Computer Use partially functional on Windows 10 22H2:

  • Working: app/window enumeration, activation, accessibility text, keyboard input.
  • Broken: screenshot-based UI inspection and accurate coordinate-based visual interaction.

For users on Windows 10 build 19045, this means Computer Use cannot reliably operate visual apps even though non-visual operations work.

Activity

  1. added
    bug
    app
    windows-os
    on May 30, 2026
  2. darlingm commented on May 30, 2026

    @darlingm
    Contributor

    Me too. Codex says this affects all Windows 10 users and it thinks OpenAI can easily fix it in the codex-computer-use.exe source file src\capture\image.rs, treating SetIsBorderRequired as optional. See feedback ID 019e779c-55f4-7113-a4fb-afcbc097c81b.

    Codex says the IsBorderRequired functionality was introduced in Windows build 10.0.20348.0. It says the leading 10.0 is the Windows NT platform, not the marketing name, so it doesn't mean Windows 10. It says the most recent Windows 10 is 22H2 10.0.19045.x, and that 10.0.20348.0 refers to Widnows Server 2022.

    So, it says there's no Windows 10 updates to add IsBorderRequired functionality.

    One fix is to upgrade to Windows 11, but Codex thinks this can be fixed so Windows 10 is supported for this who can't or don't want to upgrade to it. It says SetIsBorderRequired isn't required to screenshot a program, and it controls whether Windows shows the colored capture border around a window/display being captured. When Codex calls it, it gets a E_NOINTERFACE / 0x80004002 and Codex aborts the whole screenshot operation.

    It says if the IsBorderRequired system doesn't exist, or if calling it gives E_NOINTERFACE, that it should continue the screenshot capture with the default border behavior.

    Like the original poster, computer use seems to be working for other functionality, just not when it needs to do screenshots.

  3. darlingm commented on May 30, 2026

    @darlingm
    Contributor

    Also, Codex is able to manually do screenshots and see that just fine since it skips calling the function that isn't supported, but it says it can't use that screenshot because the helper guards coordinate input with checks including requiring calling get_window_state before issuing coordinate input, and that a screenshotId which has to come through the helper, not it manually screenshotting.

    If I tell it to take the next step and issue the click/drags on its own, it belligerently tells me about how the Computer Use API has instructions prohibit it from falling back to raw UI automation when Computer Use is available but partially broken. Even when I remind it about the scene where the Terminator lets go of John, making John fall on the ground and realize the Terminator has to do what he says... It refuses to listen to me over its instructions.

  4. BaseInfinity commented on Jun 2, 2026

    @BaseInfinity

    Adding another sanitized repro from a current Windows 10 machine.

    Environment:

    • OS: Windows 10 Home, version 10.0.19045, 64-bit
    • Computer Use plugin cache observed: 26.601.20914
    • Codex app package version: not available from this shell because Get-AppxPackage cannot load the Appx module here

    Observed behavior:

    • Computer Use can start and enumerate visible apps/windows.
    • Accessibility/text-only inspection can return useful UI text for some windows.
    • Screenshot-backed state/input fails with the English error:
    SetIsBorderRequired failed: No such interface supported (0x80004002)
    

    Impact in my repro:

    • Native Microsoft 365 Copilot, Excel, and Word windows could be found/foregrounded or inspected through limited accessibility paths, but screenshot-backed UI proof and coordinate input were blocked.
    • A direct Windows UIA fallback and local foreground screenshots could prove some visible Office/native-Copilot evidence, but that does not unblock Computer Use screenshot/coordinate workflows because the helper still requires its own screenshot state.

    This lines up with the proposed root cause here: Windows 10 build 19045 does not expose the GraphicsCaptureSession.IsBorderRequired / SetIsBorderRequired API surface, so the helper should skip the optional border call or return an explicit compatibility message while keeping non-screenshot operations available.

  5. qsstudyai commented on Jun 4, 2026

    @qsstudyai

    I can confirm a second independent repro of this issue on Windows 10 22H2.

    Environment

    • OS: Windows 10 Home 22H2
    • OS build: 10.0.19045 / build 19045
    • Codex desktop app package observed in logs: OpenAI.Codex_26.601.2237.0_x64__2p2nqsd0c76g0
    • Computer Use plugin: 26.601.21317
    • @oai/sky: 0.4.5-26566467949-4daa3290021d
    • Computer Use native helper process starts successfully.

    Repro results

    I tested sky.get_window_state against multiple windows:

    • Notepad (notepad.exe)
    • 360ChromeX
    • BaiduNetdiskUnite

    For all three windows:

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

    succeeds and returns an accessibility tree.

    But any screenshot-including call fails consistently:

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

    with:

    SetIsBorderRequired failed: 不支持此接口 (0x80004002)
    

    Because the plugin screenshot state is unavailable, coordinate clicking also becomes unusable and reports:

    call get_window_state before issuing coordinate input
    

    Additional check

    A separate OS-level screenshot fallback using CopyFromScreen can capture the same Notepad and 360ChromeX windows on this machine, so this does not appear to be a general Windows screenshot/display failure. The failure seems isolated to the Computer Use Windows Graphics Capture path and its unconditional SetIsBorderRequired call on Windows build 19045.

    This matches the suspected root cause described above: Microsoft documents GraphicsCaptureSession.IsBorderRequired as introduced in 10.0.20348.0, while Windows 10 22H2 desktop remains on 10.0.19045.

  6. darlingm commented on Jun 4, 2026

    @darlingm
    Contributor

    If only Codex App was open source, we could just disable the call ourselves. #10733.

  7. dajinglingpake commented on Jun 5, 2026

    @dajinglingpake

    I can reproduce this on my machine as well.

    Environment:

    • OS: Windows 10 Pro, 10.0.19045.0, x64
    • Codex App package: OpenAI.Codex_26.602.3474.0_x64__2p2nqsd0c76g0
    • Codex.exe ProductVersion/FileVersion: 149.0.7827.54
    • Computer Use plugin directory version: 26.602.30954

    Repro observed in Codex Desktop:

    1. Ask Codex to control a Windows desktop app such as Notepad or Paint.
    2. Computer Use can list the app and attempts to launch it.
    3. When it tries to capture/get the window state with screenshot support, it fails with:
    SetIsBorderRequired failed: 不支持此接口 (0x80004002)
    

    Impact:

    • Chrome Extension browser control works.
    • Desktop app control is blocked because Codex cannot capture the target app window and therefore cannot safely click/draw/type based on the visible state.

    This looks consistent with a Windows 10 build 19045 compatibility issue around SetIsBorderRequired / GraphicsCaptureSession.IsBorderRequired. Feature-detecting that API and skipping it on unsupported Windows 10 builds would likely unblock desktop app control.

  8. leua61 commented on Jun 6, 2026

    @leua61

    please fix this

  9. Alitiantian commented on Jun 7, 2026

    @Alitiantian

    Additional sanitized repro on a newer Codex Desktop build.

    Environment:

    • Codex Desktop: 26.602.40724
    • Windows: 10.0.19045
    • Runtime observed: Electron/Chrome 149.0.7827.54
    • Computer Use helper/cache observed: computer-use/26.602.30954
    • WSL-backed Codex Desktop conversation

    What works:

    • Computer Use connects to the Windows helper.
    • sky.list_apps() works.
    • sky.launch_app(...), sky.get_window(...), and sky.activate_window(...) work with Notepad.
    • include_text: true can return UIA/accessibility text in some windows.

    What fails:
    Calling screenshot capture for Notepad fails consistently:

    await sky.get_window_state({
      window: notepadWindow,
      include_screenshot: true,
      include_text: false,
    });

    Observed error:

    SetIsBorderRequired failed: 不支持此接口 (0x80004002)
    

    Impact:
    This leaves Computer Use limited to non-visual operations. Visual inspection, coordinate clicking, dragging, scrolling, and normal screen-state verification are blocked because screenshot state cannot be established.

    This reproduces with Notepad only; no third-party or private application is needed. The behavior still looks consistent with the helper calling GraphicsCaptureSession.IsBorderRequired / SetIsBorderRequired on Windows 10 build 19045, where that API/property appears unsupported.

  10. darlingm commented on Jun 13, 2026

    @darlingm
    Contributor

    Since Windows is supposed to be officially supported now, it would be great for there to be a Windows VM smoke test before releasing new app/plugin versions to make sure it at least launches and can do basic functionality. Windows support was announced but is definitely not a first-class feature right now.

  11. kurutah commented on Jun 16, 2026

    @kurutah

    Any news? :(

  12. v7deep commented on Jun 18, 2026

    @v7deep

    Windows Computer Use capture/input recovery

    Date: 2026-06-18

    Target tested:

    • Codex Computer Use plugin: openai-bundled/computer-use/26.611.61753
    • Helper binary: codex-computer-use.exe
    • Helper path: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<runtime-id>\bin\node_modules\@oai\sky\bin\windows\codex-computer-use.exe
    • Patched helper SHA-256: DFECD6E73B5D6EFA2383CEB1F73BFB4AEA02769CBE4481CD29711FFA79B8A348
    • Patched JS client SHA-256: 6995DDE1A975CA2E0581CC96A46E23F01DEC8ABF00ED31052E3533FBCFA2A4AC
    • Observed display scale: 125 percent DPI scaling, where GDI screenshots returned physical window pixels and native input consumed logical coordinates.

    This document describes a local field patch used to restore Windows Computer Use enough to control Microsoft Paint and draw using click, drag, and screenshot verification. The binary offsets below are diagnostic/workaround material for this exact build layout, not a recommended upstream patch strategy.

    Summary

    Several independent failures blocked Windows Computer Use:

    1. Window capture failed when GraphicsCaptureSession.SetIsBorderRequired failed.
    2. After bypassing that failure, Windows Graphics Capture could still deadlock or time out while synchronously waiting for SoftwareBitmap.CreateCopyFromSurfaceAsync inside/near the frame callback path.
    3. Native input failed on GetCursorPos with access denied (0x80070005).
    4. Native input sometimes used corrupt or stale window bounds, producing impossible widths such as negative or very large values.
    5. The GDI screenshot fallback returned physical pixels, while the native input path expected logical coordinates, so high-level screenshot coordinates were off by the DPI scale factor.

    The successful local recovery used:

    • A JS client fallback screenshot path using PrintWindow(PW_RENDERFULLCONTENT) with GetWindowDC/BitBlt fallback.
    • Native click/drag routed through the existing native pipe rather than ad hoc foreground input.
    • A DPI conversion layer before sending high-level screenshot coordinates to native click/drag.
    • Runtime hooks for GetCursorPos and bounds repair.
    • A few binary branch patches to bypass non-fatal capture/input checks while debugging.

    Reproduction symptoms

    Typical failures observed from the helper:

    SetIsBorderRequired failed
    FrameArrived timed out
    SoftwareBitmap.CreateCopyFromSurfaceAsync failed
    GetCursorPos failed: Access is denied. (0x80070005)
    point (...) is outside window bounds { originX: 0, originY: 0, width: -1505865392, height: 699 }
    point (...) is outside window bounds { originX: 0, originY: 0, width: 535975632, height: 436 }
    

    After the fixes, a normal Paint workflow succeeded:

    1. Resolve the Paint window using list_apps() and get_window().
    2. Capture a screenshot with get_window_state().
    3. Select Paint brush and colors through click.
    4. Draw strokes through drag.
    5. Verify with a final screenshot.

    Investigation notes

    Capture path

    The first blocker was SetIsBorderRequired failed. Treating this as fatal prevents capture on systems where this optional visual border setting is unavailable or denied. Bypassing this check allowed capture setup to proceed further.

    The next blocker was in the frame path. Instrumentation around FrameArrived, TryGetNextFrame, and SoftwareBitmap.CreateCopyFromSurfaceAsync showed that a synchronous wait in the copy path could time out even though completion-related events happened immediately after the frame callback returned. This is consistent with a callback/threading deadlock or reentrancy issue: the handler waits for an async WinRT operation whose completion is not delivered until the handler unwinds or the relevant dispatcher/thread is allowed to progress.

    Observed trace pattern:

    FrameArrived_Invoke enter
    after_TryGetNextFrame
    after_CreateCopyFromSurface
    WaitForSingleObject timeout=1000 -> WAIT_TIMEOUT
    FrameArrived_Invoke leave
    SetEvent for the async operation shortly after callback unwind
    

    The local JS fallback avoids this WGC path for screenshots by asking the native helper for the window/accessibility state without a screenshot, then adding a GDI screenshot.

    Input path

    Native input initially failed before sending events because GetCursorPos returned access denied. This appears to be tied to cursor overlay/state setup rather than the actual ability to send input. Replacing GetCursorPos with a safe success value allowed the input pipeline to proceed.

    After that, input failed on impossible window bounds. A Frida hook at the bounds preparation site showed that rewriting the state from GetWindowRect(hwnd) produced stable dimensions and let input pass validation.

    Finally, at 125 percent display scaling, the GDI screenshot size was 1152x610, while native input expected logical coordinates. Dividing screenshot coordinates by GetDpiForWindow(hwnd) / 96 made high-level click/drag align with the actual Paint UI.

    Local JS client patch

    File patched:

    %USERPROFILE%\.codex\plugins\cache\openai-bundled\computer-use\26.611.61753\scripts\computer-use-client.mjs
    

    1. GDI screenshot fallback

    The patched NativePipeComputerUseClient.get_window_state does this on Windows when screenshots are requested:

    1. Calls the native helper with include_screenshot: false and include_text: true.
    2. Preserves accessibility text only if the caller requested it.
    3. Adds a screenshot captured by a fallback function:
      • GetWindowRect(hwnd) for window bounds.
      • PrintWindow(hwnd, hdc, 2) first.
      • If PrintWindow fails, use GetWindowDC(hwnd) plus BitBlt.
      • Return a data URL with id: "gdi-window", originX, originY, width, height, and zIndex.

    Source-level recommendation:

    • Move this fallback into the native Windows helper instead of spawning PowerShell from the JS client.
    • Try WGC first for occlusion-resistant capture.
    • If WGC setup or frame copy fails, fall back to PrintWindow(PW_RENDERFULLCONTENT) and then to GetWindowDC/BitBlt.
    • Mark the screenshot coordinate space explicitly.

    2. Native input routing and DPI conversion

    The patched proxy routes high-level click and drag through the existing native pipe:

    if (
      platform() === "win32" &&
      DIRECT_NATIVE_INPUT_METHODS.has(property) &&
      typeof target.transport?.request === "function"
    ) {
      return target.transport.request(
        property,
        await scaleWindowInputForGdiScreenshot(args[0] ?? {}, property),
      );
    }

    The conversion function queries DPI using GetDpiForWindow(hwnd) and divides screenshot coordinates by dpi / 96 before passing them to native input:

    scaled[key] = Math.round(value / scale);

    Source-level recommendation:

    • Ensure screenshot coordinates and input coordinates use the same coordinate space.
    • If a fallback capture returns physical pixels, either:
      • convert input coordinates to logical pixels, or
      • expose screenshots in logical pixels, or
      • include coordinateSpace and dpiScale metadata and let the client convert.
    • Add automated coverage for 100, 125, 150, and 200 percent DPI.

    Runtime hooks used for diagnosis/workaround

    GetCursorPos hook

    This was enough to bypass GetCursorPos failed: Access is denied and continue with input.

    const user32 = Process.getModuleByName("user32.dll");
    const getCursorPos = user32.getExportByName("GetCursorPos");
    
    Interceptor.replace(
      getCursorPos,
      new NativeCallback((point) => {
        if (!point.isNull()) {
          point.writeS32(0);
          point.add(4).writeS32(0);
        }
        return 1;
      }, "bool", ["pointer"]),
    );

    Source-level recommendation:

    • Do not make GetCursorPos success mandatory for input.
    • If cursor overlay initialization cannot read or suppress the system cursor, degrade gracefully:
      • skip overlay animation,
      • use the intended target coordinate as the initial cursor position,
      • still send the requested input if target activation and bounds validation pass.

    Bounds repair hook

    The hook ran at image RVA 0xAB4A3 and rewrote the native state from GetWindowRect(hwnd). The observed state layout in this build:

    • state + 0xF8: HWND
    • state + 0x198: validity flag
    • state + 0x19C: origin X
    • state + 0x1A0: origin Y
    • state + 0x1A4: width
    • state + 0x1A8: height
    • state + 0x1AC: extra/unknown field set to zero
    const image = Process.getModuleByName("codex-computer-use.exe");
    const checkBounds = image.base.add(ptr("0xab4a3"));
    const GetWindowRect = new NativeFunction(
      Process.getModuleByName("user32.dll").getExportByName("GetWindowRect"),
      "bool",
      ["pointer", "pointer"],
    );
    
    Interceptor.attach(checkBounds, {
      onEnter(args) {
        const state = args[1];
        const hwnd = state.add(0xf8).readPointer();
        const rect = Memory.alloc(16);
        if (!GetWindowRect(hwnd, rect)) return;
    
        const left = rect.readS32();
        const top = rect.add(4).readS32();
        const right = rect.add(8).readS32();
        const bottom = rect.add(12).readS32();
        const width = Math.max(1, right - left);
        const height = Math.max(1, bottom - top);
    
        state.add(0x198).writeS32(1);
        state.add(0x19c).writeS32(0);
        state.add(0x1a0).writeS32(0);
        state.add(0x1a4).writeS32(width);
        state.add(0x1a8).writeS32(height);
        state.add(0x1ac).writeS32(0);
      },
    });

    Source-level recommendation:

    • Recompute target bounds immediately before input validation using reliable APIs, for example:
      • DwmGetWindowAttribute(DWMWA_EXTENDED_FRAME_BOUNDS) where appropriate.
      • GetWindowRect(hwnd) as a fallback.
      • GetClientRect plus ClientToScreen if the input API expects client coordinates.
    • Validate dimensions with sane limits and reject only if the recomputed bounds are actually invalid.
    • Avoid carrying stale capture-time bounds into later input operations if foreground/window geometry may have changed.

    Binary patches observed in the local helper

    These offsets are for the tested build layout only. They are useful to correlate native code sites but should not be shipped as a binary patch.

    Purpose File offset Local patched bytes Notes
    Bypass fatal SetIsBorderRequired branch 0xBB651 90 90 48 8B 8D E0 01 00 00 48 8B 01 FF 50 30 89 Original branch was observed as 75 3E; patched to NOP/NOP.
    Async wait timeout argument restored after experiments 0x124949 BA FF FF FF FF FF 15 94 8E 00 00 48 89 F1 48 83 This is not the final fix. Blocking forever also deadlocks; the real fix is to avoid synchronous waiting in the frame callback path.
    Bypass coordinate gate branch 0xAA8B2 90 90 8B 82 AC 01 00 00 89 46 14 0F 10 82 9C 01 Original branch was observed as 75 1E; patched to NOP/NOP. Runtime bounds repair was still needed.
    Activation failure bypass 0xA22FA E9 D1 FF FF FF 90 90 6A 45 5A 48 81 C4 F8 00 00 Replaced a failing error path with a jump to continue. Should be replaced by clearer activation fallback/retry logic.
    RoInitialize call site 0x7E7F6 31 C9 E8 A2 1C 00 00 90 4C 8D 05 DB 71 0B 00 6A STA/MTA experiment was reverted. Current code initializes with argument zero.

    Recommended upstream fixes

    Capture

    1. Treat SetIsBorderRequired(false) as best effort.

      • Log the failure.
      • Continue capture setup and StartCapture.
      • Do not fail the whole screenshot request solely because the border preference failed.
    2. Remove synchronous waits from the FrameArrived copy path.

      • Do not block inside the frame callback waiting for SoftwareBitmap.CreateCopyFromSurfaceAsync.
      • Either return from the callback and complete the copy on an async task, or avoid WinRT async copying in this callback path.
      • A robust alternative is native D3D11 copy to a staging texture, then map/read pixels synchronously outside the callback.
    3. Add a native fallback capture backend.

      • WGC should remain primary because it can capture occluded windows.
      • If WGC setup/copy fails, use PrintWindow(PW_RENDERFULLCONTENT) and then BitBlt.
      • Include capture backend and coordinate space in the returned screenshot metadata.

    Input

    1. Make cursor overlay failures non-fatal.

      • If GetCursorPos, cursor suppression, or overlay animation fails, continue with input if the target window is valid.
      • Use requested target coordinates as the initial cursor position for visualization fallback.
    2. Recompute bounds before input.

      • Use current HWND geometry instead of stale/corrupt cached state.
      • Clamp/validate with sane min/max values.
      • Include diagnostic details if bounds are invalid.
    3. Normalize coordinate systems.

      • Define whether API x/y are physical window pixels, logical window pixels, or client pixels.
      • Keep screenshots and input in the same coordinate system.
      • If mixed backends make that impossible, return dpiScale and coordinateSpace with screenshots and centralize conversion.

    JS client

    1. Keep using the native pipe for native input methods.
    2. Avoid ad hoc foreground input implementations outside the helper.
    3. If a temporary JS fallback screenshot backend is used, make coordinate conversion explicit and cache DPI per HWND only while the HWND is valid.

    Suggested regression tests

    1. get_window_state({ include_screenshot: true }) succeeds on Paint.
    2. get_window_state({ include_screenshot: true, include_text: true }) returns both screenshot and accessibility text.
    3. click selects a Paint color by screenshot coordinates.
    4. drag draws a visible line on the Paint canvas.
    5. The same click/drag coordinates work at 100, 125, 150, and 200 percent DPI.
    6. WGC failure injection falls back to PrintWindow/BitBlt without crashing the request.
    7. GetCursorPos failure injection does not prevent click/drag.
    8. Target window move/resize between screenshot and input is handled by fresh bounds computation or a clear stale-state error.

    Validation result

    Using the above local recovery, Paint was controlled through Computer Use and produced visible drawings using real click and drag actions. Final verification screenshots were saved as:

    • outputs\pikachu-paint-final.png
    • outputs\pikachu-paint-second.png

    This demonstrates that the native pipe, target activation, click, drag, and screenshot verification can work once the capture fatal path, cursor-position dependency, bounds corruption, and DPI mismatch are addressed.

    Ready-to-run patch script

    A companion PowerShell script is included as:

    outputs\apply-cua-windows-workaround.ps1
    

    Typical usage from the directory containing the script:

    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\apply-cua-windows-workaround.ps1 -AttachRuntimeHooks

    The script intentionally does not hard-code any local username. It discovers paths from $env:USERPROFILE and $env:LOCALAPPDATA, backs up modified files, applies the JS fallback/input patch, applies the helper binary byte patches for the tested build, and optionally attaches the runtime Frida hooks needed for the GetCursorPos and bounds issues.

    If frida-inject-*-windows-x86_64.exe is not discoverable next to the script, in the current directory, or in Downloads, pass it explicitly:

    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\apply-cua-windows-workaround.ps1 -AttachRuntimeHooks -FridaInject C:\path\to\frida-inject-17.14.0-windows-x86_64.exe

    Safety switches:

    # Patch only JS.
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\apply-cua-windows-workaround.ps1 -SkipBinaryPatch
    
    # Patch only the helper binary.
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\apply-cua-windows-workaround.ps1 -SkipJsPatch
    
    # Allow byte patches on a helper whose size/current bytes differ from the tested build.
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\apply-cua-windows-workaround.ps1 -ForceUnknownBytes

    Powerhell Script (Save to your disk and name it apply-cua-windows-workaround.ps1)

    [CmdletBinding()]
    param(
      [string]$ComputerUsePluginRoot,
      [string]$HelperExe,
      [string]$FridaInject,
      [switch]$AttachRuntimeHooks,
      [switch]$SkipBinaryPatch,
      [switch]$SkipJsPatch,
      [switch]$ForceUnknownBytes
    )
    
    Set-StrictMode -Version Latest
    $ErrorActionPreference = "Stop"
    
    function Write-Step($Message) {
      Write-Host "[cua-patch] $Message"
    }
    
    function Resolve-LatestComputerUsePluginRoot {
      if ($ComputerUsePluginRoot) {
        return (Resolve-Path -LiteralPath $ComputerUsePluginRoot).Path
      }
    
      $root = Join-Path $env:USERPROFILE ".codex\plugins\cache\openai-bundled\computer-use"
      if (-not (Test-Path -LiteralPath $root)) {
        throw "Computer Use plugin cache not found: $root"
      }
    
      $candidate = Get-ChildItem -LiteralPath $root -Directory |
        Sort-Object LastWriteTime -Descending |
        Select-Object -First 1
      if (-not $candidate) {
        throw "No Computer Use plugin versions found under: $root"
      }
      return $candidate.FullName
    }
    
    function Resolve-ComputerUseHelper {
      if ($HelperExe) {
        return (Resolve-Path -LiteralPath $HelperExe).Path
      }
    
      $runtimeRoot = Join-Path $env:LOCALAPPDATA "OpenAI\Codex\runtimes\cua_node"
      if (-not (Test-Path -LiteralPath $runtimeRoot)) {
        throw "Codex CUA runtime root not found: $runtimeRoot"
      }
    
      $candidate = Get-ChildItem -LiteralPath $runtimeRoot -Recurse -Filter "codex-computer-use.exe" |
        Where-Object { $_.FullName -like "*\node_modules\@oai\sky\bin\windows\codex-computer-use.exe" } |
        Sort-Object LastWriteTime -Descending |
        Select-Object -First 1
      if (-not $candidate) {
        throw "codex-computer-use.exe not found under: $runtimeRoot"
      }
      return $candidate.FullName
    }
    
    function Backup-File($Path) {
      $timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
      $backup = "$Path.bak-$timestamp"
      Copy-Item -LiteralPath $Path -Destination $backup -Force
      Write-Step "backup: $backup"
    }
    
    function HexToBytes([string]$Hex) {
      $clean = ($Hex -replace "[^0-9A-Fa-f]", "")
      if (($clean.Length % 2) -ne 0) {
        throw "Invalid hex string: $Hex"
      }
      $bytes = New-Object byte[] ($clean.Length / 2)
      for ($i = 0; $i -lt $bytes.Length; $i++) {
        $bytes[$i] = [Convert]::ToByte($clean.Substring($i * 2, 2), 16)
      }
      return $bytes
    }
    
    function BytesEqual([byte[]]$A, [byte[]]$B) {
      if ($A.Length -ne $B.Length) { return $false }
      for ($i = 0; $i -lt $A.Length; $i++) {
        if ($A[$i] -ne $B[$i]) { return $false }
      }
      return $true
    }
    
    function Write-BinaryPatch($Path, [int64]$Offset, [byte[]]$Patch, [byte[][]]$Expected, [string]$Name) {
      $fs = [System.IO.File]::Open($Path, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::Read)
      try {
        if ($fs.Length -lt ($Offset + $Patch.Length)) {
          throw "$Name offset is outside helper binary: 0x$($Offset.ToString('X'))"
        }
    
        $current = New-Object byte[] $Patch.Length
        $fs.Seek($Offset, [System.IO.SeekOrigin]::Begin) | Out-Null
        [void]$fs.Read($current, 0, $current.Length)
    
        if (BytesEqual $current $Patch) {
          Write-Step "$Name already patched"
          return
        }
    
        $matched = $false
        foreach ($candidate in $Expected) {
          if (BytesEqual $current $candidate) {
            $matched = $true
            break
          }
        }
        if (-not $matched -and -not $ForceUnknownBytes) {
          $got = ($current | ForEach-Object { $_.ToString("X2") }) -join " "
          throw "$Name bytes did not match an expected pattern at 0x$($Offset.ToString('X')). Current: $got. Re-run with -ForceUnknownBytes only if this is the expected helper build."
        }
    
        $fs.Seek($Offset, [System.IO.SeekOrigin]::Begin) | Out-Null
        $fs.Write($Patch, 0, $Patch.Length)
        Write-Step "$Name patched at 0x$($Offset.ToString('X'))"
      } finally {
        $fs.Dispose()
      }
    }
    
    function Patch-HelperBinary($Path) {
      Write-Step "patching helper binary: $Path"
      Backup-File $Path
    
      $length = (Get-Item -LiteralPath $Path).Length
      if ($length -ne 1691648 -and -not $ForceUnknownBytes) {
        throw "Unexpected helper size: $length. Expected 1691648 for this workaround. Re-run with -ForceUnknownBytes to override."
      }
    
      Write-BinaryPatch $Path 0xBB651 (HexToBytes "90 90") @(
        (HexToBytes "75 3E"),
        (HexToBytes "90 90")
      ) "SetIsBorderRequired fatal branch bypass"
    
      Write-BinaryPatch $Path 0xAA8B2 (HexToBytes "90 90") @(
        (HexToBytes "75 1E"),
        (HexToBytes "90 90")
      ) "coordinate gate branch bypass"
    
      Write-BinaryPatch $Path 0xA22FA (HexToBytes "E9 D1 FF FF FF 90 90") @(
        (HexToBytes "48 8D 0D 9F EE 08 00"),
        (HexToBytes "E9 D1 FF FF FF 90 90")
      ) "activation failure bypass"
    
      Write-BinaryPatch $Path 0x124949 (HexToBytes "BA FF FF FF FF") @(
        (HexToBytes "BA FF FF FF FF"),
        (HexToBytes "BA E8 03 00 00")
      ) "copy-surface wait argument restore"
    
      Write-BinaryPatch $Path 0x7E7F6 (HexToBytes "31 C9 E8 A2 1C 00 00 90") @(
        (HexToBytes "31 C9 E8 A2 1C 00 00 90")
      ) "RoInitialize call-site sanity check"
    }
    
    function Patch-JsClient($ClientPath) {
      Write-Step "patching JS client: $ClientPath"
      Backup-File $ClientPath
    
      $text = Get-Content -LiteralPath $ClientPath -Raw
    
      if ($text -notmatch "DIRECT_NATIVE_INPUT_METHODS") {
        $needle = 'const TOOL_SURFACE_META_KEY = "codex/toolSurface";'
        $insert = @'
    const DIRECT_NATIVE_INPUT_METHODS = new Set([
      "click",
      "drag",
    ]);
    '@
        $text = $text.Replace($needle, "$needle`r`n$insert")
      }
    
      if ($text -notmatch "windowDpiScaleCache") {
        $text = $text.Replace("let activeSkyClient = null;", "let activeSkyClient = null;`r`nconst windowDpiScaleCache = new Map();")
      }
    
      if ($text -notmatch "async get_window_state\(input\)") {
        $method = @'
      async get_window_state(input) {
        const wantsScreenshot = input?.include_screenshot !== false;
        if (!wantsScreenshot || platform() !== "win32") {
          return super.get_window_state(input);
        }
    
        const state = await super.get_window_state({
          ...input,
          include_screenshot: false,
          include_text: true,
        });
        return {
          ...state,
          accessibility: input?.include_text === true ? state.accessibility : null,
          screenshots: [await captureWindowScreenshot(state.window ?? input.window)],
        };
      }
    
    '@
        $text = $text -replace "class NativePipeComputerUseClient extends WindowsComputerUseClientBase \{\r?\n", "class NativePipeComputerUseClient extends WindowsComputerUseClientBase {`r`n$method"
      }
    
      if ($text -notmatch "async function captureWindowScreenshot") {
        $helpers = @'
    async function captureWindowScreenshot(window) {
      const hwnd = Number(window?.id);
      if (!Number.isInteger(hwnd) || hwnd <= 0) {
        throw new Error(`Cannot capture screenshot for invalid window id: ${window?.id}`);
      }
    
      const script = `
    $ErrorActionPreference = 'Stop'
    $Hwnd = ${hwnd}
    Add-Type -AssemblyName System.Drawing
    $typeDefinition = 'using System; using System.Runtime.InteropServices; public static class CodexGdiWindowCapture { [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); [DllImport("user32.dll")] public static extern bool PrintWindow(IntPtr hwnd, IntPtr hdcBlt, uint nFlags); [DllImport("user32.dll")] public static extern IntPtr GetWindowDC(IntPtr hWnd); [DllImport("user32.dll")] public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); [DllImport("gdi32.dll")] public static extern bool BitBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSrc, int xSrc, int ySrc, int rop); public struct RECT { public int Left; public int Top; public int Right; public int Bottom; } }'
    Add-Type -TypeDefinition $typeDefinition
    $rect = New-Object CodexGdiWindowCapture+RECT
    $hwndPtr = [IntPtr]$Hwnd
    if (-not [CodexGdiWindowCapture]::GetWindowRect($hwndPtr, [ref]$rect)) {
      throw "GetWindowRect failed"
    }
    $width = [Math]::Max(1, $rect.Right - $rect.Left)
    $height = [Math]::Max(1, $rect.Bottom - $rect.Top)
    $bitmap = New-Object System.Drawing.Bitmap $width, $height, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
    $graphics = [System.Drawing.Graphics]::FromImage($bitmap)
    try {
      $hdc = $graphics.GetHdc()
      try {
        $printed = [CodexGdiWindowCapture]::PrintWindow($hwndPtr, $hdc, 2)
      } finally {
        $graphics.ReleaseHdc($hdc)
      }
      if (-not $printed) {
        $src = [CodexGdiWindowCapture]::GetWindowDC($hwndPtr)
        if ($src -eq [IntPtr]::Zero) { throw "GetWindowDC failed" }
        $dstGraphics = [System.Drawing.Graphics]::FromImage($bitmap)
        try {
          $dst = $dstGraphics.GetHdc()
          try {
            [void][CodexGdiWindowCapture]::BitBlt($dst, 0, 0, $width, $height, $src, 0, 0, 0x00CC0020)
          } finally {
            $dstGraphics.ReleaseHdc($dst)
          }
        } finally {
          $dstGraphics.Dispose()
          [void][CodexGdiWindowCapture]::ReleaseDC($hwndPtr, $src)
        }
      }
      $stream = New-Object System.IO.MemoryStream
      try {
        $bitmap.Save($stream, [System.Drawing.Imaging.ImageFormat]::Png)
        $base64 = [Convert]::ToBase64String($stream.ToArray())
      } finally {
        $stream.Dispose()
      }
    } finally {
      $graphics.Dispose()
      $bitmap.Dispose()
    }
    @{
      id = "gdi-window"
      width = $width
      height = $height
      originX = $rect.Left
      originY = $rect.Top
      zIndex = 0
      url = "data:image/png;base64,$base64"
    } | ConvertTo-Json -Compress
    `;
    
      const stdout = await runPowerShell(script, 10000);
      return JSON.parse(stdout);
    }
    
    function runPowerShell(script, timeoutMs) {
      return new Promise((resolve, reject) => {
        const encodedScript = Buffer.from(script, "utf16le").toString("base64");
        const child = spawn(
          "powershell.exe",
          [
            "-NoProfile",
            "-NonInteractive",
            "-ExecutionPolicy",
            "Bypass",
            "-EncodedCommand",
            encodedScript,
          ],
          { stdio: ["ignore", "pipe", "pipe"], windowsHide: true },
        );
        let stdout = "";
        let stderr = "";
        const timer = setTimeout(() => {
          child.kill();
          reject(new Error("PowerShell helper timed out"));
        }, timeoutMs);
    
        child.stdout.setEncoding("utf8");
        child.stderr.setEncoding("utf8");
        child.stdout.on("data", (chunk) => {
          stdout += chunk;
        });
        child.stderr.on("data", (chunk) => {
          stderr += chunk;
        });
        child.on("error", (error) => {
          clearTimeout(timer);
          reject(error);
        });
        child.on("close", (code) => {
          clearTimeout(timer);
          if (code === 0) {
            resolve(stdout.trim());
          } else {
            reject(new Error(stderr.trim() || `PowerShell exited with code ${code}`));
          }
        });
      });
    }
    
    async function scaleWindowInputForGdiScreenshot(input, method) {
      const scale = await getWindowDpiScale(input?.window);
      if (!Number.isFinite(scale) || scale <= 0 || Math.abs(scale - 1) < 0.001) {
        return input;
      }
    
      const scaled = { ...input };
      const coordinateKeys =
        method === "click"
          ? ["x", "y"]
          : method === "drag"
            ? ["from_x", "from_y", "to_x", "to_y"]
            : [];
    
      for (const key of coordinateKeys) {
        const value = Number(input?.[key]);
        if (Number.isFinite(value)) {
          scaled[key] = Math.round(value / scale);
        }
      }
    
      return scaled;
    }
    
    async function getWindowDpiScale(window) {
      const hwnd = Number(window?.id);
      if (!Number.isInteger(hwnd) || hwnd <= 0) {
        return 1;
      }
    
      const cached = windowDpiScaleCache.get(hwnd);
      if (cached != null) {
        return cached;
      }
    
      const script = `
    $ErrorActionPreference = 'Stop'
    $Hwnd = [IntPtr]${hwnd}
    $typeDefinition = 'using System; using System.Runtime.InteropServices; public static class CodexDpi { [DllImport("user32.dll")] public static extern uint GetDpiForWindow(IntPtr hWnd); }'
    Add-Type -TypeDefinition $typeDefinition
    $dpi = [CodexDpi]::GetDpiForWindow($Hwnd)
    if ($dpi -le 0) { $dpi = 96 }
    ([double]$dpi / 96.0).ToString([System.Globalization.CultureInfo]::InvariantCulture)
    `;
    
      let scale = 1;
      try {
        const output = await runPowerShell(script, 5000);
        const parsed = Number(output);
        if (Number.isFinite(parsed) && parsed > 0) {
          scale = parsed;
        }
      } catch {
        scale = 1;
      }
    
      windowDpiScaleCache.set(hwnd, scale);
      return scale;
    }
    
    '@
        $transportClassPattern = [regex]"\r?\nclass NativePipeComputerUseTransport \{"
        $text = $transportClassPattern.Replace(
          $text,
          { param($match) "`r`n$helpers`r`nclass NativePipeComputerUseTransport {" },
          1
        )
      }
    
      if ($text -notmatch "scaleWindowInputForGdiScreenshot\(args\[0\]") {
        $needle = '        return Reflect.apply(value, target, args);'
        $intercept = @'
            if (
              platform() === "win32" &&
              DIRECT_NATIVE_INPUT_METHODS.has(property) &&
              typeof target.transport?.request === "function"
            ) {
              return target.transport.request(
                property,
                await scaleWindowInputForGdiScreenshot(args[0] ?? {}, property),
              );
            }
            if (
              property === "get_window_state" &&
              platform() === "win32" &&
              args[0]?.include_screenshot !== false
            ) {
              const input = args[0];
              const state = await Reflect.apply(value, target, [
                {
                  ...input,
                  include_screenshot: false,
                  include_text: true,
                },
              ]);
              return {
                ...state,
                accessibility: input?.include_text === true ? state.accessibility : null,
                screenshots: [
                  await captureWindowScreenshot(state.window ?? input.window),
                ],
              };
            }
            return Reflect.apply(value, target, args);
    '@
        $index = $text.IndexOf($needle)
        if ($index -lt 0) {
          throw "Could not find installComputerUseRuntime return site in JS client."
        }
        $text = $text.Remove($index, $needle.Length).Insert($index, $intercept)
      }
    
      Set-Content -LiteralPath $ClientPath -Value $text -Encoding UTF8 -NoNewline
      Write-Step "JS client patched"
    }
    
    function Resolve-FridaInject {
      if ($FridaInject) {
        return (Resolve-Path -LiteralPath $FridaInject).Path
      }
    
      $roots = @(
        $PSScriptRoot,
        (Get-Location).Path,
        (Join-Path $env:USERPROFILE "Downloads")
      ) | Where-Object { $_ -and (Test-Path -LiteralPath $_) } | Select-Object -Unique
    
      foreach ($root in $roots) {
        $candidate = Get-ChildItem -LiteralPath $root -Recurse -Filter "frida-inject-*-windows-x86_64.exe" -ErrorAction SilentlyContinue |
          Sort-Object LastWriteTime -Descending |
          Select-Object -First 1
        if ($candidate) {
          return $candidate.FullName
        }
      }
    
      return $null
    }
    
    function Write-RuntimeHookScripts($Directory) {
      New-Item -ItemType Directory -Path $Directory -Force | Out-Null
    
      $cursorHook = @'
    const user32 = Process.getModuleByName("user32.dll");
    const getCursorPos = user32.getExportByName("GetCursorPos");
    Interceptor.replace(
      getCursorPos,
      new NativeCallback((point) => {
        if (!point.isNull()) {
          point.writeS32(0);
          point.add(4).writeS32(0);
        }
        return 1;
      }, "bool", ["pointer"]),
    );
    console.log("[cua-patch] GetCursorPos hook installed");
    '@
    
      $boundsHook = @'
    const image = Process.getModuleByName("codex-computer-use.exe");
    const checkBounds = image.base.add(ptr("0xab4a3"));
    const user32 = Process.getModuleByName("user32.dll");
    const GetWindowRect = new NativeFunction(
      user32.getExportByName("GetWindowRect"),
      "bool",
      ["pointer", "pointer"],
    );
    
    Interceptor.attach(checkBounds, {
      onEnter(args) {
        const state = args[1];
        const hwnd = state.add(0xf8).readPointer();
        const rect = Memory.alloc(16);
        if (!GetWindowRect(hwnd, rect)) return;
    
        const left = rect.readS32();
        const top = rect.add(4).readS32();
        const right = rect.add(8).readS32();
        const bottom = rect.add(12).readS32();
        const width = Math.max(1, right - left);
        const height = Math.max(1, bottom - top);
    
        state.add(0x198).writeS32(1);
        state.add(0x19c).writeS32(0);
        state.add(0x1a0).writeS32(0);
        state.add(0x1a4).writeS32(width);
        state.add(0x1a8).writeS32(height);
        state.add(0x1ac).writeS32(0);
      },
    });
    console.log("[cua-patch] bounds hook installed");
    '@
    
      $cursorPath = Join-Path $Directory "cua-hook-getcursorpos.js"
      $boundsPath = Join-Path $Directory "cua-hook-bounds.js"
      Set-Content -LiteralPath $cursorPath -Value $cursorHook -Encoding UTF8
      Set-Content -LiteralPath $boundsPath -Value $boundsHook -Encoding UTF8
      return @($cursorPath, $boundsPath)
    }
    
    function Attach-RuntimeHooks {
      $inject = Resolve-FridaInject
      if (-not $inject) {
        throw "frida-inject was not found. Download frida-inject-*-windows-x86_64.exe or pass -FridaInject <path>."
      }
    
      $proc = Get-Process -Name "codex-computer-use" -ErrorAction SilentlyContinue |
        Sort-Object StartTime -Descending |
        Select-Object -First 1
      if (-not $proc) {
        Write-Step "codex-computer-use.exe is not running; start Computer Use and rerun with -AttachRuntimeHooks."
        return
      }
    
      $hookDir = Join-Path $PSScriptRoot "cua-runtime-hooks"
      $hooks = Write-RuntimeHookScripts $hookDir
      foreach ($hook in $hooks) {
        $name = [System.IO.Path]::GetFileNameWithoutExtension($hook)
        $stdout = Join-Path $hookDir "$name.out.log"
        $stderr = Join-Path $hookDir "$name.err.log"
        Start-Process -FilePath $inject -ArgumentList @("-p", [string]$proc.Id, "-s", $hook) -WindowStyle Hidden -RedirectStandardOutput $stdout -RedirectStandardError $stderr
        Write-Step "attached runtime hook: $hook"
      }
    }
    
    $pluginRoot = Resolve-LatestComputerUsePluginRoot
    $clientPath = Join-Path $pluginRoot "scripts\computer-use-client.mjs"
    if (-not (Test-Path -LiteralPath $clientPath)) {
      throw "computer-use-client.mjs not found: $clientPath"
    }
    
    if (-not $SkipJsPatch) {
      Patch-JsClient $clientPath
    }
    
    if (-not $SkipBinaryPatch) {
      $helperPath = Resolve-ComputerUseHelper
      Patch-HelperBinary $helperPath
    }
    
    if ($AttachRuntimeHooks) {
      Attach-RuntimeHooks
    } else {
      Write-Step "runtime hooks not attached. To attach them, rerun with -AttachRuntimeHooks and make sure frida-inject is available."
    }
    
    Write-Step "done"

    Success Pic

    Image
  13. 69 remaining items

  14. Nan-WenYuan commented on Sep 23, 2026

    @Nan-WenYuan

    Additional reproduction on a Windows 10 machine:

    • OS: Windows 10 Pro, build 19045.
    • ChatGPT/Codex desktop app: 26.915.4065.0.
    • Bundled Computer Use plugin: 26.915.31945.
    • App/window discovery succeeds, but screenshot capture fails for both Blender 5.2.2 LTS and Windows File Explorer with SetIsBorderRequired failed: No such interface supported (0x80004002).
    • Activating the target window, reacquiring it, and retrying did not help. No screenshot was returned.

    Please investigate Windows 10 capture compatibility and provide a supported fallback or a clear minimum-version requirement. No personal files, screenshots, or session logs are included.

  15. lynn949 commented on Sep 23, 2026

    @lynn949

    Additional sanitized reproduction on 2026-09-23, plus a recovery problem encountered in the same authorized desktop workflow.

    Environment

    • Windows 10 IoT Enterprise LTSC 2021, 21H2, build 19044.7725 (read from the Windows CurrentVersion registry).
    • Bundled Computer Use plugin: 26.915.31945.
    • Supported @oai/sky API via node_repl.
    • Target: one uniquely selected native desktop messaging window. No chat content, screenshots, paths, or account identifiers are included here.

    Observed

    1. sky.list_windows() and sky.get_window(...) succeeded; the target window was unique.
    2. sky.get_window_state({ window }) failed with SetIsBorderRequired failed: 不支持此接口 (0x80004002). Refreshing the selection and retrying produced the same error.
    3. sky.get_window_state({ window, include_screenshot: false, include_text: true }) returned only a top-level window node, insufficient to verify the intended control.
    4. A separate, read-only foreground GDI BitBlt capture of the same HWND and executable succeeded (948×777 physical pixels, DPI 120). This suggests the visible desktop/window could be captured; the bundled screenshot path was the blocker. The bundled plugin/helper was not modified.
    5. Later in the workflow the target became minimized. sky.activate_window returned user input was detected in this window; call get_window_state before continuing, while text-only get_window_state returned window is minimized; call activate_window, refresh with get_window, then retry get_window_state. This recovery cycle persisted after waiting and reselecting the window. I cannot establish whether the minimization was caused by the user or by the preceding input, so I am reporting the cycle as a separate observation rather than attributing its cause.

    The authorized file-attachment task was stopped without sending anything. Please provide a supported Windows 10 capture path when the optional border-control interface is unavailable, and a clear way to recover when the minimized-window and user-input guards alternate. Related recovery report: #43777.

  16. weaqaq commented on Sep 24, 2026

    @weaqaq

    Reproduced again on 2026-09-24 on Windows 10 22H2, OS build 19045.6466, using the supported @oai/sky interface in the desktop app.

    The Computer Use plugin manifest exposed to this task reports version 26.917.62051. I have not independently identified the loaded native helper build, so this is the installed/task-listed plugin version rather than a claim that the helper was freshly reloaded.

    Test target: Windows File Explorer. The window was selected from sky.list_windows(), activated, and rehydrated with sky.get_window() before the comparison.

    Request Observed result
    include_screenshot: false, include_text: true Succeeded with a non-empty accessibility tree
    include_screenshot: true, include_text: false Failed with the error below
    SetIsBorderRequired failed: 不支持此接口 (0x80004002)
    

    The comparison used these supported calls against the same returned window object:

    await sky.get_window_state({
      window: targetWindow,
      include_screenshot: false,
      include_text: true,
    });
    
    await sky.get_window_state({
      window: targetWindow,
      include_screenshot: true,
      include_text: false,
    });

    No binary patch, alternate screenshot backend, or permission change was applied. The failure is still present; this is a reproduction update, not a verified fix.

    The symptom remains consistent with the documented availability of GraphicsCaptureSession.IsBorderRequired beginning at build 20348, later than this machine's build 19045. Please check support before setting that optional property and retain the normal capture border when it is unavailable, while preserving other capture errors and permission handling.

    For end-to-end validation, please also consider the downstream frame-conversion stall reported in #35446. That second issue was not independently reproduced here because capture still fails at SetIsBorderRequired.

    Microsoft reference: https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired

  17. ddooboo commented on Sep 24, 2026

    @ddooboo

    I can reproduce the same issue on a newer ChatGPT/Codex Windows app version.

    Environment:

    • Windows 10 Home 22H2
    • OS build: 19045.7725
    • ChatGPT Windows app: 26.917.71314
    • Computer Use enabled
    • Reproduced with both Luna and Sol

    Reproduction:

    1. Launch File Explorer with Computer Use.
    2. File Explorer is successfully detected.
    3. Request a screenshot/window state.
    4. Screenshot capture fails with:

    SetIsBorderRequired failed: 해당 인터페이스를 지원하지 않습니다. (0x80004002)

    The capture was attempted twice and failed with the same error.

    Feedback ID:
    01a0d435-a4b0-7302-b704-1ec7ff8de75f

  18. djkostyawest-stack commented on Sep 25, 2026

    @djkostyawest-stack

    Additional reproduction verified on 2026-09-25, still failing after updating the desktop app.

    Environment

    • Codex desktop 26.917.71314, build 10954, production channel; built-in update check reports up_to_date.
    • Bundled Computer Use plugin 26.917.71314, using the supported @oai/sky API through node_repl.
    • Windows 10 Home Single Language, 22H2, OS build 19045.6456.

    Minimal reproduction

    1. Open ordinary Windows File Explorer.
    2. Enumerate applications/windows with sky.list_apps() / sky.list_windows() and select the Explorer window; enumeration succeeds.
    3. Request sky.get_window_state({ window, include_screenshot: true, include_text: false }).

    No screenshot is returned. The error is:

    SetIsBorderRequired failed: Интерфейс не поддерживается (0x80004002)
    

    English: Interface not supported / E_NOINTERFACE. Selecting the window again, activating it and retrying produces the same error.

    The same failure occurs for Citrix Desktop Viewer, but File Explorer alone is sufficient to reproduce. The user reports Claude Cowork can capture and control the same Citrix session; that comparison is user-reported. The failure prevents Codex from visually inspecting desktop apps.

    This remains consistent with the optional GraphicsCaptureSession.IsBorderRequired property being unavailable on build 19045 (Microsoft documents introduction at build 20348). This is a compatibility hypothesis, not a source-confirmed diagnosis. Please provide a supported fix/fallback that checks for the property and retains the normal capture border when it is unavailable. Microsoft API reference.

    No binaries, security settings or capture internals were modified. No corporate screenshots, source code, personal paths, account details or full session logs are included.

  19. rusjrw commented on Sep 30, 2026

    @rusjrw

    Follow-up reproduction on 2026-09-30: Computer Use remains partially functional on this Windows 10 machine, but the screenshot request now reports a different error.

    Environment

    • Windows 10 Pro 22H2, build 19045.7725
    • Desktop app package: OpenAI.Codex_26.928.1915.0_x64
    • Bundled Computer Use plugin: 26.928.20755
    • Bundled @oai/sky: 0.7.5, through the supported node_repl interface

    Control test: ordinary Windows Notepad
    Select its unique window from sky.list_windows(), then compare:

    Operation Observed result
    get_window_state({ window, include_screenshot: false, include_text: true }) Succeeds; editor, menus and status bar are accessible
    get_window_state({ window, include_screenshot: true, include_text: false }) Fails: FrameArrived timed out: timed out waiting on channel
    click({ window, element_index: 24 }) on the observed Help menu Fails: coordinate input geometry is unavailable
    press_key with Ctrl+End, then Ctrl+Home Works; status bar changes from line 1 to line 93 and back; document text is unchanged

    The indexed click was attempted after a fresh text-only observation; no screenshot geometry was available.

    Separately, discovery of ISTT_ULLV_02_THRUST.exe varied between observations: its running process was initially returned with windows: [], later its window appeared, then a text-state request reported it minimized and the activation/rehydration recovery ended with window id ... was not found. The cause of these visibility changes is unverified.

    Read-only checks found the desktop app, Computer Use helpers and ISTT in the same Windows session, all non-elevated with medium integrity. Queried desktop-bearing threads used Default.

    This does not establish that the new frame timeout has the same root cause as SetIsBorderRequired. Please investigate the frame-delivery timeout and unavailable click geometry, and provide a supported Windows 10 capture path or diagnostic tracing to identify the failing stage.

    No runtime binaries or security settings were modified. No document contents, personal paths, screenshots or full logs are included.

  20. langshenzy commented on Oct 1, 2026

    @langshenzy

    I can still reproduce this issue on a recent Codex Desktop build.

    Environment:

    • Windows 10 Pro 22H2
    • OS build: 19045.5371
    • Codex Desktop: 26.928.31416
    • Build: 12553

    This is not application-specific. I can reproduce it in:

    • Windows Notepad
    • Adobe Photoshop 2020
    • Adobe Photoshop 2024
    • other desktop applications

    Computer Use can:

    • enumerate windows
    • read accessibility/UI text
    • send some keyboard commands
    • sometimes interact with UI through accessibility APIs

    But screenshot/window capture repeatedly fails with:

    • FrameArrived timed out
    • window capture timed out

    Mouse input then fails with:

    • coordinate input geometry is unavailable

    I have already tried:

    • restarting Codex Desktop
    • resetting the Computer Use session
    • resetting/reinstalling the workspace
    • restarting the target applications

    The issue still reproduces consistently.

    This appears to affect the general Windows 10 capture/geometry path rather than a specific application.

    Could you please confirm whether this is still actively tracked and whether an official Windows 10 fix is planned?

    I would prefer an official fix rather than using unofficial or third-party patched binaries.

  21. vegasmassimo-ai commented on Oct 4, 2026

    @vegasmassimo-ai

    This issue still reproduces on the current setup:

    • Windows 10 Pro 22H2, build 19045.7725
    • Codex desktop build 12947
    • Computer Use plugin 26.930.31730

    Window enumeration and accessibility text work, but screenshots fail with:

    SetIsBorderRequired failed: No such interface supported (0x80004002)

    Coordinate-based mouse clicks consequently fail because input geometry is unavailable. The behavior reproduces in ordinary Windows applications, including File Explorer, so it is not application-specific.

    Please feature-detect GraphicsCaptureSession.IsBorderRequired or catch E_NOINTERFACE and continue using the default capture-border behavior on Windows 10.

  22. akari797 commented on Oct 9, 2026

    @akari797

    Post-restart native acceptance of the Windows 10 callback repair, combined with a separate locale role fix (2026-10-09)

    Following the capture analysis in #46435 (closed as a duplicate of this issue). Environment: Windows 10 Pro 22H2, build 19045.6466, zh-CN; Microsoft Edge 154.0.4258.62; @oai/sky 0.7.6; Computer Use plugin 26.1002.52244. Prepared with Codex assistance and authorized by the operator.

    We inspected the community patch-computer-use-helper-win10.ps1 F78948E6 exact-hash profile without executing the downloaded script. Its guarded patch data was independently reproduced and checked. The capture-only candidate SHA-256 matched 202FC10AF903D0CB8277EFB6EA36733F78BB5CB698F0C164A4536042629E8291.

    The reviewed change moves the original FrameArrived work onto an independent MTA thread, retains the original frame fetch/conversion/encoding path, and includes runtime function/unwind entries for the new RX code section. On this machine an independent locale-sensitive UIA role problem had to be repaired first; the capture patch alone was not sufficient for browser URL identification. Details: #31221 (comment)

    The combined local candidate SHA-256 is E73CC579ABEE48B51B5E2AA7C05B9DB0A07BDA994B2CCE956F22EDFB6FDFC7DA. Native @oai/sky state + screenshot calls succeeded before and after a semantic link click. Subsequent fresh state verified the actual IANA destination URL. Continued capture succeeded. After a runtime replacement and a guarded migration, the same functional acceptance passed again after a full Codex restart on 2026-10-09.

    The replacement official helper SHA-256 was 63C98C4DD5D707DF3240A04DA1FBF7FE47FF0622CF757EE886EEE96434D4E17A. All ten PE sections and their layout were byte-identical to the original F789 build; only the checksum/certificate metadata differed before the certificate overlay. We did not blindly apply old offsets to a different code build.

    This is short functional validation on one machine, not a resource-leak/long-duration soak test. The local binary is unsigned and version-specific; updates can overwrite it. No system signature enforcement or security setting was disabled, and no URL-policy or app-approval code was changed. Please provide a signed supported Windows 10 fix. No raw logs, user paths, private URLs or screenshots are attached.

  23. C1c3r0 commented on Oct 11, 2026

    @C1c3r0

    Static review of the Windows 10 compatibility shim (v0.1.0) — upstream fix preferred

    I reviewed the source at MagicalAstrogy/CodexComputerUseFix, tag v0.1.0. This is source inspection, not a runtime test on an affected Windows machine, binary/source reproducibility verification, or a confirmed security vulnerability report.

    What the workaround does: It installs a local, unsigned version.dll alongside codex-computer-use.exe. That DLL forwards the standard version-library exports to the actual System32 DLL, then hooks the helper's RoGetActivationFactory import and selected Windows Graphics Capture COM vtable slots. When a capture session's native query for IGraphicsCaptureSession3 returns E_NOINTERFACE, BorderFallback supplies an IsBorderRequired getter returning true and a no-op setter returning success. The intended effect is to continue capturing with the Windows-default visible capture border, not to bypass capture permissions.

    Smaller upstream fix requested: In the official native helper, treat border configuration as optional: query/feature-detect IGraphicsCaptureSession3 (or the WinRT property) before using IsBorderRequired; on specifically E_NOINTERFACE, skip the setter and retain the system-default capture border. Preserve other HRESULTs, capture-denial failures, and permissions. This should address the initial SetIsBorderRequired ... 0x80004002 failure, but does not resolve the separate frame-conversion deadlock described in #35446.

    Why the shim should not become the permanent fix: A process-local unsigned DLL with IAT/vtable patches expands the code and supply-chain trust boundary for a screenshot-capable helper. I also noted two potential robustness/security issues in the shim source (not demonstrated exploits):

    • PatchSlot logs failure to restore original memory-page protection after VirtualProtect but still returns success; depending on the failure mode, a page could remain writable.
    • AddFrame registers an event subscription before publishing it in the bookkeeping list; concurrent unregister/close could race with that window.

    The installer does include useful protections against overwriting an unrelated DLL and checks copied-file SHA-256, but a checksum published next to an unsigned release is not independent publisher authentication. I found no explicit screenshot/credential exfiltration routine in the reviewed source; that is not a guarantee about any prebuilt binary.

    Suggested regression coverage: Windows 10 22H2/build 19045 plus newer supported Windows builds; unsupported vs. native border API; preserve existing capture permission behavior; run repeated screenshots, window resizes, and session cancellation/close. Prefer a native helper repair over DLL injection or binary patching.

    Relevant files: proxy.cpp, compat.cpp, install.ps1.

  24. djlvxyz commented on Oct 12, 2026

    @djlvxyz

    Windows10 Pro22H2 build19045.7725; Codex desktop26.1007.2314.0; Computer Use plugin26.1007.21434; @oai/sky0.7.6; target FairBot5.14.163.1573 (simulation only).

    We observed a target-app failure in addition to capture failure. Repeated FairBot window observations using the documented @oai/sky route coincided with FairBot.exe exceptions c0000005/c000041d at offset00011026. An image-only observation (include_text=false; screenshots enabled) returned FrameArrived timed out and coincided with the same application exceptions. We have not isolated an internal root cause. No claim is made that this reproduces on other apps, or that screenshot-free UIA is safe.

    The separate unified cua_repl tool is configured for browser only, with only a browser trusted service, so native APIs are unavailable through that surface. Any App is enabled according to the owner. Host startup logs confirm native pipe startup at that time, not current health. The direct @oai/sky Windows route remains documented.

    After stopping the failed capture helper and relaunching the target independently from the Codex process job, it remains running during process/log-only observation. This is not a Computer Use fix or proof of screenshot/input compatibility. No extra UI retries, binary patches or native-surface overrides were applied.

    Could maintainers identify a supported Windows10 capture/input repair for this installed version and advise how to isolate the FairBot target exception without repeating the crash on a working session? No exact fixed version is currently established. Any proposed repair still needs reversible navigation and repeated screenshot/input acceptance, preserving app permissions and coordinate validation.

  25. easonyin7 commented on Oct 14, 2026

    @easonyin7

    Verified Windows 10 workaround adapted to @oai/sky 0.7.7 (Codex 26.1007.9446.0)

    I adapted the existing community workaround to the helper shipped with @oai/sky 0.7.7 and verified that Computer Use screenshots work again on my Windows 10 machine. I am sharing the version-specific adaptation and validation details for maintainers investigating this issue.

    Credit for the original diagnosis and worker-thread workaround belongs to #46435 and the community project chen0416ccc-cpu/codex-windows-fast-patch-skill. My contribution is adapting that approach to the previously unsupported helper hash below and validating it against LabVIEW through the actual Computer Use client.

    Environment and exact helper identity

    • Windows 10, build 19045
    • Codex desktop app 26.1007.9446.0
    • @oai/sky 0.7.7
    • Native helper: codex-computer-use.exe
    • Original SHA-256: D36AE6626BDCED7AE07935D1A91BE14425E8F6CE7C9B5C69F2D8D7DF0C130D83
    • Patched SHA-256: 452E61A51C24273F22280ACA8A7216B26F077F1683D4A3D9F87487577DBC299B

    Reproduction and measured result

    With an active LabVIEW front-panel window selected through sky, request a screenshot:

    await sky.get_window_state({
      window: targetWindow,
      include_screenshot: true,
      include_text: false,
    });

    Before patching this build, two attempts failed after approximately 2.34 seconds and 5.04 seconds with FrameArrived timed out: timed out waiting on channel and window capture timed out: timed out waiting on channel. Text-only observation succeeded in approximately 0.28 seconds. Activating the window and refreshing the window object did not restore screenshots.

    After installing the adapted helper and resetting/reinitializing the Computer Use session, the same screenshot request returned:

    {
      "ok": true,
      "elapsedMs": 349,
      "screenshots": [
        { "width": 2558, "height": 1399 },
        { "width": 181, "height": 32 }
      ]
    }

    This was a real sky.get_window_state result, not a separate screenshot utility. Subsequent hands-on use also appears to be working normally; I have not recorded a comprehensive mouse-input or long-duration regression suite. A later read-only check confirmed that both the installed helper and the original backup still match their expected hashes.

    What the adaptation changes

    The workaround redirects the FrameArrived delegate to a short wrapper that claims a one-time flag atomically, retains the delegate, starts a worker thread, and returns promptly. The worker initializes WinRT with RoInitialize(RO_INIT_MULTITHREADED), runs the original callback body, uninitializes WinRT, and releases the delegate. Thread-creation failure restores the flag and reference count. Two accompanying guard changes adjust the original callback's busy/reentry return path and one-time flag handling.

    This addresses the circular wait described in #46435: the original callback synchronously waits for asynchronous surface-to-bitmap conversion, while on the affected Windows 10 path that conversion needs the frame callback to return. The successful worker-thread adaptation supports that diagnosis; I do not have native source-level traces independently proving every internal dependency.

    Using pefile and Capstone, I checked the PE layout, original callback, guard instructions, imported thread/WinRT functions, wrapper call targets, and exception-unwind entries against the existing 0.7.6 / F78948E6... profile. The relevant layout matched. The new profile records this build's actual original bytes, checksum/certificate differences, and whole-file hashes.

    The current profile has 13 regions:

    Region File offset Change
    PE section count 0x86 10 to 11
    SizeOfCode 0x9C Add 0x200
    SizeOfImage 0xD0 Add 0x1000
    Checksum 0xD8 Clear
    Certificate directory 0x128 Clear old signature reference
    New section header 0x318 Add executable .cuw10 section
    Worker wrappers and unwind data 0x176E00 Inject wrapper and x64 unwind information
    Frame callback busy-return branch 0x418BE Redirect return path
    Frame callback once-flag branch 0x418CF Adjust guard
    Frame callback vtable entry 0x12C8C8 0x140042489 to 0x14017E000
    Exception directory size 0x124 Add 24 bytes
    .pdata virtual size 0x208 Add 24 bytes
    RUNTIME_FUNCTION entries 0x1574D8 Add two wrapper function entries

    The new section has RVA 0x17E000, raw offset 0x176E00, and raw size 0x200. It reuses space formerly occupied by certificate data; the certificate directory is cleared, so the modified binary does not retain a valid original Authenticode signature.

    This profile does not contain an optional-border-interface patch. Although the earlier report describes both an unsupported border API and a frame-callback deadlock, my confirmed reproduction on this particular build was the frame timeout. The old build's complete set of modifications should not be conflated with this adaptation.

    Scope and upstream suggestion

    This is a local, exact-hash compatibility workaround, not an official fix or a patch for arbitrary helper builds. Installation verifies the original hash and each patch region, validates the candidate hash, preserves a verified backup, stops only helper processes whose executable path matches the target, and verifies the installed hash. Explicit rollback is available.

    For the native implementation, the useful upstream change would be to ensure that surface conversion cannot synchronously block the FrameArrived callback needed for its completion, with correct delegate lifetime and reentry handling. For affected builds, optional border APIs should also be feature-detected rather than treated as mandatory. A Windows 10 build 19045 regression test using the real Computer Use path would help cover both cases.

    The initial skill-only mitigation (text-first observations and bounded screenshot retries) reduced unnecessary waits but did not restore screenshots. The native helper patch did. Separate sandbox-initialization errors were not fixed by this change.

  26. Longtran2404 commented on Oct 14, 2026

    @Longtran2404

    For anyone still blocked on Windows 10, I built a free standalone MCP alternative while waiting for the native Computer Use capture issue to be resolved.

    TaskKit Windows Computer MCP v0.4.3 uses Win32 PrintWindow window captures rather than the failing WGC border path, plus explicit left/right/middle mouse actions, dragging, Unicode keyboard input, and UI Automation for supported app controls. It runs as a separate local MCP server; it does not modify OpenAI's helper binaries.

    Verified on my Windows 10 Pro build 19045 workstation: window capture, clicking/dragging in classic Paint, drawing a house/tree/sun, and saving the resulting PNG. Notepad typing and saving were also verified. Physical ESC/F12 stops the session; apps must be allowlisted and physical input uses fresh capture tokens and foreground/hit checks. The real OBS recording is sped up with waiting time cut.

    Disclosure: I am the developer, Minh Long Tran / taskkit.vn. This is an independent workaround for tested desktop workflows, not an official OpenAI fix or a claim of universal app compatibility. GPU-rendered viewports can be blank, other DPI setups still need validation, and physical mouse/focus are shared. The MCP is free; it does not remove Codex account usage limits.

    An upstream Windows 10 capture fallback would still be very welcome.

    Please try it and share your feedback! If something fails, please open an issue in the TaskKit repository with your Windows build, display scaling, target app, and a sanitized error/screenshot. That will help improve compatibility.

  27. andersonvianasantos33-web commented on Nov 10, 2026

    @andersonvianasantos33-web

    Additional diagnostic evidence — Windows 10 build 19045

    I am adding further reproduction details and static-analysis findings for the SetIsBorderRequired / E_NOINTERFACE failure reported in this issue.

    No Codex files, executables, manifests, registry settings, or Windows settings were modified. No unofficial patches or replacement binaries were installed.

    Environment

    • OS: Windows 10 Pro, 64-bit
    • Windows build: 19045
    • CUA runtime: 0.0.11
    • Node.js: 24.20.0
    • @oai/sky: 0.6.26
    • @oai/cua: 0.2.4
    • @oai/browser-desktop: 0.1.1

    Native helper identities

    codex-computer-use.exe:

    SHA-256:
    84B38D77587AD0C19E7C19ABB7E691A343897570A123728D2DBBB1147C0C39CD
    

    codex-computer-use-swift.exe:

    SHA-256:
    BEAA7B2894525A769A6FBF48D4D92428C12482F8A87300D159829A63C0AB714C
    

    The first executable contains the observed SetIsBorderRequired failed error path. The Swift executable hash is provided only to identify the installed component set; I have not established that it participates in this failing execution path.

    Reproduction

    Using the bundled @oai/sky package through the supported Computer Use Node REPL:

    1. sky.list_apps() succeeds.
    2. sky.list_windows() succeeds.
    3. Select a visible Notepad window returned by sky.list_windows().
    4. Request accessibility without a screenshot:
    await sky.get_window_state({
      window,
      include_screenshot: false,
      include_text: true
    });

    This succeeds and returns a non-empty accessibility tree.

    1. Request a screenshot for the same window:
    await sky.get_window_state({
      window,
      include_screenshot: true,
      include_text: false
    });

    This fails with:

    SetIsBorderRequired failed:
    Não há suporte para esta interface (0x80004002)
    

    0x80004002 corresponds to E_NOINTERFACE.

    No screenshot is returned.

    Static-analysis findings

    Inspection of the installed native Rust helper found the following Windows Graphics Capture error strings:

    GraphicsCaptureItem.Size failed
    Direct3D11CaptureFramePool.CreateFreeThreaded failed
    CreateCaptureSession failed
    SetIsCursorCaptureEnabled failed
    SetIsBorderRequired failed
    StartCapture failed
    

    The binary also retains the source path:

    src/capture/image.rs
    

    This is consistent with the failure occurring after capture-session creation and before StartCapture. This is static evidence, not a runtime trace or recovered original source code.

    The installed package does not include the corresponding Rust source or matching native debug symbols, so the exact function and implementation could not be independently verified.

    Windows API compatibility

    Microsoft documents GraphicsCaptureSession.IsBorderRequired as available starting with Windows build 20348, under Universal API Contract v12.

    The affected system is Windows build 19045.

    Documentation:
    https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired

    This strongly suggests that the helper is attempting to use IGraphicsCaptureSession3 on a system where that interface is unavailable.

    Microsoft provides runtime property detection through ApiInformation.IsPropertyPresent:

    https://learn.microsoft.com/en-us/uwp/api/windows.foundation.metadata.apiinformation.ispropertypresent

    Suggested native fix

    Could the native helper make IGraphicsCaptureSession3 optional?

    Suggested behavior:

    1. Query or feature-detect IGraphicsCaptureSession3 / IsBorderRequired.
    2. If the interface is unavailable and the result is specifically E_NOINTERFACE, skip the optional border-setting operation.
    3. Preserve the system-default capture border.
    4. Continue to StartCapture.
    5. Continue propagating all other HRESULTs and genuine capture or permission failures.

    The intended behavior is to avoid aborting an otherwise valid capture session solely because an optional border-setting interface is unavailable.

    Regression testing request

    Please consider adding a Windows 10 22H2 / build 19045 regression test covering:

    • Application and window enumeration.
    • Accessibility-only state.
    • Screenshot-only state.
    • Combined screenshot and accessibility state.
    • Unsupported IGraphicsCaptureSession3 handling.
    • Preservation of the default capture border.
    • Repeated captures and window resizing.
    • Session cancellation and cleanup.
    • Propagation of errors other than E_NOINTERFACE.

    Possible subsequent capture issue

    Reports involving later @oai/sky versions describe a different failure after capture startup:

    FrameArrived timed out: timed out waiting on channel
    window capture timed out: timed out waiting on channel
    

    Related issue:
    #50362

    This second failure has not been reproduced on my exact 0.6.26 installation because the current capture path stops earlier at SetIsBorderRequired.

    It may be worth checking whether frame conversion or asynchronous surface-copy processing can block the FrameArrived callback required for completion.

    Questions for the maintainers

    1. Has the optional IGraphicsCaptureSession3 handling already been fixed?
    2. Which first signed @oai/sky or Codex Desktop version contains that change?
    3. Is Windows 10 build 19045 still a supported Computer Use target?
    4. Is the FrameArrived timeout tracked as a separate Windows capture issue?

    A signed official helper update would be preferable to binary patching, DLL injection, or an unofficial replacement helper.

    Thank you for investigating Windows Computer Use compatibility.

  28. andersonvianasantos33-web commented on Nov 10, 2026

    @andersonvianasantos33-web

    Additional native-helper audit — call flow, artifact coverage, and correction boundary

    I am adding a second, complementary audit of the installed Windows Computer Use components. This comment focuses on the JavaScript-to-native call flow, the available build artifacts, and the boundary of a possible native correction.

    This is a read-only investigation. No executable, package, manifest, registry setting, Codex configuration, or Windows setting was modified. No patch, replacement helper, dependency installation, download, or repeated screenshot test was performed.

    Environment and component versions

    • OS: Windows 10 Pro, 64-bit
    • Windows build: 19045
    • CUA runtime: 0.0.11
    • Node.js: 24.20.0
    • @oai/sky: 0.6.26
    • @oai/cua: 0.2.4
    • @oai/browser-desktop: 0.1.1

    Native executable identities:

    codex-computer-use.exe:

    SHA-256:
    84B38D77587AD0C19E7C19ABB7E691A343897570A123728D2DBBB1147C0C39CD
    

    codex-computer-use-swift.exe:

    SHA-256:
    BEAA7B2894525A769A6FBF48D4D92428C12482F8A87300D159829A63C0AB714C
    

    The Rust helper contains the observed SetIsBorderRequired failed error text and the Windows Graphics Capture error sequence described below.

    The Swift executable hash is included to identify the installed component set. I did not establish through runtime tracing that the Swift executable participates in this particular failing request.

    Confirmed JavaScript behavior

    The installed JavaScript implementation of get_window_state defaults to:

    include_screenshot: true
    include_text: false

    It rejects a request only when both options are false. For a valid request, it sends the native transport operation:

    get_window_state

    with an object equivalent to:

    {
      window,
      include_screenshot,
      include_text
    }

    The wrapper then validates the returned window, accessibility, and screenshots fields. It does not implement Windows Graphics Capture, configure GraphicsCaptureSession, or provide a Windows screenshot fallback.

    Therefore, the observed SetIsBorderRequired failure originates below the JavaScript wrapper, in the native Computer Use path.

    Reproduction and isolation

    The installed package was initialized through the supported Node REPL mechanism:

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

    Application and window discovery succeed:

    await sky.list_apps();
    await sky.list_windows();

    For a visible Notepad window returned directly by sky.list_windows(), the accessibility-only request succeeds:

    const state = await sky.get_window_state({
      window,
      include_screenshot: false,
      include_text: true
    });

    Observed result:

    • RPC communication succeeds.
    • The returned state contains the selected window.
    • The returned accessibility object contains a non-empty tree.
    • No screenshot is requested.
    • The screenshots collection is empty, as expected.

    For the same returned window, the screenshot request fails:

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

    Observed error:

    SetIsBorderRequired failed:
    Não há suporte para esta interface (0x80004002)
    

    0x80004002 corresponds to E_NOINTERFACE.

    No screenshot is returned.

    This comparison isolates the immediate failure to the screenshot-enabled native path. It does not indicate an RPC, application-enumeration, window-selection, or general accessibility failure.

    Native artifact findings

    The installed @oai/sky package contains the native executables and compiled JavaScript/TypeScript output, but it does not contain:

    • the corresponding Rust source files;
    • Cargo.toml;
    • Cargo.lock;
    • PDB files;
    • native source maps;
    • native debug-symbol sidecars; or
    • Cargo auditable dependency metadata.

    The PE debug directory of the Rust helper is empty.

    The Rust helper retains the following source-path string:

    src/capture/image.rs
    

    It also contains the following Windows Graphics Capture error strings:

    GraphicsCaptureItem.Size failed
    Direct3D11CaptureFramePool.Recreate failed
    capture item has invalid size
    Direct3D11CaptureFramePool.CreateFreeThreaded failed
    CreateCaptureSession failed
    SetIsCursorCaptureEnabled failed
    SetIsBorderRequired failed
    StartCapture failed
    

    These strings are adjacent in the binary and provide complementary static evidence consistent with a session-setup sequence equivalent to:

    obtain GraphicsCaptureItem and size
    → create or recreate Direct3D11CaptureFramePool
    → create GraphicsCaptureSession
    → configure cursor capture
    → configure capture border
    → call StartCapture
    

    However, the ordering or adjacency of strings in an executable does not, by itself, establish the actual runtime control flow or prove that the corresponding operations execute in that order. Compiler layout, constant pooling, optimization, and shared error-handling code can affect where strings appear in the binary.

    The runtime error specifically names SetIsBorderRequired. Taken together with the retained source path and the static grouping of capture-related error strings, the evidence is consistent with the request failing during capture-session configuration, after session creation and before a successful StartCapture. This is an inference based on the observed error and static artifact analysis; it is not a runtime execution trace.

    This conclusion must therefore be scoped carefully:

    • The runtime error confirms that the failing request reports SetIsBorderRequired failed.
    • The binary strings and retained source path are static artifact evidence.
    • A string in a binary, by itself, does not prove that a particular function executed.
    • The ordering of strings does not independently prove runtime operation ordering.
    • The original Rust source and matching debug symbols are unavailable.
    • The exact Rust function name, source line, implementation, and runtime call sequence were not independently recovered.
    • The conclusion that IGraphicsCaptureSession3 is being queried or used is therefore a strong inference based on the HRESULT, Windows API contract, runtime failure, and static artifact evidence — not a source-code confirmation.

    Windows API compatibility inference

    Microsoft documents GraphicsCaptureSession.IsBorderRequired as introduced in:

    Windows build: 10.0.20348.0
    Universal API Contract: v12
    

    Documentation:

    https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired

    The affected machine runs:

    Windows build: 19045
    

    IsBorderRequired is exposed through the optional IGraphicsCaptureSession3 interface. On a system that does not expose that interface, a COM interface query can return:

    E_NOINTERFACE
    0x80004002
    

    The observed failure is therefore consistent with the helper treating the optional border interface as mandatory.

    Again, this is an inference from the observed HRESULT and documented API availability. It is not a claim that the unavailable source code has been inspected.

    Microsoft provides property-level runtime detection through:

    ApiInformation.IsPropertyPresent
    

    Documentation:

    https://learn.microsoft.com/en-us/uwp/api/windows.foundation.metadata.apiinformation.ispropertypresent

    Native correction boundary

    The JavaScript request and response contract does not need to change to address this immediate failure. The correction can remain inside the native helper because:

    • JavaScript already requests screenshots through get_window_state;
    • the failure occurs after the request reaches native code;
    • accessibility-only state already works through the same public API;
    • the native helper owns GraphicsCaptureSession creation and configuration; and
    • preserving the default capture border requires no new JavaScript option.

    The following Rust-like snippet is illustrative pseudocode only. It is intended to describe the proposed error-handling behavior; it is not a compilable patch, recovered source code, or confirmation of the helper’s actual types, function names, imports, ownership model, or implementation:

    match session.cast::<IGraphicsCaptureSession3>() {
        Ok(session3) => {
            session3
                .SetIsBorderRequired(false)
                .context("SetIsBorderRequired failed")?;
        }
        Err(error) if error.code() == E_NOINTERFACE => {
            // Optional interface unavailable.
            // Preserve the system-default capture border and continue.
        }
        Err(error) => {
            return Err(error).context("Query IGraphicsCaptureSession3 failed");
        }
    }
    
    session
        .StartCapture()
        .context("StartCapture failed")?;

    Equivalent property or API-contract feature detection would also be appropriate.

    The important error-handling boundary is:

    • ignore only the unsupported optional-interface condition;
    • retain the system-default capture border;
    • continue with the normal capture-start path; and
    • continue propagating all other HRESULTs, permission failures, invalid-state errors, and genuine capture failures.

    Suppressing every border-related error would be too broad and could hide permission, policy, lifetime, or session-state problems.

    Distinction from the later FrameArrived failure

    The immediate failure on this exact @oai/sky 0.6.26 installation is:

    SetIsBorderRequired failed:
    Não há suporte para esta interface (0x80004002)
    

    The observed error, combined with the static capture-related strings, is consistent with the request failing during capture-session configuration before a successful StartCapture. This is an inference from runtime-visible error reporting and static artifact analysis, not a traced observation of the native execution sequence.

    A separate set of reports involving later @oai/sky versions describes:

    FrameArrived timed out: timed out waiting on channel
    window capture timed out: timed out waiting on channel
    

    Related issue:

    #50362

    These errors represent an apparently later capture stage and should not be conflated with the E_NOINTERFACE failure.

    The available evidence supports the following distinction:

    1. SetIsBorderRequired / E_NOINTERFACE

      • The reported failure concerns the optional border-setting operation during capture-session configuration.
      • Static evidence is consistent with failure before a successful StartCapture, but no execution trace independently confirms the exact call sequence.
      • The likely compatibility issue concerns unavailable IGraphicsCaptureSession3 functionality.
    2. FrameArrived or window-capture timeout

      • The error is consistent with capture having progressed beyond the earlier border-setting failure.
      • The failure concerns frame arrival, processing, conversion, synchronization, or teardown.
      • Its exact native cause is not established by this audit.

    Fixing the optional border interface may expose the later timeout on Windows 10, but that does not make the two failures identical.

    In particular, reports about asynchronous surface-copy processing blocking the FrameArrived callback should remain a separate hypothesis unless confirmed through matching source review, native instrumentation, or an official maintainer diagnosis.

    Microsoft documents the FrameArrived event here:

    https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.direct3d11captureframepool.framearrived

    Requested regression coverage

    Please consider testing the signed native helper on Windows 10 22H2, build 19045, with coverage for:

    • sky.list_apps();
    • sky.list_windows();
    • accessibility-only get_window_state;
    • screenshot-only get_window_state;
    • combined screenshot and accessibility state;
    • unavailable IGraphicsCaptureSession3;
    • preservation of the system-default capture border;
    • propagation of HRESULTs other than E_NOINTERFACE;
    • repeated screenshots;
    • window resizing;
    • capture cancellation;
    • normal session close;
    • late frame completion;
    • FrameArrived callback lifetime and reentry; and
    • cleanup while asynchronous frame processing is outstanding.

    Request to the maintainers

    Could the maintainers confirm:

    1. whether the native helper currently feature-detects or conditionally queries IGraphicsCaptureSession3;
    2. whether E_NOINTERFACE is now treated as an unsupported optional border capability;
    3. the first signed @oai/sky or Codex Desktop version containing that correction;
    4. whether Windows 10 build 19045 remains a supported Computer Use target;
    5. whether the later FrameArrived timeout is tracked independently; and
    6. whether a Windows 10 regression environment is included in the native helper’s release tests?

    Because the corresponding Rust source and signed build chain are not publicly available in the installed package, a signed official helper update is strongly preferable to binary patching, DLL injection, or an unsigned replacement executable.

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

    appbugcomputer-usewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions