Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Chat hangs on "Waiting model" when LLM stream stalls - STOP cannot interrupt blocked I/O

Abierto
#279 2 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
clojure
Área
backend

Línea de trabajo

Start by reading chat.clj, llm_api.clj, and the streaming provider files to trace how STOP is handled and where each provider reads the response stream. The issue proposes storing the stream for cancellation; verify how that fits the existing callbacks and error handling. Done means STOP cancels a stalled stream, returns chat to idle, and allows a new message.

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

Descripción

bug

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

This ticket has been created by ECA. There is currently no known way how to reproduce this bug. It just randomly appears (with no error) so I asked Claude to find out what is going on ;-)

Describe the bug
When an LLM provider's streaming response stalls (server keeps connection open but stops sending data), the chat gets
stuck on "Waiting model" indefinitely. Clicking STOP does not recover the chat. Attempting to shut down ECA also
fails with "Timeout while waiting for response. Method: shutdown".

Root cause: .readLine() on the response InputStream blocks forever. STOP sets a :stopping flag, but this flag is only
checked in callbacks that fire after .readLine() returns. Since it never returns, the flag is never checked.
Thread.interrupt() does not work on blocking java.io streams.

Affects all streaming providers (openai_chat, anthropic, ollama, openai).

To Reproduce (not sure if possible)
Steps to reproduce the behavior:

  1. Start a chat with any streaming LLM provider
  2. Send a message
  3. Have the LLM server stall mid-stream (keep connection open, stop sending data)
  4. Observe chat stuck on "Waiting model"
  5. Click STOP - chat remains stuck
  6. Try to stop ECA - get "Timeout while waiting for response. Method: shutdown"

Expected behavior

  • Clicking STOP should immediately cancel the request and return chat to idle state, allowing new messages to be sent.
  • There should be some timeout (180s?) on streaming response

Additional context
Proposed fix: Store the response InputStream when streaming starts, close it when STOP is pressed. Closing the stream
causes .readLine() to throw IOException, which is already handled via on-error.

Implementation:

  1. Add cancel-stream* atom to callbacks, store in chat state
  2. Each provider stores body (InputStream) in the atom before reading
  3. prompt-stop closes the stream via the atom

~10 lines across chat.clj, llm_api.clj, and each provider file.

Lenguaje dominante
Clojure
Estrellas
1k
Forks
82
Merge medio
1 d 14 h
PR fusionados (30 d)
16

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 editor-code-assistant/eca

Todos los issues de editor-code-assistant/eca

Issues similares

Más issues de Clojure

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.