Skip to content

[Windows][Computer Use] Add target-window-only capture, background input, and no-overlay mode for desktop EXE automation #41323

Open

Description

@lanfengc

What variant of Codex are you using?

app

What feature would you like to see?

Summary

I use Codex on Windows for software development and frequently need Computer Use to test and operate external desktop EXE applications.

The current Computer Use implementation works functionally, but on Windows it can cause significant desktop/UI lag and shows a blue visual overlay during interaction.

For desktop application development, especially when operating a specific known target HWND, capturing or compositing more of the desktop than necessary is inefficient.

I would like to propose a dedicated window-scoped/background automation mode for the Computer Use plugin.

The desired behavior is:

Target HWND
    ↓
Capture only target window
    ↓
Model analyzes screenshot
    ↓
Return client-relative coordinates
    ↓
Send background mouse/keyboard input to target HWND
    ↓
Capture target window again

without continuously affecting the entire Windows desktop.


Use case

My primary workflow is:

Codex modifies application code
        ↓
Builds the Windows EXE
        ↓
Launches the EXE
        ↓
Uses Computer Use to test the UI
        ↓
Clicks buttons / enters values / verifies state
        ↓
Finds bugs
        ↓
Modifies code and repeats

Many of the external applications I work with do not expose a useful UI Automation/accessibility tree.

Examples include:

  • custom-drawn Win32 applications
  • Qt applications
  • Delphi applications
  • CEF/Electron applications
  • GPU-rendered/custom UI
  • legacy industrial/business software

For those applications, screenshot-based visual grounding is necessary.

The ideal workflow is therefore:

screenshot(target HWND)
        ↓
vision model
        ↓
(x, y) in client coordinates
        ↓
background click(target HWND, x, y)

This is similar to how traditional Windows automation tools operate.


Current problems

1. Computer Use can cause system-wide lag on Windows

When Computer Use is active, mouse movement and desktop interaction can become noticeably less responsive.

The problem is not necessarily high CPU usage; it appears related to the Windows capture/compositor/overlay path.

Disabling Computer Use significantly improves responsiveness.


2. Blue overlay / visual layer adds unnecessary desktop rendering work

Computer Use shows a blue visual overlay during interaction.

For automated EXE testing this visual overlay is usually unnecessary.

I would prefer an option such as:

computer_use.visual_overlay = false

or:

headless_visual_mode = true

The agent should still receive screenshots, but the Windows desktop should not need to render an agent cursor, highlight, border, or overlay.


3. Target-window capture should be explicitly supported

If the agent has already selected a specific target window/HWND, Computer Use should capture only that window.

Conceptually:

get_window_state({
    window: targetWindow,
    include_screenshot: true
})

should guarantee that the screenshot corresponds only to that requested window.

It should not depend on monitor-wide capture unless a fallback is explicitly required.

This would also reduce the risk of accidentally capturing unrelated windows.


4. Add an explicit capture backend / capture policy

A possible API/configuration:

[computer_use.windows]

capture_scope = "window"
capture_backend = "auto"

show_overlay = false
show_agent_cursor = false

allow_monitor_fallback = false

Possible capture pipeline:

Target HWND

1. PrintWindow / equivalent window capture
        ↓
2. Windows.Graphics.Capture CreateForWindow(HWND)
        ↓
3. optional visible screen-region fallback

Monitor-level screenshot should be the final fallback, not the default behavior when a valid target HWND exists.


5. Add background mouse input

For many traditional Windows applications, Computer Use does not need to move the physical user cursor.

It could provide:

background_click(window, x, y)
background_double_click(window, x, y)
background_right_click(window, x, y)

background_drag(
    window,
    start_x,
    start_y,
    end_x,
    end_y
)

background_scroll(window, x, y, delta)

Possible Windows implementation:

WM_MOUSEMOVE
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP
WM_MOUSEWHEEL

When appropriate, the implementation could resolve the deepest child HWND using the target client coordinates before sending the message.

Coordinates should be client-relative, not desktop absolute coordinates.


6. Add background keyboard input

