Repository navigation
[Bug]: preview_type reports success but text never reaches the preview input, and leaks into the user's focused T3 field #17478
Description
Activity
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.
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 9, 2026 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.
Before submitting
Area
apps/desktop
Steps to reproduce
Serve a page with a single input locally, e.g.
python3 -m http.server 8799over: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
preview_type/preview_presscall returns success, but the page's input stays empty (preview_evaluatereturns"", withdocument.activeElementbeing the input anddocument.hasFocus() === true).open: true), the typed text ("Jason", "J", "o") landed in the field the user had focused in the T3 desktop app instead.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 describespreview_pressreporting 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.valueand dispatch aninputevent) instead ofpreview_type/preview_press.