Pi extension: a gated review from the plannotator tool ends 30 s after its tab closes

クローズ 初心者向け
#2,553 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #2581 @utpalsinghdev による — マージ済み

評価

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

調査の方向性

plannotator-browser.tsを読み、startMarkdownAnnotationSessionをたどって、Pi拡張機能がclientLeaseSupportedをどのように設定しているかを確認します。issueに記載されているCLIゲートの動作と比較してください。拡張機能から開かれたレビューではclient-leaseのサポートを無効にし、タブを閉じてもレビューが停止せず、レビュアーが引き続きレビューを送信または終了できることを確認してください。

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

説明

What happens. The plannotator tool with {"action":"annotate","gate":true} starts the annotate server with
clientLeaseSupported: gate === true && !isRemoteSession() (plannotator-browser.ts,
startMarkdownAnnotationSession). When no tab holds /api/annotate/client-lease for 30 s
(ANNOTATE_CLIENT_LEASE_GRACE_MS), the decision settles as { exit: true } and the server stops. The extension
handles that as "closed", and only shows Annotation session closed.. The agent gets no message, and its list no
longer shows the review.

Why it is a problem. The client lease is there so that the blocking CLI gate (plannotator annotate --gate --json) does not wait forever. The Pi tool does not block: it returns at once, and the decision comes later as a
message. A reviewer who closes the tab, or whose proxy or tunnel drops the stream for 30 s, loses the review, and
the agent does not know.

Steps.

  1. Open a review with the tool and gate: true.
  2. Connect to GET /api/annotate/client-lease, then disconnect.
  3. After about 32 s, the port does not answer, and the agent got no message.

Without gate, the lease route answers 404 and the review stays open.

Why PLANNOTATOR_REMOTE=1 is no fix. It turns the lease off, but it also binds each server on 0.0.0.0
(getServerHostname), gives every review the fixed port 19432 (getServerPorts), so a second review preempts the
first (startServerWithSelfPreemption), turns off the session bridge ("Ask this session"), live app annotation, the
agent terminal, host control, and "Open in", and changes the tool's result text to "open … on your local machine
(forward the port if needed)".

Suggestion. Enable the client lease only for the blocking CLI gate, not for reviews that the Pi extension's tool
opens: clientLeaseSupported: false in startMarkdownAnnotationSession. With that one change, the review stays
open after its tab closes, until the reviewer decides or closes it, on Pi and on OMP.

Version: @plannotator/pi-extension 0.28.21, checked on Pi 1.4.0 and Oh My Pi 18.13.3.

主要言語
TypeScript
スター
8.7k
フォーク
649
平均マージ
8時間 40分
マージ済み PR(30日)
786

環境構築

はじめの一歩

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

backnotprop/plannotator のほかの issue

backnotprop/plannotator の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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