Skip to content

fix: restore internal browser access after preview automation host disconnects #4

Description

@jvelascodev

Problem

The built-in Browser panel initially opens and supports successful automation. Later attempts to reuse it fail because the preview automation host is no longer available. The agent then cannot inspect or control the browser, including closing it, even though it was previously usable.

This interrupted UI verification and before/after screenshot capture during project-agent work. The user had to close and reopen the app/browser manually to try to restore access.

Observed behavior

  • Opening the internal browser and using it initially succeeds.
  • Later calls to preview tools fail with an error such as No preview automation host is available for status in environment <environment-id>.
  • The same failure has affected waiting for page content and taking subsequent snapshots.
  • The user reports that the agent cannot close the browser after access is lost.
  • The exact trigger is not established. Server restarts and later reuse occurred during the session, but neither has been confirmed as the cause.

Expected behavior

The agent should retain access to its existing browser across subsequent tool calls, or recover the connection automatically when the host reconnects. A disconnected state should explain what happened and offer a reliable recovery path. Closing the browser should remain possible or recoverable without requiring the user to restart T3 Code.

Investigation and acceptance criteria

  • Reproduce successful open/use followed by later reuse and determine why the automation host registration becomes unavailable.
  • Check browser-host lifecycle and reconnection across panel close/reopen, application reconnect, and development-server restarts without assuming any one is the cause.
  • Reuse the existing tab after recovery without leaving orphaned panels or stale tab references.
  • Verify navigation, snapshot, interaction, and close after recovery.
  • Add focused regression coverage for the confirmed lifecycle failure.
  • Capture evidence of the failure and recovery in the real built-in Browser panel.

Separate from #3, whose implementation is paused pending browser recovery and a before screenshot.

Activity

  1. jvelascodev commented on Sep 21, 2026

    @jvelascodev
    OwnerAuthor

    Controlled reproduction in the installed T3 Code 0.0.42 desktop, using its built-in Browser panel against the isolated dev app:

    1. Opened the app, captured snapshots, and clicked Settings successfully using tab_1. The attached screenshot is the working state before the timeout, not evidence of recovery.
    2. Evaluated new Promise(resolve => setTimeout(() => resolve('controlled delayed read completed'), 18000)) with promise awaiting enabled. The operation returned Preview automation evaluate timed out after 15000ms.
    3. Subsequent status and evaluate calls for the same tab returned No preview automation host is available.
    4. Read-only inspection of the installed desktop bundle found no preview subscription repeat branch. Source commit 5378f87f9, already in this fork, contains that branch.

    The worktree was t3code/check-issue-4 at 1bc2e157a plus the test/diagnostic diff during the smoke test; the final equivalent diff is committed as e59db04a after rebasing. The automation host came from the installed desktop, not the dev web page. Final focused checks passed 51 tests, targeted lint/formatting, and both affected package typechecks.

    Recovery and closing on an updated desktop remain untested. The Browser host became unavailable, so the test-t3-app skill required stopping verification. The uploaded image has not been verified in GitHub's rendered UI for the same reason. This report does not establish merge readiness.

    Working Browser tab before controlled timeout

  2. jvelascodev commented on Sep 21, 2026

    @jvelascodev
    OwnerAuthor

    Closing after the user confirmed installation of the updated desktop. The host re-registration fix was already included in main via upstream commit 5378f87; merged PR #5 adds RPC regression coverage and recovery guidance. The old installed desktop was confirmed to lack the recovery logic. Automated checks passed; post-update live recovery has not been independently reverified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions