ui.matches/string waitFor hangs the run when screen() hits OpenTUI OutputBusy

Abierto Apto para principiantes
#142 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Empieza con packages/simulation/src/frontend/actions.ts, donde el issue identifica screen() y matches() como la ruta que falla; compárala con la ruta de espera de inactividad del renderizado que usa ui.capture. Reproduce el problema con las dos llamadas consecutivas a ui.waitFor() descritas en el issue y comprueba que el endpoint de simulación responde cuando falla una lectura del búfer. El trabajo estará hecho cuando matches espere a que el renderizado quede inactivo y los errores devuelvan una respuesta en lugar de dejar el RPC sin responder.

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

Descripción

bug

Summary

ui.matches (and therefore ui.waitFor("some text"), which polls it) can fail permanently on a current V2 checkout:

opencode drive ui websocket: request failed cause="NativeError: ot_session_acquire_buffer_lease failed: OutputBusy"
    at withResolvedChars (@opentui/core buffer.ts)
    at screen (packages/simulation/src/frontend/actions.ts:94)
    at matches (packages/simulation/src/frontend/actions.ts:150)

The simulation endpoint logs the failure and never answers the RPC, so Drive waits until UiTimeoutError (30s) and aborts the run. matches calls screen() (a direct currentRenderBuffer.getRealCharBytes() read) without waiting for the renderer to go idle, so it races a render that holds the buffer lease. ui.capture re-renders and waits for idle() first, and did not fail in 6+ consecutive calls in the same run.

The first matches usually succeeds and a later one fails, so a waitFor that has already matched once can still die mid-poll.

Reproduction

yield* ui.submit("Run something")
yield* ui.waitFor("step 3", { timeout: 30_000 })  // may succeed
yield* ui.waitFor("step 4", { timeout: 30_000 })  // UiTimeoutError: ui.matches timed out after 30000ms

100% reproducible across 3 runs on this checkout, with recording: false.

Expected

  • The simulation endpoint answers the RPC with an error (or retries internally) instead of leaving it unanswered; a failed read should surface as a catchable UiWaitTimeoutError/operation error, not hang the whole run.
  • matches/screen should use the same render-idle path as capture.

Environment

  • opencode-drive 2.4.0
  • OpenCode b032f90634 (PR #62977 worktree), @opentui/core 0.8.1
  • TUI stderr/log: /tmp/opencode-drive/run-af7b2256-d917-4337-b2cd-c92c25a62afb/logs/opencode/log/opencode-local.log (search OutputBusy)

Workaround

Poll ui.capture() and search the joined span text yourself (what I did for the recording), instead of ui.matches/string waitFor.

Lenguaje dominante
TypeScript
Estrellas
41
Forks
9
Merge medio
39 min
PR fusionados (30 d)
9

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 anomalyco/opencode-drive

Todos los issues de anomalyco/opencode-drive

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.