Repository navigation
feat(cua-driver): add display_only to get_window_state for live previews - #4881
Merged
Merged
Conversation
T3 Code's window preview polls get_window_state every 250 ms. On macOS and Windows each poll replaced or re-owned the agent's snapshot for that window, so the agent's element tokens and pixel frame went stale between its own reads. display_only:true (with include_accessibility_tree:false) returns the window's pixels without publishing, refreshing or removing a snapshot and without registering an action capture. It maps onto the existing internal observation-only read on macOS, Windows and Linux, and its schema text, refusal and response fields (display_only, frame_note) match T3 Code's Linux patch, so T3 detects it from the tool schema with no change. Plain screenshot-only reads on Windows and Linux now refresh the current snapshot's frame in place, as macOS already does, instead of publishing an empty snapshot that staled every token. The live smoke checks that tokens stay valid after 8 display_only reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
macOS live check (Lume VM, Calculator, build of this head): 5/5 pass.
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
T3 Code embeds Cua Driver and shows the window the agent drives in a picture-in-picture preview. Its PR pingdotgg/t3code#16975 polls
get_window_stateevery 250 ms. On macOS and Windows each poll replaced or re-owned the agent's snapshot for that window:Either way, the agent's tokens or pixel actions failed between its own reads, which looks like a flaky driver ("stale token", "no screenshot owned by this session"). T3 fixed this only for Linux, in its own patch of our 0.34.0 source.
What
display_only:trueonget_window_state(requiresinclude_accessibility_tree:false). It returns the window's pixels and metadata, but publishes, refreshes and removes no snapshot, and registers no action capture. It maps onto the existing internal observation-only read on macOS, Windows and Linux. On macOS it also skips thebackground_inputprobe, since the frame cannot ground input."display_only" in input_schema.properties. The property is added in the sharedwindow_state_view::extend_input_schema, so every backend advertises it.display_only requires include_accessibility_tree:falsematch T3's patch word for word.display_only:trueand the sameframe_note, plus the usualscreenshot_widthandscreenshot_height, which T3 requires.refresh_screenshot_for_session, as macOS already does). They no longer publish an empty snapshot that invalidated every token. A window with no element snapshot still gets one, as before.display_onlyin WORKFLOW.md.Not changed: a non-display-only screenshot read from another session still takes over the screenshot frame. That is the same session rule as before, and
display_onlyis the way for a viewer to avoid it.Tests
display_only_refuses_accessibility_snapshot_requests, plus a schema check (macOS run locally; Windows and Linux in CI).tokens stay valid after 8 display_only reads, on Windows (WinForms) and Linux (GTK3/Xvfb). It also covers:tools/listadvertises the property;display_only/frame_note/dimensions and nosnapshot_id/capture_id/invalidated_snapshot_ids;display_onlyis refused;Credit
The
display_onlycontract is ported from T3 Code's Linux patch to Cua Driver 0.34.0 (pingdotgg/t3code#16975,patches/cua-driver-linux/0.34.0.patch). T3 Code is MIT-licensed, Copyright (c) 2026 T3 Tools Inc. The schema text, the refusal and the result fields match theirs. The THIRD_PARTY_NOTICES row comes with #4877. This supersedes #4878 (Linux only).Linear: CUA-1232
🤖 Generated with Claude Code