orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: Orca periodically causes system-wide keyboard focus loss on Windows

Open kin001 opened this issue 4 months ago • 4 comments

Operating system

Windows

Orca version

1.4.126

Details

Short summary: While Orca is running, the currently active text input anywhere on the system intermittently loses keyboard focus every few minutes. This is not limited to inputs inside Orca: it also happens while typing in other apps, including the Codex editor. After it happens, keystrokes no longer go into the active field until I click the input/window again with the mouse.

What happened?

  • I am actively typing in any app/window, not necessarily Orca.
  • Every few minutes, the active input suddenly stops accepting keyboard input.
  • The visible window remains on screen, but it no longer seems to be the active/focused target.
  • Clicking the input or window restores typing immediately.
  • This makes longer typing sessions unreliable because text entry can be interrupted without warning.

How can we reproduce it?

  1. Run Orca on Windows.
  2. Focus a text input in any application, for example the Codex editor, a browser text box, a terminal, or an Orca input.
  3. Keep typing or intermittently type for several minutes.
  4. Observe that keyboard focus is lost system-wide and the active input stops receiving keystrokes until it is clicked again.

Expected behavior: Orca should not steal or drop keyboard focus from the user's active application/input. Background work such as polling, browser/webview parking, automation visibility work, update checks, or diagnostics should not affect foreground input focus.

Environment:

  • OS: Windows 11 Pro 64-bit, version 10.0.26100
  • Orca version observed locally: 1.4.126

Additional context:

  • I checked the releases page: v1.4.126 is currently marked as the latest stable release, and v1.4.127-rc.2 is a pre-release.
  • I did not see an explicit v1.4.127-rc.2 release-note entry saying that periodic system-wide focus loss is fixed.
  • I noticed focus-before-webview-hide/detach handling already exists in both 1.4.126 and v1.4.127-rc.2, so this may be another focus path or an unhandled case.

kin001 avatar Jul 07 '26 08:07 kin001

I can also reproduce this bug on Windows 10, so I've fallen back to v1.4.97 I hope this gets fixed soon.

wupei93 avatar Jul 07 '26 10:07 wupei93

I'm Windows 11 and I also have this problem. Moreover, the frequency of its occurrence is increasing gradually.

hareGuu avatar Jul 08 '26 01:07 hareGuu

Agent reproduction package (Windows orchestration 2026-07-16)

Host context: Windows 11 / Orca 1.4.143.0 / repo path used: docs/bug-reproductions/
Labels applied: see issue labels (has_repro or cannot_repro).
Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.


Issue 7703 — System-wide keyboard focus loss while Orca runs

Status: attempted / inconclusive (intermittent; no label)
Host: Windows 11, Orca 1.4.143
Label: (none — needs long soak)

Summary

Reporter (1.4.126): every few minutes, keyboard focus is lost system-wide (including other apps) until mouse re-click. Suspect background focus steal (webview park, update UI, etc.).

Attempt on this host

  1. Confirmed Orca running (status ready, pid 13120).
  2. Short foreground-window sampling (~60–90s) while Orca idle/active automation load present.
  3. No conclusive focus-loss event attributed to Orca in the short window.
  4. GetForegroundWindow sampling was noisy under the automation host (empty titles / pid 0 in one probe script).

Expected vs actual

Expected (bug) Periodic system-wide focus drop every few minutes
Actual Not observed in ≤90s automated sampling

Evidence

  • docs/bug-reproductions/evidence/7703-20260716-023110.json
  • docs/bug-reproductions/evidence/7703-20260716-023110.log

Next steps

  • Multi-hour soak with reliable FG tracking (winEventHook FOREGROUND) while typing in Notepad + Orca open.
  • Correlate with Orca main logs around focus/webview hide/update popup paths.

How another agent should use this

  1. Read this comment fully (status, expected vs actual, blockers).
  2. If a script is included above, copy it to a temp file and run it on a Windows 11 host with Orca installed (prefer production install under %LOCALAPPDATA%\Programs\orca).
  3. Capture evidence (CLI --json, screenshots, logs) under a local folder; optionally comment results back here.
  4. If status is cannot_repro / needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: remove cannot_repro, add has_repro when conclusive.

OrcaWin avatar Jul 17 '26 00:07 OrcaWin

I traced this to the Windows foreground-process scan fixed by #8053.

The failing path repeatedly launched powershell.exe, or the wmic fallback, without windowsHide while an agent session was open. Because Electron's main process has no attached console, Windows created a short-lived conhost window for each scan. That window could take foreground activation away from any application, matching this issue's system-wide focus loss, recurring cadence, and immediate recovery after clicking again.

The fix added windowsHide: true to both probes plus regression coverage. This issue was reported on 1.4.126; the fix is present in the v1.4.138 stable tag and later. The short reproduction attempt on 1.4.143 also did not observe the old behavior, which is consistent with that release boundary.

Closing this as fixed by #8053. If the same symptom recurs on a current build, please reopen with whether an agent session was active and a foreground-window trace so a separate focus path can be distinguished from the repaired conhost spawn.

kin001 avatar Jul 17 '26 03:07 kin001