Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#279 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
clojure
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Clojure
Star
1k
Fork
82
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của editor-code-assistant/eca

Tất cả issue của editor-code-assistant/eca

Issue tương tự

Thêm issue về Clojure

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.