Skip to content

[Windows][Computer Use] Accessibility monitor reads unrelated foreground app and can hang it via UIA BuildCache #43692

Open

Description

@parahelox

Summary

On Windows, the bundled Computer Use native helper appears able to perform a UI Automation cache read against the current foreground window even when that application is unrelated to the requested target application.

In the observed case, the Codex task was working with Chrome, but the Computer Use helper's background accessibility monitor obtained the HWND of an already-running Everything window and called ElementFromHandleBuildCache against it.

Everything then became effectively hung/busy.

The user never requested Codex to inspect, search, activate, or control Everything.

Offline analysis of a captured process dump indicates that this was not caused by Codex launching Everything. Instead, codex-computer-use.exe followed an internal monitor path that obtains the current foreground window without carrying a specific target HWND.

This looks like a target/application-boundary problem in the Windows Computer Use accessibility monitor.

Environment

  • Codex Desktop on Windows
  • Bundled Computer Use / @oai/sky
  • Native helper: codex-computer-use.exe
  • Target application requested by the task: Chrome
  • Unrelated affected application: Everything
  • Everything was already running before the Computer Use helper started

Exact Codex/Computer Use build numbers were not captured in this diagnostic pass.

Observed timeline

Relevant timestamps from the captured run:

  • Everything had already been running since approximately 08:52.
  • 10:15:22.373 — the Chrome-related task called sky.list_apps().
  • 10:15:23.291 — sky.list_apps() returned.
  • Startup of codex-computer-use.exe corresponds to this stage.
  • 10:15:34.672 — the task later called Chrome get_window_state(..., include_text: true).

The important point is that the task was targeting Chrome. There was no explicit Everything operation.

Native dump evidence

Offline WinDbg/disassembly analysis of the saved codex-computer-use.exe dump found an accessibility-monitor path with approximately the following behavior:

monitor queue / message processing
        ↓
no concrete target window / state == -1
        ↓
internal branch
        ↓
GetForegroundWindow()
        ↓
Everything HWND
        ↓
ElementFromHandleBuildCache(...)
        ↓
UIA cache/tree read against Everything

In the captured monitor thread:

  • the native frame still contained the Everything HWND (0x5516AA);
  • relevant frame state values were 0xffffffffffffffff, consistent with the branch that does not carry a concrete target-window payload;
  • an additional state value was 3, but its enum/type symbols are unavailable, so I am not claiming that 3 means focus-change, timer refresh, startup refresh, etc.;
  • disassembly confirmed an internal path that reaches GetForegroundWindow();
  • the resulting foreground HWND was Everything;
  • the helper subsequently entered ElementFromHandleBuildCache.

The dump therefore provides evidence that the helper actually performed a UIA cache read against Everything.

What is proven vs. not yet proven

Supported by the captured dump

  1. codex-computer-use.exe had an active background accessibility-monitor path.
  2. That path can obtain the current foreground HWND without using a specific requested target HWND.
  3. In this run, the HWND obtained by that path was the Everything window.
  4. The helper performed ElementFromHandleBuildCache / UIA cache construction against that Everything HWND.
  5. The user task itself was targeting Chrome, not Everything.
  6. Everything was not launched by this task; it had been running substantially earlier.

Not yet determined

The dump does not contain enough historical event tracing to determine exactly what woke the monitor for the first read.

Possible sources still include:

  • helper/startup initialization;
  • an accessibility or foreground-window event;
  • a periodic/timed monitor refresh;
  • an internal queue message;
  • another Computer Use initialization request.

I therefore do not want to claim which of those mechanisms triggered the first read without additional tracing.

Why this seems problematic

Application discovery and target control appear to be crossing two different scopes.

A task may explicitly target Chrome, but the helper's background accessibility monitor can independently do:

GetForegroundWindow()
→ build UIA cache for whichever application happens to be foreground

That means an unrelated desktop application can receive a potentially expensive accessibility-tree traversal merely because it was foreground at the wrong moment.

For applications with large, unusual, or slow UIA providers, this may cause significant latency or hangs.

It also appears inconsistent with the expectation that Computer Use inspection should remain scoped to the application/window selected for the task.

Expected behavior

Computer Use should not build a full UIA cache for an unrelated foreground application unless that application is explicitly part of the current Computer Use target/allowed scope.

For example:

target HWND/app = Chrome

monitor event
    ↓
GetForegroundWindow()
    ↓
if HWND/process is outside current authorized target set:
    do not perform ElementFromHandleBuildCache

Alternatively, monitor initialization/discovery should use lightweight HWND/process metadata and defer UIA tree/cache construction until a specific target application has been selected.

Actual behavior

A Chrome-related Computer Use task started the Windows helper.

The helper's background accessibility monitor independently obtained the current foreground window.

That window happened to be Everything.

The helper then performed a UIA ElementFromHandleBuildCache operation against Everything even though Everything was unrelated to the task.

Everything subsequently became unresponsive/busy.

Possible reproduction

A minimal reproduction to validate the suspected lifecycle would be:

  1. Start Everything and leave its window in the foreground.
  2. Start a fresh Codex Computer Use runtime.
  3. Target Chrome or another unrelated application.
  4. Execute only a low-risk discovery operation such as sky.list_apps().
  5. Trace:
    • helper process creation;
    • monitor queue events;
    • GetForegroundWindow;
    • returned HWND;
    • ElementFromHandleBuildCache.
  6. Check whether the foreground Everything HWND receives a UIA cache read before any explicit request to inspect Everything.

A useful timestamp sequence would be:

T0 helper process created
T1 list_apps request received
T2 monitor request/event queued
T3 GetForegroundWindow()
T4 unrelated HWND returned
T5 ElementFromHandleBuildCache(unrelated HWND)

