Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: Preview automation stays pinned to the first desktop client and is never re-ranked when the user moves to another machine

Đã đóng Phù hợp với người mới
#16,491 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong thư mục apps/server, mở tệp PreviewAutomationBroker và tìm phương thức invoke của nó. Hiện tại, phiên được gán theo khóa environmentId + providerSessionId được dùng lại mà không xếp hạng lại khi kết nối còn hoạt động. Tìm logic xếp hạng hiện có ưu tiên các host có tab mục tiêu đang hiển thị và có focus, sau đó sửa đổi invoke để kích hoạt việc xếp hạng lại này khi yêu cầu có tabId tường minh thuộc về một host khác, hoặc khi một host khác có tab mục tiêu đang hiển thị và có focus trong khi host được gán thì không. Chạy bộ kiểm thử tự động hóa xem trước để xác nhận các phiên được gán lại chính xác khi người dùng chuyển đổi giữa các ứng dụng khách trên máy tính.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Area

apps/server (PreviewAutomationBroker)

Steps to reproduce
  1. Connect T3 Code Desktop on Machine A and Machine B to one environment that runs on Machine A.
  2. While working from Machine B, have an agent in a thread call any preview tool. The broker assigns the session to Machine B's browser host.
  3. Move to Machine A, open the same thread's Browser panel, and keep a tab visible and focused there. Leave Machine B's app running.
  4. Have the agent call preview_snapshot or preview_navigate with an explicit tabId for the tab that is visible on Machine A.
Expected behavior

The call runs in Machine A's browser, which owns the visible target tab and is focused.

Actual behavior

Every call still goes to Machine B (Preview automation <op> failed on client preview-…). localhost URLs fail with ERR_CONNECTION_REFUSED because Machine B can't reach Machine A's localhost. preview_status reports the tab as visible: false. Focusing Machine A, opening new tabs, and passing an explicit tabId have no effect.

Cause

In invoke, the assignment keyed by environmentId + providerSessionId is reused whenever its connection is still live. The ranking that prefers a host owning the visible target tab, then focus, only runs when there is no live assignment. Nothing re-ranks an existing assignment, so the session is pinned to the first host until that host disconnects. The only ways out are reloading or quitting the stale client, restarting the provider session, or triggering the eviction in #12898.

Suggested fix

Re-rank when the request has an explicit tabId that only another host owns, or when another host owns the target tab as visible and focused while the assigned host doesn't have it visible.

Related

#12898, #15335

Version

0.0.46-nightly.20261003.2638, macOS, Claude provider, local environment with a second desktop client over Tailscale.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
2 giờ 31 phút
Pull request đã merge (30 ngày)
475

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.