[Bug]: preview_type reports success but text never reaches the preview input, and leaks into the user's focused T3 field #17478
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#
Serve a page with a single input locally, e.g.
python3 -m http.server 8799over:<label>Name <input id="name" aria-label="Name"></label> <button onclick="console.log('value', document.getElementById('name').value)">Greet</button>While the user has keyboard focus in an editable field in the T3 desktop app, have an agent call:
preview_open{ "url": "localhost:8799" }(defaultopen: true), thenpreview_type{ "locator": "role=textbox[name='Name']", "text": "Jason" }(also triedclear: trueand anaria-ref=locator frompreview_snapshot)preview_press{ "key": "J" },{ "key": "o" }
Read the input with
preview_evaluatedocument.getElementById('name').value.Repeat with a fresh background tab:
preview_open{ "open": false, "reuseExistingTab": false, "url": "http://127.0.0.1:8799/" }, thenpreview_type{ "text": "zq" }on the same input.
Expected behavior#
The text is inserted into the targeted input in the preview tab, and nothing reaches the T3 UI. If text can't be delivered, the tool returns an error instead of success.
Actual behavior#
- Every
preview_type/preview_presscall returns success, but the page's input stays empty (preview_evaluatereturns"", withdocument.activeElementbeing the input anddocument.hasFocus() === true). - In the inline tab (
open: true), the typed text ("Jason", "J", "o") landed in the field the user had focused in the T3 desktop app instead. - In the background tab (
open: false), the text also never reached the page. preview_click,preview_navigate,preview_snapshotandpreview_evaluateall worked normally in both tabs. The preview reportedvisible: falsethroughout, including afterpreview_openwithopen: trueon the existing tab.
This looks like the keystroke leak from #3715 / #5792 again, now via preview_type, on a build that includes #11354. #10980 also describes preview_press reporting success without the key reaching the page.
Impact#
Major degradation or frequent failure
Version or commit#
0.0.46-nightly.20261008.2833
Environment#
macOS 26.6.2 (Apple Silicon), T3 Code Desktop (Nightly), provider Claude (claude-opus-5-5), local environment
Workaround#
Set input values with preview_evaluate (assign .value and dispatch an input event) instead of preview_type / preview_press.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
What happened#
The same failure occurs on
0.0.46-nightly.20261009.2886on macOS.With the collaborative browser sidebar visible beside chat,
preview_typesends sample email/password text into the T3 chat composer instead of the targeted website inputs. The tool returns success, but both website fields remain empty.The user reports that closing the browser sidebar makes filling work.
Expected behavior: text reaches only the targeted website input, the chat composer remains unchanged, and failed delivery does not report success.
Diagnosis#
The source at installed commit
aa8c6662e212supports the focus-routing hypothesis already discussed here:ServerBrowserPage.typecallslocator.fill()when a locator andclear: trueare supplied. Other typing usespage.keyboard.insertText(). Neither branch verifies the resulting field value.- Installed bundled Playwright inspection found that filling these text controls can fall back to keyboard insertion, ultimately using CDP
Input.insertText. ServerBrowserContextsconnects desktop pages over CDP.DesktopBrowserHostandCdpRelayforward commands to the guest debugger without special handling for text input.- The older desktop implementation edited inside the guest runtime to avoid hidden-guest
Input.insertTextproblems. Its keyboard-routing comment explicitly describes CDP input following embedder focus.
The suspected mechanism is that native/embedder focus determines input delivery despite DOM focus inside the guest. This remains a source-supported hypothesis, not an isolated Electron-level proof.
Steps to reproduce#
- Open T3 Code Nightly desktop on macOS.
- Open
https://semantic-ui.com/examples/login.htmlin collaborative preview. - Leave the browser sidebar visible beside chat.
- Ask the agent to fill sample credentials without submitting.
- Have the agent call
preview_typeusing snapshotaria-reflocators andclear: true. - Inspect both website input values and the chat composer.
Observed: the tool reports success, the website fields remain empty, and the user sees the supplied text in the composer.
Version#
Desktop:
0.0.46-nightly.20261009.2886, commitaa8c6662e212.The separately invoked
npx t3 triagereports CLI version0.0.45; that is not the affected desktop version.Environment#
macOS, Apple Silicon, Darwin
27.0.0. T3 Code Nightly desktop with its integrated collaborative browser. Triage CLI runtime: Nodev26.8.2.Evidence#
- Earlier tool verification found both website inputs empty after successful
preview_typecalls. - The user observed text entering the chat composer.
- A supplied screenshot shows chat beside the login form, with both website inputs empty. It establishes the layout and empty fields, not the input-routing mechanism.
- Direct
preview_evaluateassignment of the guest input values worked.
No fresh sidebar-open/sidebar-closed comparison or native-focus instrumentation was performed. The sidebar workaround is user-reported. No additional input was injected during this triage follow-up.
Suggested regression coverage: an integrated Electron test with the composer focused and browser sidebar visible, asserting that
preview_typewith snapshot references andclear: trueupdates only the guest inputs. Include sidebar-closed coverage and failed-delivery reporting.Related issues#
This adds evidence to #17478 rather than opening a duplicate.
Fix applied or workaround#
No fix applied. Closing the sidebar reportedly permits filling. Direct guest value assignment through
preview_evaluateworked in the investigation.Filed by#
Codex with GPT-6.1-Sol, via
npx t3 triage.Also reproduces on Linux, and later calls on the tab then time out#
Same failure on
0.0.46-nightly.20261009.2886(AppImage) on Linux (CachyOS, kernel 7.2.9), provider Claude (claude-opus-5-5), local environment. Two details differ from the reports above:- It happened with background tabs, not only the inline preview. The user was not typing anywhere. The T3 window simply had the chat open, and the text meant for the page appeared in the thread's chat composer.
- After the misrouted typing, every later call on that tab timed out instead of working normally:
preview_click(15 s),preview_wait_for(20–30 s),preview_snapshotand evenpreview_evaluatewith1+1(15 s). So the agent concluded the page had hung and spent a long time chasing a hang in its own app.
Steps#
preview_open{ "url": "<local dev server sign-in page>", "profileId": "incognito", "reuseExistingTab": false }. It returnedvisible: false,viewportSetting: { _tag: "fill" }and noviewportfield. An earlier tab in the same thread that worked reportedviewport: { width: 1280, height: 800 }.preview_type{ "locator": "role=textbox[name='Email address']", "text": "<email>" }and then the same forPassword. Both returned success.preview_click{ "locator": "role=button[name='Continue']" }: timed out after 15000 ms.- Every later
preview_*call on that tab timed out. - Repeated with a second incognito tab and a third default-profile tab (both
reuseExistingTab: false). Same result: the typing "succeeds", the next interaction hangs, and the page never sends its sign-in request (confirmed in the server logs).
Earlier in the same long-running thread, the identical sign-in flow worked in a tab opened with the default
open: true. The failures started later, with tabs opened in the background.Expected#
Text reaches only the targeted input in the target tab. If it can't be delivered, the call fails with an error. Later calls don't hang.
Impact#
- A password ended up in the chat composer. It was a local demo credential here, but agents filling sign-in forms can leak real secrets into the composer, where they could be sent as a message.
- The timeouts look like an app freeze, which sends the agent off debugging the wrong problem.
Workaround#
As noted above, setting values with
preview_evaluateshould avoid the keyboard path. In this case evenpreview_evaluatehung once the tab was in this state, so the only recovery was opening a fresh tab and avoidingpreview_typeentirely.juliusmarminge closed this
confirming the same failure on macOS with desktop bundle 0.0.46-nightly.20261011.2980, using Codex/GPT-6.1-Sol.
preview_type returned success for top-level inputs in an embedded browser form, but DOM readback showed every target input empty. the activeElement was the intended input. trying again without clear=true also left the target empty. the user supplied a screenshot showing the harmless reviewer username in T3's chat composer instead.
preview_open also reported visible=false despite open=true/show=true. setting the guest input's native value and dispatching input/change events worked, and the saved form was verified by closing and reopening it. no additional keyboard input was injected to reproduce the failure during this follow-up.
this build predates #18556, so this is not a claim that the fix regressed. #20331 says 0.1.1-nightly.20261016.3203 and later include the fix. an updated-build reproduction has not been run.
please keep coverage for visible and background desktop previews while the composer has focus, including clear=true and failed-delivery reporting. no credentials, account details, session IDs, or private screenshots are included here.
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the detailed repro and the
preview_evaluateworkaround. From reading main atec80933ac(not reproduced), this looks like a regression from the server-browser move rather than #11354 failing.How text is delivered now. Since #15328 (merged 2026-10-06), desktop tabs are no longer typed into by the desktop's own keyboard code. The server drives them with Playwright:
preview_typeends inpage.keyboard.insertText(ServerBrowserPage.ts:260-320), withclear: true+ locator going throughlocator.fill(L263-L265), andpreview_pressis a barepage.keyboard.press(L403-L405), dispatched from ServerBrowser.ts:1922-1929. For a desktop tab, those CDPInput.*commands are relayed straight to the<webview>'swebContents.debugger(CdpRelay.ts:1-10, DesktopBrowserHost.ts:114-120). There is nowebContents.focus(), focus emulation, or host-side suppression on that path. Chromium appears to route CDP key/IME input for a guest<webview>to the focused widget of the embedding window, so when the T3 UI holds focus the text can land there. That matches the leak #11354 described and fixed for the old path.#11354. It added
PreviewKeyboard.ts(native key packets for the focused preview frame, suppressing forwarding to the desktop). #15328 deleted that file, and nothing equivalent is on main, so your build has #11354 in history but not on the code path thatpreview_typeuses today. Open #8494 (and #3715) also target the removedPreviewKeyboard.ts/ desktop IPC path, so they don't seem to cover this.Background /
visible: falsetabs. An inactive webview sits off-screen withvisibility: hiddenandpointer-events: none(hostedBrowserWebviewStyle.ts:66-74) and is not the focused webContents, so DOM focus inside the page (yourdocument.activeElementcheck) doesn't seem to be enough for the routed input to arrive.Success without delivery.
typeonly checks that the target is an editable field and takes DOM focus (L266-L315), then returns afterinsertTextwithout reading the value back;presshas no check at all. A read-back of the field after typing (and an error on mismatch) would turn this into a visible failure.Possible direction: deliver desktop-tab text inside the page (or reinstate #11354-style frame-targeted input/suppression in the relay), and verify delivery before reporting success. Related: #3715, #8494, #5792 / #11354, #10980, #15328.