Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(cua): float the window the agent drives over chat #16531

Draftjuliusmarmingewants to merge 1 commit intot3code/cua/4-setup fromrefs/pull/16531/headopened View on GitHub

juliusmarmingecommented

While a computer use turn runs, the web and desktop clients float the window the agent is driving over chat, like an agent-opened device. This is the live preview card from #10899.

  • The server captures the window the agent last targeted (the desktop before it names one) every 1.5 seconds and streams small frames over subscribeCuaWindowPreview.
  • The loop runs only while a client watches and a turn with Cua attached is in flight. It stops, and releases its native handle, as soon as either ends, so a closed card costs the host nothing.
  • Between turns the card keeps its last frame. It shows the app's icon and window title, and says why when the host cannot capture.
  • It follows Auto-show floating preview. A browser or device the agent already floats keeps its place.
  • It works for every provider and host OS, because the capture uses Cua's own get_window_state.

The capture now follows V2 provider turns (provider-turn.updated) instead of the V1 provider service.

  • While a run drives the computer, the composer shows Using your computer with Stop, in every provider (from #15006).

Verification

  • Focused tests: the capture loop starts and stops with subscribers and turns; the card's selector finds the newest computer use call in any provider; mini-player store and ChatView logic.
  • Checked by hand: the 0.34 SDK capture call against this Mac's driver. Without Screen Recording it fails with "could not create image from display", which is the reason the card shows.
  • Not yet verified in a running client. A recording will follow.

Built with Claude Opus 5.5 in T3 Code, through the Claude Code harness.

🤖 Generated with Claude Code

    1. Pushed546c0b1

    2. Pushedc638ebc

Sign in to join this conversation.