[Bug]: Optional 500 ms preview metadata timeout disconnects the automation host
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate of the specific optional-metadata timeout problem described here.
- I included enough detail to reproduce or investigate the problem.
Related: #12146 covers host eviction without re-registration. This report identifies a specific server-side eviction trigger: a best-effort metadata lookup with a 500 ms deadline disconnects the host even though its failure is caught and omitted from the original tool result. Fixing re-registration would aid recovery; optional metadata should also avoid evicting the host in the first place.
Area
apps/server
Steps to reproduce
Observed sequence (intermittent; the exact cause of the delayed status response is not yet isolated):
- Connect the Mac T3 Code desktop app to a Linux workspace through T3 Connect and open the thread's Browser panel.
- Open a private HTTPS web preview. Successfully use browser tools to navigate, fill forms, evaluate page state, and record flows.
- Continue normal browser automation. One captured occurrence followed a sign-out action; another occurred around recording completion. These are observed contexts, not established deterministic triggers.
- An optional post-action broker status request exceeds its 500 ms deadline. The trace below records the broker disconnect at that deadline.
- Subsequent navigate, evaluate, recording-stop, open and status calls report no available host. Restarting the Mac app and reconnecting restores control.
Suggested deterministic regression reproduction, not yet executed: let the primary tool operation succeed, delay its secondary metadata status response beyond 500 ms while the transport remains connected, then invoke another browser operation. Assert that the metadata timeout does not remove the registered host.
Expected behavior
The optional lookup for toolIcon.pageUrl can fail without invalidating the browser automation host. Return the primary action result without metadata and keep subsequent browser operations usable. A slow metadata response should not require a desktop restart.
Actual behavior
Browser automation repeatedly became unavailable during normal use. The optional metadata request timed out after 500 ms and the broker disconnected the host; subsequent tools failed with No preview automation host is available.
Both machines remained online, and the private preview URL still returned HTTP 200 from Linux. The failure interrupted authenticated browser verification and prevented exporting one active recording.
Read-only inspection of the bundled Linux server, resources/app.asar/apps/server/dist/bin.mjs, found:
PreviewToolkit.invokeadds a secondary brokerstatusinvocation after most operations to obtaintoolIcon.pageUrl. It setstimeoutMs: 500andupdateCurrentTab: false, and catches lookup failure by returningnull.status,open,navigate, andsnapshotare excluded from this extra lookup.PreviewAutomationBroker.awaitResponsehandles timeout by callingdisconnect(connection.clientId, connection.queue)before raisingPreviewAutomationTimeoutError.- Therefore, catching the optional metadata lookup error in the toolkit does not undo its host-disconnection side effect. This provides a concrete mechanism by which a successful-looking action result can be followed by persistent no-host failures. This matches the captured timeout/disconnect sequence; it does not establish what delayed the status response.
In this installed build, the relevant sections are around bundled lines 198290–198310 (metadata lookup) and 164680–164700 (timeout/disconnect). These are generated-bundle locations, not asserted upstream source line numbers. The T3 installation was not patched or restarted on Linux.
Suggested fix: distinguish optional metadata failure from host-liveness failure. Add coverage for a successful primary action followed by slow metadata, a response arriving after its deadline, and subsequent operations on the same host. Host re-registration is separately discussed in #12146.
Impact
Major degradation or frequent failure
Version or commit
T3 Code Alpha 0.0.42 on Mac and Linux. Linux version verified from the installed app package; findings refer to that installed bundle, not an assumed current upstream revision.
Environment
T3 Connect with workspace/agent/server on Linux and the embedded browser on macOS. Mac preview user agent: Chrome 152.0.7977.65, Electron 44.1.0. Exact macOS version not collected. Production-mode SvelteKit preview over valid private Tailscale HTTPS. No TLS or authentication bypass. Observed September 17, 2026.
Logs or stack traces
The Linux server trace shows this sequence at approximately 2026-09-17 16:23:02 UTC:
16:23:02.090 PreviewAutomationBroker.invoke / awaitResponse (status)
16:23:02.590 PreviewAutomationBroker.disconnect / closeConnection
PreviewAutomationTimeoutError:
Preview automation status timed out after 500ms.
16:23:02.600 PreviewAutomationNoAvailableHostError:
No preview automation host is available for navigate in environment <id>.
16:23:02.603 Same no-host failure for evaluate
16:23:02.614 Same no-host failure for recordingStop
16:23:06.709 PreviewAutomationBroker.respond completes successfully
The later respond span shows subsequent response handling, but its trace does not identify the request in the displayed fields; it is not proof of which request replied late. Focus-host RPC spans also succeeded while normal operations remained unavailable.
Screenshots, recordings, or supporting files
Relevant sanitized trace and installed-code findings are included above. Full traces and application recordings are omitted because they contain unrelated session/application data. No credentials, token-bearing URLs or private hostnames are included.
Workaround
Restarting T3 Code on the Mac and reconnecting restored automation. The final verification session completed using explicit navigation tools and form submissions separated from document navigation, without modifying T3. That successful session does not establish a reliable workaround.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the upstream implementations corresponding to PreviewToolkit.invoke and PreviewAutomationBroker.awaitResponse, using the bundled sections around lines 198290–198310 and 164680–164700 as references. Add regression coverage for a successful primary action followed by delayed optional metadata, a late response, and subsequent operations on the same host; done means the metadata timeout no longer disconnects the host.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- api, backend, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100