Chat hangs on "Waiting model" when LLM stream stalls - STOP cannot interrupt blocked I/O
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
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ả
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:
- Start a chat with any streaming LLM provider
- Send a message
- Have the LLM server stall mid-stream (keep connection open, stop sending data)
- Observe chat stuck on "Waiting model"
- Click STOP - chat remains stuck
- 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:
- Add cancel-stream* atom to callbacks, store in chat state
- Each provider stores body (InputStream) in the atom before reading
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của editor-code-assistant/eca
-
Models doesn't work when fetchModels: false is usedCó thể đã có người làm @zikajk đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
editor-code-assistant/eca#661 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
docs page illustrationĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
editor-code-assistant/eca#664 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
editor-code-assistant/eca#662 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
editor-code-assistant/eca#652 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
editor-code-assistant/eca#648 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của editor-code-assistant/eca
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
.Frontend .Team/UXWest Priority:P3 Querying/Filters Type:Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
metabase/metabase#85298 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pgwire
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Evals take an extra 40ms each on Linux, since the server doesn't set TCP_NODELAYCó thể đã có người làm @bbatsov đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 3 ngày