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

Chiusa Adatta ai principianti
#2,553 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #2581 di @utpalsinghdev — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Leggi plannotator-browser.ts e segui startMarkdownAnnotationSession per vedere come l’estensione Pi configura clientLeaseSupported; confronta il comportamento del gate della CLI descritto nell’issue. Disabilita il supporto per i client lease per le review aperte dall’estensione, quindi verifica che la chiusura della scheda non interrompa la review e che il reviewer possa ancora inviarla o chiuderla.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
8.7k
Fork
649
Merge medio
8h 25m
PR unite (30g)
761

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di backnotprop/plannotator

Tutte le issue di backnotprop/plannotator

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.