Similarly, support a background keyboard strategy:

WM_SETTEXT
WM_CHAR
WM_KEYDOWN / WM_KEYUP

with foreground SendInput only as an explicit fallback.

If background input is unsupported by the target application, Computer Use should return something like:

{
    "status": "background_input_unavailable",
    "foreground_fallback_available": true
}

It should not silently take control of the user's physical keyboard/mouse.


7. Separate vision from physical desktop control

For applications without accessibility trees, the model still needs visual screenshots.

But visual grounding does not inherently require foreground desktop control.

A more efficient architecture would be:

                  Codex
                    │
                    ▼
              Computer Use
                    │
        ┌───────────┴───────────┐
        │                       │
 Window Capture            Background Input
        │                       │
 target HWND                 target HWND
        │                       │
 screenshot                  PostMessage
        │                       │
        └─────────┬─────────────┘
                  │
                  ▼
              Target.exe

The user's IDE and mouse could remain usable while Codex tests the application in the background.


8. Proposed operating modes

Computer Use could expose three Windows modes.

Mode A — Background / Window Scoped

Preferred for development/testing:

Capture: target HWND only
Input: background
Overlay: off
Physical cursor: untouched
Foreground switching: disabled

Mode B — Hybrid

Capture: target HWND
Input: background first
Fallback: foreground input with confirmation
Overlay: optional

Mode C — Current interactive desktop mode

For cases where true physical desktop interaction is required.

Capture: desktop/window as needed
Input: foreground
Overlay: enabled

Why this matters for Codex specifically

Computer Use inside a coding agent has different requirements from a general-purpose GUI assistant.

A coding-agent workflow repeatedly performs:

edit
→ build
→ launch
→ inspect
→ click
→ verify
→ edit

The target application is often already known.

Therefore Computer Use does not need to behave like an agent taking over the whole physical desktop.

For development workflows, target-window automation should be a first-class mode.


Security / privacy benefit

Window-scoped capture would also improve privacy.

When the target is:

MyApplication.exe

the model should ideally receive only:

MyApplication.exe pixels

rather than potentially capturing:

  • email
  • messaging applications
  • browser windows
  • IDE content
  • unrelated desktop notifications

A strict target-window mode provides a much cleaner security boundary.


Suggested acceptance criteria

A future Windows Computer Use version would ideally support:

  • enumerate and select target HWND
  • capture only selected HWND
  • capture an occluded target window where technically possible
  • no blue overlay when configured
  • no agent cursor animation when configured
  • return screenshot directly to the model
  • client-relative coordinates
  • background click
  • background double-click
  • background right-click
  • background drag
  • background mouse wheel
  • background text/key input
  • explicit foreground fallback
  • no silent takeover of physical mouse/keyboard
  • no monitor capture when strict window mode is enabled
  • screenshot identity is validated against the requested target HWND

Expected result

For a target application running behind another window:

Visual Studio / IDE remains foreground
User continues using mouse normally

Target.exe remains background
        ↓
Computer Use captures Target.exe
        ↓
model sees target screenshot
        ↓
model determines (x, y)
        ↓
Computer Use sends background click
        ↓
captures Target.exe again
        ↓
model verifies result

There should be:

No full-desktop visual overlay
No physical mouse movement
No foreground-window stealing
No significant Windows/DWM stutter

Additional note

There are already third-party/open-source Windows automation implementations that demonstrate that a useful subset of this architecture is practical using combinations of:

HWND
PrintWindow
Windows Graphics Capture
PostMessage
WM_CHAR / WM_SETTEXT
client-relative coordinates

It would be very useful if the official Codex Computer Use plugin exposed this as a supported Windows mode instead of requiring external MCP tools for desktop application testing.

Additional information

#36091 — System-wide lag disappears after stopping codex-computer-use.exe, suggesting that the Computer Use process or its capture/compositing path can significantly affect Windows desktop responsiveness.
#36677 — Codex Windows app becomes noticeably laggy or unresponsive when Computer Use is enabled, while disabling Computer Use restores normal responsiveness.
#38710 — Active Codex sessions can cause mouse lag, DWM stuttering, and degraded responsiveness across the Windows desktop.
#36603 — The screenshot returned by Computer Use may not always correspond correctly to the requested target window. This also highlights the need for a strict target-HWND capture mode for both correctness and privacy.