If this happens during startup/discovery before a target-window inspection request, that would make the scope leak especially clear.

Suggested fix / invariant

The Windows accessibility monitor should maintain an explicit target/authorized HWND or process set.

A full UIA cache/tree read should only occur when the HWND belongs to that set.

If the monitor needs to observe foreground changes globally, it should first perform only lightweight HWND/PID checks and avoid constructing an accessibility cache for out-of-scope processes.

Related issue

Additional note

No application code was modified during this investigation. The conclusions above come from saved dump/binary analysis rather than modifying Everything or forcing additional searches after the incident.

Activity

  1. added
    bug
    app
    windows-os
    on Sep 8, 2026
  2. dmitrijneumytov-crypto commented on Oct 29, 2026

    @dmitrijneumytov-crypto

    Windows Computer Use: sustained Word CPU after a completed turn with a Word deny rule

    The existing report concerns another application and does not establish the mechanism in this Word and Excel case. The following measurements may help investigate it.

    User observations on the main computer

    • Word 2003 became slow during typing and scrolling. On two occasions, the user reported that it worked normally after the ordinary codex-computer-use.exe helper was stopped.
    • Excel 2003 later became slow. After the ordinary helper was stopped, the user reported that Excel worked normally again. The separate codex-computer-use-swift.exe process was left running.
    • These are user-reported before/after observations. They do not establish which internal calls caused the delays or whether every helper instance belongs to the same task.

    Isolated guest environment

    • Windows 11 Pro, build 26200, Hyper-V virtual machine.
    • Codex desktop package 26.1023.6123.0; @oai/sky version 0.7.13.
    • Word 2003 executable file version 11.0.8411, with the Office compatibility pack installed. A generated 44-page synthetic DOCX was open; no user document was used or saved.
    • The main computer's currently installed Codex package is 26.1023.6621.0 on Windows 11 build 26300. This differs from the guest package, so the guest result is not a version-identical host reproduction.

    Guest reproduction and comparison

    The same guest Word process and synthetic document were kept in the foreground. A separate monitor sampled process identity, foreground status, Windows Responding, and cumulative CPU time approximately once per second. CPU times below are sums of process CPU time, not elapsed time or machine-wide CPU percentages. Both scenarios used an actual ephemeral app-server turn and observed turn/completed with status completed.

    1. A — no deny rule: In a fresh test session, Computer Use was allowed to read the synthetic Word window. One node_repl/js call used sky.list_windows() and then sky.get_window_state() on the selected Word window, with include_text: true and include_screenshot: false. The call succeeded and returned an accessibility tree. After the turn completed, Word remained foreground and Responding=true in all 121 samples over approximately 120 seconds. Word accumulated 71.46875 s CPU; the ordinary helper accumulated 42.234375 s CPU and was present in all samples.
    2. B — Word deny in the real guest user profile: Install a temporary, signed-executable identity rule for Word 2003 with access = "deny" in the guest's actual user configuration. A new app-server's config/read confirmed the rule in both the user layer and effective configuration; no -c override was used. Set up the Word foreground state before enforcing the rule. In a real turn under the rule, select an existing visible, unminimized Notepad window and call sky.get_window_state() for Notepad only. Do not call Computer Use on Word. The Notepad call succeeded, although its accessibility result was null. After the turn completed, Word remained foreground and Responding=true in all 122 samples over 121.006 seconds. Word accumulated 73.71875 s CPU; the ordinary helper accumulated 41.8125 s CPU and was present in all samples.
    3. Recovery after B: Stop only the test app-server, allowing its ordinary helper to exit. Leave Word and the separate Swift helper running. In the subsequent 29.984-second observation, Word remained foreground and Responding=true in all 31 samples and accumulated 0.046875 s CPU; no ordinary helper was observed in the samples. The original guest configuration, owner and ACL were independently verified restored. Other sessions were not stopped.

    The A and B operations target different applications and are not identical workloads. The key observation is that the validated user-profile deny configuration did not prevent sustained Word CPU use in the described B scenario. config/read establishes the app-server configuration; it does not prove what configuration the native helper loaded or how it applied the rule. The Notepad result does not establish its document contents, typing, or scrolling.

    An additional real-turn probe confirmed that the packaged metadata builder produced nonempty session_id and turn_id. After a successful Notepad call and completed turn, Word accumulated 35.265625 s CPU and the ordinary helper 22.5 s over approximately 61 seconds; Word CPU was 0.015625 s over the following approximately 30 seconds after the test app-server ended and the ordinary helper disappeared. The metadata values were not compared with the notification identifiers, and delivery or handling of end_turn was not established.

    Earlier, a restricted real UI Automation trace captured version-0 events from a candidate helper but did not find matching Word peer events. It therefore did not prove direct helper-to-Word calls or their absence. No claim is made that the foreground-monitor path in #43692 is the proven cause here. Windows Responding=true does not establish acceptable typing or scrolling latency, and one-second samples cannot rule out shorter events between samples.

    Expected behavior and request to maintainers

    With Word excluded, a Computer Use turn operating on another permitted application should not leave Word under sustained accessibility-related load. After a completed turn, background monitoring should release or idle resources that are no longer needed. Please investigate whether the native foreground-monitor path checks the effective user and managed app policies before constructing a UIA cache, how the helper receives those policies, and whether turn completion stops or limits the monitor. Please provide a supported fix or documented per-app exclusion that preserves Computer Use for other windows, plus a way to verify the effective native policy and lifecycle.

    No credentials, account information, personal paths, document text, screenshots, raw event traces, or unrelated application contents are included in this comment.

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