Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Browser automation steals composer focus across threads #5792

ClosedAksharP5(GitHub profile, opens in a new tab) opened this issue 6 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

Same-thread case:

  1. Open a thread in T3 Code Desktop.
  2. Open its browser preview.
  3. While the agent is using the preview, focus the composer and begin typing.
  4. Have the agent call preview_press, such as pressing Tab.
  5. Observe the composer focus.

Cross-thread case:

  1. Let the agent continue browser automation in thread A.
  2. Switch to thread B.
  3. Focus thread B’s composer and begin typing.
  4. When thread A calls preview_press, observe thread B’s composer focus.

Expected behavior

Browser automation should not interrupt typing in the composer. This should remain true whether the automation belongs to the visible thread or a background thread.

Actual behavior

When the agent calls preview_press, the composer loses focus and typing stops until it is focused again. Automation from a background thread can steal focus from the composer in the currently visible thread.

The desktop press implementation focuses the preview guest WebContents and later restores the outer renderer, but it does not restore the renderer’s active DOM element. Preview automation is hosted per environment rather than per visible thread, which explains the cross-thread behavior.

Related but not duplicate to #3715: that issue concerns unreliable delivery of agent key presses to the preview. This issue concerns the resulting loss of human composer focus, including across threads.

Impact

Major degradation or frequent failure

Version or commit

main @ ba9c9ae81

Environment

T3 Code Desktop OS: Arch Linux Provider: Codex

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Click the composer again after browser automation takes focus. Avoid preview_press while composing when possible.

  1. AksharP5(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. AntoineArt(GitHub profile, opens in a new tab)commented

    Still hitting this on desktop 0.0.35-nightly.20260826.1193 (Arch Linux, AppImage) while typing in the composer.

    Every agent preview interaction (not just preview_press) steals focus from the composer. Especially painful when writing a follow-up while the agent is clicking through a running browser in the same or another thread.

    Workaround remains: click the composer again after each automation step.

    Related open PRs that look like they try to fix this but are unmerged: #4118, #5874, #5894, #5898.

  3. Confirmed here as well, Arch Linux, happens almost constantly

  4. Fixed by #11354 — background preview keystrokes (including Enter) are kept out of the desktop composer so automation no longer sends unfinished drafts or steals composer typing across threads.

  5. juliusmarminge closed this

  6. This issue is still happening on Microsoft Windows (Latest Nightly as of this writing)

  7. I am also still seeing this issue on a Mac. Golden Gate 27.2. I have agents running browsers doing manual testing and lose text focus repeatedly.

  8. yeah still seeing this on latest nightly, latest macos!

Sign in to join this conversation.