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

Cerrado Apto para principiantes
#2,553 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Ya se ha fusionado un pull request relacionado.

  • #2581 de @utpalsinghdev — fusionado

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

Lee plannotator-browser.ts y sigue startMarkdownAnnotationSession para ver cómo la extensión de Pi configura clientLeaseSupported; compara el comportamiento de la barrera de la CLI descrito en la incidencia. Desactiva la compatibilidad con client leases para las revisiones abiertas por la extensión y luego verifica que cerrar la pestaña no detenga la revisión y que el revisor todavía pueda enviarla o cerrarla.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
649
Merge medio
11 h 7 min
PR fusionados (30 d)
862

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de backnotprop/plannotator

Todos los issues de backnotprop/plannotator

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.