Activity

  1. added
    enhancement
    on Aug 28, 2026
  2. added
    app
    windows-os
    on Aug 28, 2026
  3. syudofu2 commented on Sep 25, 2026

    @syudofu2

    I'd like this too. On macOS, Computer Use uses its own cursor, so I can keep working in other apps while Codex operates. Please bring the same independent-cursor behavior to Windows, so Computer Use can interact with an app without taking over my mouse or interrupting my work.

  4. Zaid-Yousef commented on Sep 26, 2026

    @Zaid-Yousef

    This would be very useful, its really annoying that it uses the same cursor as the user, I can't do anything while its working if it needs computer use.

  5. telion2 commented on Sep 30, 2026

    @telion2

    I would like an optional isolated workspace for Codex Computer Use. While Codex interacts with apps, I want to keep using my current desktop, mouse, keyboard, and focused windows without interruption. Windows virtual desktops are a useful mental model, but the implementation may need a separate interactive session, VM, offscreen window control, or another approach that truly isolates input and focus; merely switching virtual desktops would not meet this need.

    Please make it possible to inspect the agent workspace, pause or take over when needed, and retain the existing per-app permission boundaries. This would let long GUI tasks run while I continue my own work. I would also value the same capability on Linux when Computer Use becomes available there.

  6. moz65535 commented on Sep 30, 2026

    @moz65535

    I reproduced an OS-level side effect of the Computer Use overlay/session on Windows 11 26H2.

    Using SHQueryUserNotificationState sampled once per second:

    idle            -> 5 = QUNS_ACCEPTS_NOTIFICATIONS
    Computer Use    -> 2 = QUNS_BUSY
    session released -> 5 = QUNS_ACCEPTS_NOTIFICATIONS
    

    In my test, QUNS_BUSY remained active even after the last actual UI operation had completed. It only returned to QUNS_ACCEPTS_NOTIFICATIONS when the Computer Use execution session was released.

    So a no-overlay / non-intrusive mode would be useful for more than visual preference: while the overlay/session is active, Windows treats the desktop as busy and can suppress notification banners.

    I also added the detailed timing/logs to #46675:
    #46675

    This makes a no-overlay option (or a mode that does not trigger the Windows busy/full-screen notification state) especially valuable on Windows.

  7. AyeItsMilkyJ commented on Oct 12, 2026

    @AyeItsMilkyJ

    Adding another Windows use case for this feature request, posted on the account owner's behalf with permission.

    Environment: Windows 11, multiple monitors, Codex desktop app with Computer Use.

    The desired workflow is to let Codex test a native Windows desktop application on a secondary monitor while the user keeps working or gaming on the primary monitor. Moving the target application to another monitor does not isolate the physical mouse, keyboard or foreground focus, so the two workflows interfere.

    We understand this is a documented Windows limitation, not necessarily a regression. The current official guidance recommends running the ChatGPT desktop app inside a Windows VM for independent desktop use.

    Could the team recommend a supported workaround, and consider a first-class isolated Windows automation workspace or guest-connected controller? Merely controlling a VM/Sandbox's outer window from the host would still share host input; the controller would need its own input context.

    Important requirements would be no silent foreground-input fallback, visible activity/progress, an immediate pause/takeover control, and unchanged approval/privacy safeguards. Browser-controlled testing helps for web interfaces but does not cover native file dialogs, installers or the installed desktop application.

    Is there an existing supported setup for this today, or an implementation being considered? No project files, logs, screenshots or chat history are attached.

  8. monnerHenster commented on Oct 19, 2026

    @monnerHenster

    Supporting this request. Could Windows Computer Use offer an independent cursor or background-control mode, similar to the macOS background experience? I would like Codex to operate its target app while I continue using my own mouse and keyboard in other apps, without competing for the pointer or stealing foreground focus.

  9. antoniointini commented on Oct 19, 2026

    @antoniointini

    Adding my Windows use case: I use Codex Computer Use with native desktop applications such as Software Ideas Modeler for UML modeling. I would like Codex to work in that application while I continue typing and clicking in other applications, without either of us interfering with the other.

    This should work even with two windows on the same widescreen monitor. I also have a two-monitor setup, but moving the target application to the second monitor does not solve the shared mouse, keyboard, and foreground-focus problem.

    The key requirement is independent input and focus for the selected target window, including its dialogs, with no silent fallback that takes over my own input. A visible pause/takeover control would still be important.

    The complementary request for restricting activity to selected displays is #36019; window/input independence and display restrictions solve different parts of this workflow.

    Could the OpenAI team confirm whether independent/background Windows Computer Use is planned or under active development? Is there a public roadmap, target release, or estimated timeframe? If there is no ETA yet, is there an officially supported setup for this workflow today?

  10. GuilhermeP96 commented on Oct 20, 2026

    @GuilhermeP96

    Additional design/acceptance criteria for testing a Windows application while I continue working. These are proposed client requirements, not a reproduction of Codex internals:

    The workflow is testing an application built by the current coding task while the user continues working. A target-window mode would benefit from explicit capability reporting: supported capture/input/UIA operations, known rendering limitations, and whether foreground access would be required. Unsupported operations should return that limitation rather than silently falling back to global mouse/keyboard input.

    Suggested acceptance tests:

    • Bind every operation to the approved application/window and its owned dialogs; reject element IDs from a different session.
    • Bound accessibility reads by target, depth/item count and timeout; offer focused reads, with screenshots retained for visual validation.
    • Pause agent mutations server-side during human takeover, and require explicit return of control.
    • On cancellation/disconnection, clean up only task-owned resources; verify a second session remains usable.

    An isolated Win32 desktop is not a VM/security sandbox, and window-scoped input does not work for every application. VM/RDP-based alternatives need separate compatibility, licensing and permission assessment; I have not validated RDP Child Sessions. This complements #51134 without assuming its proposed mechanism is universally available.

    These are proposed integration-test criteria, not a request to bypass Codex app approvals, sandbox restrictions, login/2FA, or terminal/ChatGPT automation restrictions. No external code PR is being proposed.

  11. Quiyyy commented on Oct 26, 2026

    @Quiyyy

    I'd love to see Windows support background, window-scoped Computer Use similar to macOS, so Codex can interact with a target application without taking over the entire desktop or interfering with the user's mouse and keyboard. A small PiP preview would also be helpful.

    UI Automation with foreground fallback for unsupported applications would be a reasonable starting point. This would let developers continue working while Codex independently tests and interacts with GUI applications.

  12. monnerHenster commented on Oct 27, 2026

    @monnerHenster

    @Quiyyy Using UI Automation instead of foreground Computer Use where possible sounds like a really good idea.

  13. moruku36 commented on Oct 29, 2026

    @moruku36

    I'm affected by this too. I use Windows with three monitors. In my experience, even when Computer Use operates on just one monitor, I cannot continue using the other two for my own work without interference.

    I'd like to restrict Computer Use to a designated monitor while independently using my mouse and keyboard on the remaining monitors. Keeping the agent's activity on one screen should not prevent me from working on the others.

  14. Chizuruscom commented on Nov 5, 2026

    @Chizuruscom

    I'd really like Windows Computer Use to support the same kind of background interaction I can use on macOS.

    Right now, Codex takes over my mouse and keyboard focus whenever it operates a Windows GUI, so I can't continue working on the same computer. Please add an optional mode with independent input/focus, visible progress, and a way to pause or take over when needed.

    Projects like Anode show that a separate Windows child session may be one possible approach (see #51134). I'd much rather have this supported directly in Codex than set up a separate VM or third-party workaround.

    The goal is simple: let me and Codex use the same PC at the same time.

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

    appcomputer-useenhancementperformancewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions