Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#16,491 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

apps/serverディレクトリから始め、PreviewAutomationBrokerファイルを開いて、そのinvokeメソッドを見つけます。接続が有効な場合、environmentId + providerSessionIdをキーとするセッション割り当ては、現在、再ランキングされずに再利用されています。表示中の対象タブがあり、フォーカスがアクティブなホストを優先する既存のランキングロジックを見つけ、リクエストに別のホストが所有する明示的なtabIdがある場合、または割り当て先のホストには対象タブが表示されておらずフォーカスもない一方で、別のホストには対象タブが表示されフォーカスされている場合に、この再ランキングを実行するようinvokeを変更します。ユーザーがデスクトップクライアント間を切り替えたときにセッションが正しく再割り当てされることを確認するため、プレビュー自動化のテストスイートを実行します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
24.8k
フォーク
6.4k
平均マージ
7時間 58分
マージ済み PR(30日)
258

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。